Prime Number Checker
Type a whole number to find out whether it is prime. Composite numbers show a factor that proves it.
Check a number
What makes a number prime?
A prime number is a whole number greater than 1 whose only positive factors are 1 and itself. 2, 3, 5, 7, 11 and 13 are prime; 1 is not (it has only one factor), and 2 is the only even prime.
To test n, it is enough to try dividing by primes up to √n. If none divides evenly, n is prime. This checker uses that method with a 6k ± 1 wheel, which is exact for every number it accepts.
Worked example
Is 97 prime?
- √97 ≈ 9.85, so test the primes 2, 3, 5 and 7
- 97 is odd; 9 + 7 = 16 is not divisible by 3; it does not end in 0 or 5; 97 ÷ 7 = 13.86…
- No divisor found
97 is prime. The primes either side are 89 and 101.
Quick divisibility checks
| Divisor | Rule |
|---|---|
| 2 | Last digit is even |
| 3 | Digit sum is divisible by 3 |
| 5 | Ends in 0 or 5 |
| 7 | Double the last digit and subtract from the rest; repeat |
| 11 | Alternating digit sum is divisible by 11 |