Prime Numbers

Check if a number is prime, factorise it, and list primes to 100,000.

About this tool

Three jobs in one page: type any number up to a trillion and learn instantly whether it's prime; if it isn't, see its complete prime factorisation (360 = 2ยณ ร— 3ยฒ ร— 5) and the nearest primes either side; and generate the full list of primes up to any limit to 100,000 via the sieve of Eratosthenes โ€” an algorithm as old as the primes' fame.

Why primes matter beyond homework

The fundamental theorem of arithmetic says every whole number above 1 breaks into primes in exactly one way โ€” primes are the atoms of multiplication, and the factorisation this page shows is that atomic recipe. Two consequences reach daily life. The GCD and LCM of numbers fall straight out of shared prime factors, which is what simplifying fractions really is. And modern encryption rests on an asymmetry you can feel right here: multiplying two large primes is instant, but recovering them from the product is computationally brutal โ€” RSA keys are exactly that trick at 600-digit scale. Smaller pleasures: 2 is the only even prime, there are 25 primes below 100, and the gaps between primes grow on average but never settle into a pattern anyone has fully tamed โ€” twin primes like 41 and 43 keep appearing, and whether they appear forever is still an open question.

Frequently asked questions

Is 1 a prime number?

No โ€” by definition a prime has exactly two divisors, and 1 has only one. The convention isn't pedantry: unique factorisation breaks if 1 counts, since you could multiply extra 1s in forever.

What's the fastest way to check a prime by hand?

Trial-divide only by primes up to the square root: for 97 that's 2, 3, 5, 7 (since 10ยฒ > 97). None divide it, so it's prime. Any factor bigger than the root pairs with one smaller.

What is prime factorisation used for?

Simplifying fractions, finding GCDs and LCMs, and โ€” scaled up to enormous numbers โ€” the foundation of RSA encryption, which relies on factorising being vastly harder than multiplying.

How many primes are there?

Infinitely many โ€” Euclid proved it around 300 BC. They thin out as numbers grow (25 below 100, 168 below 1,000, 78,498 below a million) but never stop.