Skip to content
AllCalcHub

Prime Number Checker

Check whether a number is prime, see its factors if it isn't, and find the nearest primes.

About the Prime Number Checker

Enter a whole number to test whether it's prime. The calculator gives the answer, the factors if it isn't prime, and the primes either side.

A prime number has exactly two factors: 1 and itself. To test a number you only need to try dividing by primes up to its square root; if none divides it, it's prime.

The formula

n is prime if no prime p ≤ √n divides n

The first 25 primes

RangePrimes
1–502, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47
51–10053, 59, 61, 67, 71, 73, 79, 83, 89, 97

Worked example

97

  1. √97 ≈ 9.85, so try 2, 3, 5 and 7
  2. None divides 97
  3. 97 is prime; the neighbouring primes are 89 and 101

Questions people ask

Is 2 prime?

Yes, and it's the only even prime.

How many primes are there?

Infinitely many, as Euclid proved more than 2,000 years ago.