Prime Number Checker
Is a number prime? Exact below 3.3 × 10²⁴, with the prime factorisation, divisors and their sum, the nearest primes either side and the primes up to it.
Prime or composite (and whether the answer is certain), the factorisation, the number, list and sum of divisors, the previous and next prime, and a sieve of the primes up to n.
Example: 97 is prime (89 before, 101 after, the 25th prime); 360 = 2³ × 3² × 5 with 24 divisors summing to 1 170; 600 851 475 143 = 71 × 839 × 1 471 × 6 857; 561 is composite (3 × 11 × 17).
Certain up to 24 digits,
and honest beyond.
How primality is decided, how the factors are found, and what the divisor figures mean.
Primality
After trial division by the first twelve primes, the Miller–Rabin test is run with those twelve as witnesses. That set is proven to give the exact answer for every n below 3 317 044 064 679 887 385 961 981 (about 3.3 × 10²⁴); beyond it the same test is a strong probable-prime test — a composite that fools all twelve witnesses is not known and the page says the answer is probabilistic. Carmichael numbers such as 561, which fool Fermat tests, are correctly rejected.
Factorisation
Trial division up to 10⁶ removes small factors; what remains is split with Pollard's rho until every piece passes the primality test. Numbers with two large prime factors near 10¹⁴ each are the practical limit in a browser; a piece that will not split in time is shown as found and marked.
Divisors and neighbours
From the exponents e₁, e₂ … the number of divisors is Π(eᵢ + 1) and their sum σ(n) = Π(pᵢ^(eᵢ+1) − 1)/(pᵢ − 1); the full list is generated when there are 500 or fewer. The previous and next primes are found by stepping and testing; the primes up to n come from a sieve when n is within the limit you set. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.
SOURCES
- Trial division by the first twelve primes, then Miller–Rabin with those bases — deterministic below 3 317 044 064 679 887 385 961 981; factorisation by trial division to 10⁶ and Pollard’s rho
Last reviewed 21 September 2026. How results are checked: How we verify.