← All tools/Calculators/Math/Prime Number Checker

Prime Number Checker

Is your number prime? Check it, find its smallest factor if it is not, and see the primes on either side.

Enter a whole number from 1 to 1,000,000. The tool tests divisibility up to the square root of your number.

97 is

—

Previous primeNext prime

How it works

A prime has exactly two factors: 1 and itself.
To test n, try every divisor from 2 up to √n.
If none divides n evenly, n is prime.
1 is neither prime nor composite. 2 is the only even prime.

Worked example: is 97 prime? √97 is about 9.85, so only the divisors 2, 3, 5 and 7 need testing. 97 is odd, 9 + 7 = 16 is not divisible by 3, it does not end in 0 or 5, and 97 ÷ 7 = 13.86 — none divide evenly, so 97 is prime. Is 91 prime? 91 ÷ 7 = 13 exactly, so 91 = 7 × 13 and is composite. Its smallest factor is 7.

Frequently asked questions

What is a prime number?

A whole number greater than 1 with exactly two factors: 1 and itself. 2, 3, 5, 7, 11 and 13 are prime; 4, 6, 8, 9 and 10 are not.

Is 1 a prime number?

No. 1 has only one factor — itself — so it is neither prime nor composite. Primes start at 2.

Is 2 a prime number?

Yes, and it is the only even prime. Every other even number is divisible by 2, so it has at least three factors.

How do you test a large number?

Try divisors up to the square root of the number. If a number has a factor larger than its square root, the matching smaller factor would already have been found. For 97, √97 ≈ 9.85, so only 2, 3, 5 and 7 need testing.

What are prime numbers used for?

They are the building blocks of whole numbers — every whole number above 1 is either prime or a product of primes. They also secure the internet: RSA encryption relies on multiplying two large primes being easy and factoring the result being hard.

More tools

Tell us what you think

Loving this tool, or stuck on something? Tell us — it takes a minute.

We’ll only use your name and email to reply if needed. The tool and page are filled in for you.