Prime Number Checker

Enter any whole number to find out if it is prime or composite, with the division test shown step by step.

Examples:97912211,009

91 is not a prime number. It is composite. 91 ÷ 7 = 13, so it divides evenly.

Square root test: √91 ≈ 9.54

  • 91 ÷ 2 = 45 remainder 1
  • 91 ÷ 3 = 30 remainder 1
  • 91 ÷ 5 = 18 remainder 1
  • 91 ÷ 7 = 13 remainder 0 (divides evenly)

A remainder of 0 means that prime divides the number, so it is not prime.

Prime factorization: 91 = 7 × 13

4 factors: 1, 7, 13, 91

What Is a Prime Number?

A prime number is a whole number greater than 1 with exactly two factors: 1 and itself. 7 is prime because only 1 and 7 divide it evenly. A composite number has more than two factors, so 8 is composite because 1, 2, 4 and 8 all divide it.

The number 1 is neither prime nor composite, because it has only one factor. And 2 is the only even prime.

How to Use This Prime Number Checker

  1. Type a whole number into the box. Use Paste if you have it copied.
  2. Press Check, or hit Enter.
  3. Read the yes or no answer, the division test behind it, and every factor of the number.

How to Check If a Number Is Prime

Divide the number by each prime, starting with 2, and only go as far as its square root. If any prime divides it with a remainder of 0, the number is composite. If none does, it is prime. Here is 97:

Handwritten test of whether 97 is prime: square root of 97 is about 9.8 so test 2, 3, 5 and 7, none divide evenly, so 97 is prime
√97 ≈ 9.8, so test 2, 3, 5 and 7. None divides 97 evenly, so 97 is prime.

Why stop at the square root? If a number had a factor bigger than its square root, it would also have a partner factor smaller than it. So if no small prime divides it, no large one will either.

The Trap: Numbers That Look Prime

Some numbers pass the quick checks, because they are odd, do not end in 5 and are not obviously a multiple of 3, but still turn out composite. 91 is the classic one:

Handwritten test of whether 91 is prime: 7 divides 91 with remainder 0, so 91 = 7 × 13 and it is not prime
91 ÷ 7 = 13 with remainder 0, so 91 = 7 × 13 and it is not prime.

Other numbers that fool people: 51 = 3 × 17, 119 = 7 × 17 and 221 = 13 × 17. Always run the full test up to the square root.

Quick Divisibility Rules

Checking 2, 3 and 5 first removes about three quarters of all numbers in a second.

Prime Numbers up 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, 97.

Worked Examples

Common mistakes

Prime Number Checker FAQs

How do you check if a number is prime?

Divide the number by each prime, starting with 2, up to its square root. If any prime divides it with remainder 0, it is composite. If none does, it is prime. For 97 the square root is about 9.8, and 2, 3, 5 and 7 all leave a remainder, so 97 is prime.

Is 1 a prime number?

No. A prime has exactly two factors, 1 and itself, and the number 1 has only one factor. It is also not composite, so 1 is neither prime nor composite.

Is 2 a prime number?

Yes. 2 is prime, and it is the only even prime number. Every other even number is divisible by 2, so it has more than two factors.

Are all odd numbers prime?

No. 9 = 3 × 3, 15 = 3 × 5 and 91 = 7 × 13 are all odd and composite. Being odd only rules out 2 as a factor.

Why do you only test up to the square root?

Factors come in pairs that multiply to the number. One factor in every pair is at or below the square root, so if no prime up to the square root divides the number, no larger factor can exist either.

What is the difference between a prime and a composite number?

A prime number has exactly two factors, 1 and itself. A composite number has more than two factors, such as 12 with factors 1, 2, 3, 4, 6 and 12.

What are the prime numbers up to 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. That is 25 primes.

Is 91 a prime number?

No. 91 = 7 × 13, so it is composite. It looks prime because it is odd and not a multiple of 3 or 5, which is why it is a popular trick question.