Prime Number Checker

Check whether any number is prime, see its prime factorisation and divisors, find the next and previous prime, and list every prime in a range.

Is this number prime?

Spaces, commas and underscores are ignored. Up to 40 digits.

Prime factorisation
Number of divisors
Previous prime
Next prime

List every prime in a range

Up to 200,000 numbers per search, with an upper bound of 1,000,000,000,000.

No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

A prime number is a whole number greater than 1 whose only divisors are 1 and itself. Type a number and this checker answers instantly: for small values it divides by the small primes, and for large ones it runs a deterministic Miller–Rabin primality test on JavaScript BigInts, which stays exact well past the range an ordinary calculator can handle — up to 40 digits. Composite numbers are broken down into their prime factorisation using trial division plus Pollard's rho algorithm, and the page also shows how many divisors the number has, lists them when there are only a few, and gives the previous and next prime so you can see the gap around your number.

The second tool lists every prime between two numbers using a segmented Sieve of Eratosthenes, so a 200,000-wide window is scanned in a fraction of a second even up near a trillion. Everything runs in your browser with plain JavaScript: no number you type is uploaded, there is no sign-up, no ads and no trackers. Copy any result to the clipboard or download it as a plain text file.

Frequently asked questions

How do you know if a number is prime?

A number is prime when it is a whole number greater than 1 and no whole number other than 1 and itself divides it exactly. By hand you only need to test the primes up to the square root of the number: 97 is prime because it is not divisible by 2, 3, 5 or 7, and 11 × 11 already exceeds 97. This checker does the same thing for small values and switches to a deterministic Miller–Rabin test for large ones, so a 30-digit number is still answered instantly and exactly.

How large a number can this prime checker handle?

Up to 40 digits. The page uses JavaScript BigInts rather than ordinary floating-point numbers, so it stays exact far beyond the usual 9,007,199,254,740,991 limit where most online calculators start rounding and giving wrong answers. Composite numbers are broken into their prime factors with trial division plus Pollard's rho; if a number is a product of two enormous primes the page will still tell you it is composite even when finding the factors would take too long.

What is the largest prime number under 100?

97. The 25 primes below 100 are 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. You can reproduce that list with the range tool on this page by entering 1 and 100 — it uses a segmented Sieve of Eratosthenes and can list every prime in a window of up to 200,000 numbers, then copy them or download them as a text file.

Report a bug