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

Is it prime?Yes — 97 is a prime number
Previous prime
89
Next prime
101

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?

  1. √97 ≈ 9.85, so test the primes 2, 3, 5 and 7
  2. 97 is odd; 9 + 7 = 16 is not divisible by 3; it does not end in 0 or 5; 97 ÷ 7 = 13.86…
  3. No divisor found

97 is prime. The primes either side are 89 and 101.

Quick divisibility checks

DivisorRule
2Last digit is even
3Digit sum is divisible by 3
5Ends in 0 or 5
7Double the last digit and subtract from the rest; repeat
11Alternating digit sum is divisible by 11