Free Prime Number Checker

Free prime number checker: test numbers up to 60 digits, see the prime factorisation and next or previous prime, or list every prime in a range with a sieve.

  • No upload, 100% private
  • Instant, in your browser
  • 100% free, no signup
Loading tool…
Read the complete guideHow to Tell if a Number Is Prime: Divisibility Tests to Miller–Rabin →

About the Prime Number Checker tool

A prime number has exactly two divisors: 1 and itself. 2, 3, 5, 7 and 11 are prime; 221 is not, because it equals 13 × 17. Testing small numbers by hand is fine, but checking whether a 12-digit or 40-digit number is prime needs a proper algorithm. This checker tests whole numbers up to 60 digits instantly in your browser and tells you why the answer is what it is.

For numbers up to a trillion it explains the classic method: you only need to try prime divisors up to the square root. For larger numbers it uses trial division followed by the Miller–Rabin test with fixed bases, which is a mathematical proof of primality for every number below about 3.3 × 10²⁴; above that, 25 bases are used and the result is labelled a probable prime, as professional software does. Composite numbers are factorised with trial division and Pollard’s rho algorithm, and you also get the number of divisors, the full list of divisors for smaller numbers, and the previous and next primes.

The second mode lists every prime in a range using a segmented Sieve of Eratosthenes — for example all 25 primes up to 100, or the primes between 999,999,000,000 and 1,000,000,000,000 — with a count and a copy button for the full list.

How to use Prime Number Checker

  1. Choose “Check a number” or “List primes in a range”.
  2. To check a number, type it into “Number to check” — the verdict updates as you type.
  3. Read the result card for the prime factorisation, divisors, previous prime and next prime.
  4. For a list, enter “From” and “To” values; the range can span up to 1,000,000 numbers and end as high as 10¹².
  5. Click “Show steps” for the explanation, or the copy icon to copy the verdict or prime list.

Features

Numbers up to 60 digits

Deterministic Miller–Rabin proves primality below 3.3 × 10²⁴ and gives a reliable probable-prime verdict above.

Prime factorisation

Trial division plus Pollard’s rho split composite numbers into primes, with exponents shown like 2³ × 3² × 5.

Next and previous prime

Find the nearest primes on either side of any number.

Prime lists with a sieve

A segmented Sieve of Eratosthenes lists all primes in a range quickly, with a count and copy-all button.

Divisor count and list

See how many divisors a number has and list them when there are 200 or fewer.

When to use it

  • Check homework answers about prime and composite numbers.
  • Find the prime factorisation of a number to simplify a fraction or radical.
  • Generate a list of primes for a programming exercise or test data.
  • Pick a large prime modulus for a hashing or cryptography experiment.
  • Explore patterns such as twin primes or prime gaps in a range.

Frequently asked questions

Is 1 a prime number?

No. A prime must have exactly two distinct divisors, and 1 has only one. Excluding 1 also keeps prime factorisation unique.

Why is 2 the only even prime?

Every other even number is divisible by 2, so it has at least three divisors (1, 2 and itself).

How do you check if a number is prime by hand?

Try dividing it by each prime up to its square root. If none divides evenly, it is prime. For 97, √97 ≈ 9.8, and 2, 3, 5 and 7 don’t divide it, so 97 is prime.

What is the Miller–Rabin test?

A fast test based on Fermat’s little theorem. With the fixed set of 13 bases used here it never gives a wrong answer below 3.3 × 10²⁴; beyond that a composite number passing 25 bases is astronomically unlikely.

How many primes are there below 1,000,000?

78,498. You can verify it by listing primes from 1 to 1,000,000 in the range mode.

Can it factor any 60-digit number?

Not always. Numbers made of two very large primes (the kind used in RSA) are deliberately hard to factor. The checker still tells you such a number is composite and shows any factors it finds within its time limit.

Related tools