Enter a whole number to see whether it is prime, its prime factorisation and the nearest primes.
Results are estimates for planning. Check the figures before you make a financial or health decision.
Embed this calculator on your website
Free to use. Copy the code and paste it into your page. Please keep the link under the calculator in place: it is how we keep the tool free.
How the Prime Number Checker works
A prime number has exactly two factors: 1 and itself. The calculator tests divisibility by every number up to the square root.
n is prime if no whole number from 2 up to √n divides it. If it is not prime, the factors are found by repeated division. The next and previous primes are found by testing each neighbouring number.
Worked example
With these inputs: Number: 97.
| Result | Value |
|---|---|
| 97 | Prime |
| Prime factorisation | 97 |
| Next prime | 101 |
| Previous prime | 89 |
Tips and common mistakes
- The number 2 is the only even prime.
- 1 is not prime, because it has only one factor.
- Two primes that differ by 2, such as 41 and 43, are called twin primes.
Frequently asked questions
Is 97 a prime number?
Yes. No whole number from 2 to 9 divides 97, so it is prime.
Is 1 a prime?
No. A prime must have exactly two different factors, and 1 has just one.
What are the first prime numbers?
2, 3, 5, 7, 11, 13, 17, 19, 23, 29.
How large a number can I test?
Up to 1,000,000,000,000 (a trillion).