Prime number checker

Type a whole number to see whether it is prime, its prime factors, its divisors and the nearest primes.

Result

How it works

Primality is checked with the Miller-Rabin test using a fixed set of bases that is proven exact for every number below 3.3 × 10²⁴. Factors are found by trial division and Pollard’s rho method.

Worked example

  1. 2026 ÷ 2 = 1013
  2. 1013 has no divisor up to √1013 ≈ 31.8
  3. 2026 = 2 × 1013, not prime

Frequently asked questions

What is a prime number?

A whole number greater than 1 that can only be divided by 1 and itself: 2, 3, 5, 7, 11, 13… 1 is not prime, and 2 is the only even prime.

How large a number can it check?

Any number up to about 20 digits exactly (it uses the deterministic Miller-Rabin test). Factorizing is fast up to around 15 digits; larger numbers with two big prime factors take longer.

What are the divisors?

All the numbers that divide it evenly, including 1 and the number itself. A prime has exactly two.