Prime number checker
Calculators
Enter a whole number.
Runs in your browser
Nothing is uploaded. The work happens on your own device, so your file or text never reaches us.
About this tool
The answer is a proof, not a probability
Trial division is hopeless past about sixteen digits. This uses the Miller-Rabin test with the twelve witnesses 2, 3, 5, …, 37, which is deterministic for every number below 3.3 × 10²⁴.
So within that range the answer is certain, not probable. A 19-digit prime is confirmed in microseconds where trial division would run for years.
Why factorising is harder than testing
Telling whether a number is prime is easy. Finding the factors of a composite is not, and nobody knows an efficient way to do it.
That asymmetry is the foundation of RSA encryption: multiplying two 300-digit primes is instant, and recovering them from the product is beyond any current machine.
So the factoriser here is bounded. For a large number with large factors it will report the primality answer — still exact — and say that factoring was cut short. That is the honest outcome, not a failure.
One is not prime
A prime has exactly two distinct divisors: one and itself. One has only one divisor.
It is excluded for a better reason than convention: if 1 were prime, every number would have infinitely many factorisations (12 = 2²·3 = 1·2²·3 = 1²·2²·3…) and the fundamental theorem of arithmetic, which says each number factors into primes in exactly one way, would be false.