Prime Number Checker

Test if a whole number is prime and find the primes on either side of it.

How to use the Prime Number Checker

  1. Enter the whole number.
  2. Press Calculate. The result updates automatically as you type.

About the Prime Number Checker

Prime numbers are the building blocks of the integers: 2, 3, 5, 7, 11, 13 and so on, each divisible only by 1 and itself. Every other number greater than 1 is composite and can be broken into primes. Primes become rarer as numbers grow, but there are infinitely many of them, as Euclid proved around 300 BC.

Quick shortcuts help before you reach for a calculator: any even number above 2 is composite, a number whose digits add up to a multiple of 3 is divisible by 3, and numbers ending in 0 or 5 (other than 5) are divisible by 5. For numbers up to ten million the checker also counts how many primes lie at or below your number.

Formula

A whole number n > 1 is prime if no whole number from 2 up to √n divides it evenly. You only need to test up to the square root, because any factor larger than √n pairs with one smaller than √n.

The checker tests 2 and 3, then only numbers of the form 6k ± 1, since every prime above 3 has that form.

Example calculation

Using the default values:

  • Whole number = 97

the calculator returns:

  • Result: 97 is a prime number
  • Previous prime: 89
  • Next prime: 101
  • Primes up to this number: 25

Frequently asked questions

Is 1 a prime number?

No. By definition a prime has exactly two distinct divisors. 1 has only one, so it is neither prime nor composite.

Is 2 the only even prime?

Yes. Every other even number is divisible by 2, so it has at least three divisors.

Is 91 prime?

No. 91 = 7 × 13, a classic number that looks prime but is not.

Last updated: · Category: Math calculators