What the Prime Number Checker does
Type a number to check whether it is prime. The Prime Number Checker answers straight away and, for numbers that are not prime, shows the prime factorisation and the smallest factor. It also gives the number of divisors and the nearest primes either side, which is handy for homework, puzzles and programming. For the full list, see prime numbers 1 to 1000.
How to use it
- Enter a whole number, up to 9,007,199,254,740,991.
- Read the answer: prime, not prime, or neither for 0 and 1.
- Look below for the prime factors, the number of divisors and the previous and next primes.
Example
221 looks prime but is not: it is 13 × 17, so it has 4 divisors (1, 13, 17 and 221). The previous prime is 211 and the next is 223. Try 97 and the tool confirms it is prime, with 2 divisors.
How to check if a number is prime by hand
Divide by the primes up to the number’s square root. If none of them divides it exactly, the number is prime; there is no need to go further, because any larger factor would pair with a smaller one you have already tried. For 97, the square root is just under 10, so try 2, 3, 5 and 7. None divides 97, so 97 is prime. For 221, the square root is about 14.9, so try up to 13: 221 ÷ 13 = 17, so 221 is not prime.
Quick divisibility tests save most of the work:
- 2: the last digit is even.
- 3: the digits add up to a multiple of 3 (51: 5 + 1 = 6, so 51 = 3 × 17).
- 5: the last digit is 0 or 5.
- 7: double the last digit and take it from the rest (91: 9 − 2 = 7, so 91 = 7 × 13).
- 11: the alternating sum of the digits is a multiple of 11 (1001: 1 − 0 + 0 − 1 = 0, so 1001 = 7 × 11 × 13).
What makes a number prime
A prime has exactly two divisors: 1 and itself. 2 is the only even prime, and 1 is not prime, because it has only one divisor. Every whole number above 1 can be written as a product of primes in exactly one way, which is why the LCM and GCD Calculator and simplifying square roots both start from prime factors.
Prime numbers from 1 to 100
There are 25 primes below 100: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97. Numbers such as 51 (3 × 17), 57 (3 × 19), 87 (3 × 29) and 91 (7 × 13) look prime but are not, which makes them favourites in quizzes.
Questions people ask
Is 1 a prime number?
No. A prime needs exactly two different divisors, and 1 has only one, so it is neither prime nor composite.
Is 2 a prime number?
Yes. Its only divisors are 1 and 2, which makes it the smallest prime and the only even one.
Is 91 a prime number?
No. 91 = 7 × 13. It is the most common number people mistake for a prime below 100.
How is the number of divisors worked out?
From the factorisation: add one to each power and multiply. 360 = 2³ × 3² × 5, so it has 4 × 3 × 2 = 24 divisors.
Is there a largest prime?
No. There are infinitely many primes, as Euclid proved over 2,000 years ago.