Math

Prime Number Checker

Enter any whole number to instantly check whether it's a prime number — and if it isn't, see its complete list of factors.

Enter a number

Is it prime?
Enter a number to check.

How the Prime Number Checker formula works

A number is prime if it has no divisors other than 1 and itself:

For n, check every integer from 2 up to √n
If any of them divide n evenly, n is not prime

Only checking up to the square root is a well-known optimization: if n has a factor larger than √n, it must also have a corresponding factor smaller than √n, so any factor pair would already have been found.

Step-by-step calculation

  1. Rule out numbers less than 2, which aren't prime by definition.
  2. Test divisibility by every integer from 2 up to the square root of the number.
  3. If none divide evenly, the number is prime. If any does, the number is composite, and all its factors are listed.

Worked example

Checking 97: testing divisors 2 through 9 (since √97 ≈ 9.85), none divide evenly — 97 is prime. Checking 96: 2 divides evenly, so 96 is not prime, with factors 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 96.

Frequently asked questions

Is 1 a prime number?

No — by definition, a prime number has exactly two distinct positive divisors (1 and itself). Since 1 only has one divisor, it's classified as neither prime nor composite.

Is 2 the only even prime number?

Yes — every other even number is divisible by 2 in addition to 1 and itself, which means it has at least three divisors and can't be prime.