Prime Number Checker - Is It Prime? Factorisation, Next Prime and a List of Primes

Type a whole number to find out whether it is prime. You get the verdict, the full prime factorisation, the number of divisors and the nearest primes on each side.

About this tool

A second box lists every prime up to 100,000 that you can copy. The test is exact for any number below 2^64 (18,446,744,073,709,551,615), and it all runs in your browser.

How it works

A prime is a whole number greater than 1 whose only positive divisors are 1 and itself, so 2, 3, 5, 7 and 11 are prime. 1 is not prime, because it has only one divisor, and 0 is neither prime nor composite. 2 is the only even prime, because every larger even number is also divisible by 2. A number greater than 1 that is not prime is called composite.

To test a number the page uses the Miller-Rabin test with the first twelve primes (2 to 37) as bases. This version is deterministic: it is known to give no wrong answer for any number below 318,665,857,834,031,151,167,461, which is far above the 2^64 limit used here. So a Yes or No from this page is a proof and not a probability. By hand, you only need to try dividing by the primes up to the square root of the number.

Every whole number greater than 1 is a product of primes in exactly one way, apart from the order (the fundamental theorem of arithmetic). The page finds the factors by dividing out the primes below 10,000 and then using Pollard's rho method on what is left. If a number is p^a × q^b × ..., it has (a + 1)(b + 1)... divisors, so 360 = 2^3 × 3^2 × 5 has 4 × 3 × 2 = 24 divisors.

The list of primes uses the sieve of Eratosthenes: cross out the multiples of each prime and what remains is prime. There are 25 primes up to 100, 168 up to 1,000, 1,229 up to 10,000 and 9,592 up to 100,000.

Worked examples

2027 is prime

No prime up to its square root (about 45) divides 2027. The previous prime is 2017 and the next is 2029, so 2027 and 2029 are twin primes. It is the 307th prime.

91 is not prime: 7 × 13

91 is not divisible by 2, 3 or 5, so it looks prime, but 7 × 13 = 91. It has four divisors: 1, 7, 13 and 91.

561 = 3 × 11 × 17

561 is the smallest Carmichael number, a composite that passes the simple Fermat test for every base that shares no factor with it. Miller-Rabin is not fooled, and the page reports it as composite with its three prime factors.

A big one: 2^64 - 1

18,446,744,073,709,551,615 = 3 × 5 × 17 × 257 × 641 × 65537 × 6700417. The largest prime below 2^64 is 18,446,744,073,709,551,557, which is 2^64 - 59.

1,000,000,007

A number often used in programming contests. It is prime; the previous prime is 999,999,937 and the next is 1,000,000,009.

The primes up to 500, in blocks of 50

RangePrimesHow manyTotal so far
1 to 502, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 471515
51 to 10053, 59, 61, 67, 71, 73, 79, 83, 89, 971025
101 to 150101, 103, 107, 109, 113, 127, 131, 137, 139, 1491035
151 to 200151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 1991146
201 to 250211, 223, 227, 229, 233, 239, 241753
251 to 300251, 257, 263, 269, 271, 277, 281, 283, 293962
301 to 350307, 311, 313, 317, 331, 337, 347, 349870
351 to 400353, 359, 367, 373, 379, 383, 389, 397878
401 to 450401, 409, 419, 421, 431, 433, 439, 443, 449987
451 to 500457, 461, 463, 467, 479, 487, 491, 499895

Frequently asked questions

Is 1 a prime number?

No. A prime must have exactly two divisors, and 1 has only one. Leaving 1 out also keeps the fundamental theorem of arithmetic true: if 1 were prime, 6 = 2 × 3 = 1 × 2 × 3 would have more than one factorisation.

Is 2 a prime number, and is it the only even prime?

Yes to both. 2 has only the divisors 1 and 2. Every other even number is divisible by 2 as well as by 1 and itself, so it is composite.

How can I check if a number is prime by hand?

Divide it by each prime up to its square root. If none divides it exactly, it is prime. To test 97 you only try 2, 3, 5 and 7, because 11 × 11 = 121 is already bigger than 97. None of them divides 97, so it is prime.

How many prime numbers are there below 100?

There are 25: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97.

Is there a biggest prime?

No. Euclid showed over two thousand years ago that there are infinitely many primes. This tool stops at 2^64 - 1 so that every answer stays exact and quick, but there is always a larger prime beyond any limit.

What are twin primes?

Twin primes are two primes that differ by 2, such as 11 and 13 or 2027 and 2029. When the number you check is a prime with a twin, the page tells you.

Why does the tool refuse numbers above 2^64 - 1?

Factorising an arbitrary number that large can take far too long in a browser tab, and this page promises exact answers and not guesses. It stops at one clear limit, 18,446,744,073,709,551,615, instead of taking minutes or freezing.

Updated Oct 13, 2026