Skip to content
Jellykit

Prime Number Checker

Test whether a whole number of up to 100 digits is prime, see its prime factorization, and find the next and previous primes.

  • Runs on your device
Loading tool

About Prime Number Checker

Enter a whole number to find out whether it is prime. Composite numbers are broken into their prime factors, with the smallest factor and the number of divisors, and the nearest primes above and below are listed for every input.

Primality is decided with the Miller-Rabin test, which is proven exact for every number below 3.3 × 10²⁴ with the bases used here. Larger numbers up to 100 digits are reported as probable primes, and factors that are too large to find quickly are shown unsplit rather than guessed.

How it works

  1. Small factors are found by dividing by every prime below 10,000. What remains is tested with Miller-Rabin, which checks whether the number behaves like a prime under repeated squaring modulo itself.
  2. Composite parts left over are split with Pollard’s rho method, which finds a factor in roughly the square root of its size in steps. It gets a fixed amount of work so the page stays responsive.
  3. The next and previous primes are found by testing each odd number in turn, skipping those with a small factor.
  4. All arithmetic is on exact whole numbers in your browser; nothing is rounded and nothing is sent anywhere.

Questions

Is 1 a prime number?

No. A prime has exactly two divisors, 1 and itself, and 1 has only one. That is also why every whole number has just one prime factorization.

What does "probable prime" mean?

Above 3.3 × 10²⁴ no fixed set of Miller-Rabin bases is proven to catch every composite. The tool uses 25 bases; a composite would need to pass all of them, which is far less likely than a hardware error. A "composite" verdict is always certain.

Why is part of a factorization shown in brackets?

When a composite number is the product of two very large primes, finding them can take far longer than a web page should block. The bracketed part is known to be composite, but its factors are not listed.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.