Is It a Prime Number?

Enter a whole number and press Check. You find out at once whether it is prime. Composite numbers get their prime factorization and divisors, and every number gets its nearest primes.

Try an example

About this prime number checker

A prime number is a whole number greater than 1 that can only be divided exactly by 1 and itself, such as 2, 3, 5, 7, and 11. Every other whole number above 1 is composite and can be written as a product of primes in exactly one way. For smaller numbers, this checker tests divisors up to the square root; for larger ones it uses the Miller–Rabin test with bases that are proven to give the right answer at this size, so the result is certain rather than probable. Composite numbers are factored completely, even when their factors are large, and prime results are checked against well-known prime families.

How to check if a number is prime

  1. Enter a whole number. Type any number from 0 up to 20 digits, or press an example. Digit-group commas and spaces are ignored.
  2. Press Check. The answer appears with the reason: the factor that divides it, or why no factor exists.
  3. Explore the details. See the prime factorization and all divisors of a composite number, the special types of a prime, and the primes just before and after it.

Frequently asked questions

Is 1 a prime number?

No. A prime needs exactly two different divisors, and 1 has only one. Leaving 1 out also keeps every number’s prime factorization unique, so mathematicians treat it as neither prime nor composite.

Is 2 the only even prime?

Yes. Every other even number can be divided by 2, so it has at least three divisors. That makes 2 the smallest prime and the only even one.

How do I check by hand whether a number is prime?

Try dividing it by the primes 2, 3, 5, 7, and so on, up to its square root. If none divides exactly, the number is prime. For 97, the square root is under 10, and none of 2, 3, 5, or 7 divides it.

Is 1001 a prime number?

No. 1001 = 7 × 11 × 13, so it is composite. Numbers that look prime, like 91 = 7 × 13 and 1001, are common traps.

What is a twin prime?

Twin primes are pairs of primes that differ by 2, such as 11 and 13 or 17 and 19. Nobody has yet proved whether there are infinitely many of them.