Prime Number Checker

Type any whole number to find out if it is prime. Composite numbers show their prime factors.

Your number

97

Prime
Factors
1, 97
Previous prime
89
Next prime
101
Show working
  1. √97 ≈ 9
  2. 97 ÷ 2, 3, 5, 7 → ✗
  3. 97 = 1 × 97

How to use

  1. Type a whole number (up to 18 digits).
  2. See Prime or Not prime at the top.
  3. Read the factors and the previous and next primes.

Good to know

A prime number has exactly two factors, 1 and itself: 2, 3, 5, 7, 11, 13… 1 is neither prime nor composite, and 2 is the only even prime. To check by hand, divide by primes up to the square root of the number: for 97, √97 ≈ 9.8, and 97 is not divisible by 2, 3, 5 or 7, so it is prime.

For large numbers the calculator uses the Miller–Rabin test with fixed bases, which is proven to give the correct answer for every number below 3.3 × 10²⁴, far beyond the 10¹⁸ limit here. Composite numbers are factorised with Pollard's rho method, so even an 18-digit number takes a moment.

Primes up to 100 (there are 25 of them) are worth remembering for exams. Large primes such as 1,000,000,007 are used in programming contests and in cryptography, where the security of many systems depends on how hard it is to factorise products of big primes.

Questions

Is 1 a prime number?

No. A prime needs exactly two different factors; 1 has only one.

Is 91 prime?

No. 91 = 7 × 13. It is a common trick question because it looks prime.

How many prime numbers are there between 1 and 100?

25: 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.

How do I check if a big number is prime by hand?

Divide by each prime up to its square root. If none divides it, it is prime. Divisibility rules for 2, 3, 5 and 11 speed this up.

What are twin primes?

Primes that differ by 2, such as 11 and 13 or 41 and 43.

Last updated: