Math

Prime Number Checker

A prime number is a whole number greater than 1 whose only divisors are 1 and itself. Enter a number below to see at once whether it is prime, read its prime factorization, find the next and previous primes, and list every prime up to any limit.

Not prime600851475143 is composite. It has at least one divisor other than 1 and itself.
Prime factorization71 * 839 * 1471 * 6857
Next prime600851475149
Previous prime600851475067

Quick reference

TermWhat it means
PrimeA whole number greater than 1 whose only divisors are 1 and itself.
CompositeA whole number greater than 1 that has a divisor other than 1 and itself.
0 and 1Neither prime nor composite, by definition.
2The only even prime. Every other even number is divisible by 2.
Prime factorizationWriting a number as a product of primes, such as 360 = 2^3 * 3^2 * 5.

How to use it

1. Enter a number

Type any whole number. Commas and spaces are ignored, and very large numbers are fine.

2. Read the verdict

The tool shows at once whether the number is prime or composite.

3. See the detail

Read the prime factorization and the next and previous primes, each copy-ready.

4. List a range

Enter an upper limit and build the full list of primes up to that number.

Common questions

What makes a number prime?

A prime number is a whole number greater than 1 that cannot be divided evenly by any number except 1 and itself. For example 7 is prime because nothing between 2 and 6 divides it, while 8 is not because 2 and 4 divide it. The numbers 0 and 1 are neither prime nor composite.

How does the checker handle very large numbers?

Primality uses a deterministic Miller-Rabin test, which is exact for every number below about 3.3 times 10 to the 24th power and an extremely strong test beyond that. The whole calculation uses big integers, so the number stays exact and is never rounded. Factorization uses trial division and Pollard rho, which factor large semiprimes quickly.

Why will it not factor my huge number?

Testing whether a number is prime is fast even for hundreds of digits, but fully factoring a very large number is a genuinely hard problem with no fast method. To keep the page responsive, factorization is limited to numbers of 40 digits or fewer. The prime verdict and the next and previous primes still work above that size.

Is the prime factorization unique?

Yes. The fundamental theorem of arithmetic says every whole number greater than 1 is either prime or can be written as a product of primes in exactly one way, apart from the order of the factors. The tool shows that product with each prime raised to its power, for example 600851475143 = 71 * 839 * 1471 * 6857.

Does anything I type leave my device?

No. The primality test, the factorization, and the sieve all run in your browser with plain JavaScript. Nothing you enter is sent to a server, so the tool keeps working the same way even after the page has loaded and you go offline.