Overview
A prime number has exactly two divisors: 1 and itself. Primes are the building blocks of all whole numbers and the basis of modern encryption.
Enter a number to check if it is prime, see its prime factors if not, and find the nearest primes on either side.
Worked examples
| Inputs | Result |
|---|---|
| Number97 | 97 is a prime numberPrevious prime: 89Next prime: 101 |
Show 3 more examples
| Number2 | 2 is a prime numberPrevious prime: noneNext prime: 3 |
| Number221 | 221 is compositePrime factors: 13 × 17Previous prime: 211Next prime: 223 |
| Number7,919 | 7,919 is a prime numberPrevious prime: 7907Next prime: 7927 |
Result (is) by number
With the calculator's starting values, the result is 97 is a prime number. The table shows how it changes with the number.
| Number | Result (is) |
|---|---|
| 60 | 60 is composite |
| 80 | 80 is composite |
| 97starting value | 97 is a prime number |
| 100 | 100 is composite |
| 120 | 120 is composite |
| 140 | 140 is composite |
How it works
The check tries every divisor up to the square root of the number; if none divides it evenly, the number is prime. Prime factorization repeatedly divides out the smallest factor.
The formula
| n | The number to test |
Practical tips
- 2 is the only even prime.
- A quick filter: a number ending in 0, 2, 4, 5, 6 or 8 (except 2 and 5) is not prime.
Frequently asked questions
Is 1 a prime number?
No. A prime needs exactly two distinct divisors, and 1 has only one.
How many primes are there below 100?
25.