ΣCalcSolver
Numbers

Prime Number Checker

Enter any whole number up to one trillion to find out whether it is prime. If it is not, you get its prime factorization and full list of divisors. Either way, you also see the closest primes on each side.

Loading the solver…

Quick start

  1. Type a whole number. The answer updates as you type.
  2. For a composite number, read the prime factorization and every divisor.
  3. Check the previous and next prime to see where your number sits.

Prime, composite, or neither

A prime has exactly two divisors: 1 and itself. 13 and 101 are prime. A composite number has more than two divisors, such as 15 = 3 × 5. The number 1 has only one divisor, so it is neither. 2 is the only even prime.

Why testing up to the square root is enough

If n splits as a × b, the two factors cannot both be bigger than √n, because then their product would exceed n. So if nothing up to √n divides n, nothing larger will either. To test 221, you only need primes up to 14. Trying 13 gives 221 = 13 × 17, so it is composite.

Counting divisors from the factorization

Write the number as primes with powers, add 1 to each power and multiply. 180 = 2² × 3² × 5, so it has (2 + 1)(2 + 1)(1 + 1) = 18 divisors.

Primes up to 50

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47. That is 15 primes.

Common questions

Is 1 prime?

No. A prime needs exactly two different divisors, and 1 has only one.

Is 91 prime?

No. 91 = 7 × 13. It often catches people out because it looks prime.

What is the largest number I can test?

Up to 1,000,000,000,000.