How to use
- Enter a whole number from 0 to 9,007,199,254,740,991.
- See at once whether it is prime, its prime factorization, and the previous and next primes.
- Below the result, the ladder method shows each division.
How the prime check works
A prime is a whole number above 1 whose only divisors are 1 and itself. A composite number has other divisors. 0 and 1 are neither.
The calculator tries divisors in order: 2, 3, then 5, 7, 11, 13 and so on. Above 3, only numbers one away from a multiple of 6 can be prime, so only those are tested.
It stops once the divisor passes √n. If nothing divides evenly by then, n is prime, because any factor pair has one factor no bigger than √n.
The result is exact, not a “probably prime” guess.
Examples
- 91: 91 ÷ 7 = 13, so 91 = 7 × 13. It is odd and not a multiple of 3 or 5, which makes it a common trap.
- 97: no whole number from 2 to 9 divides it, and √97 ≈ 9.85, so 97 is prime.
- 360: divide by 2 three times, then by 3 twice, leaving 5: 360 = 2³ × 3² × 5.
- 1,001: 1,001 = 7 × 11 × 13.
Numbers that look prime but aren’t
| Number | Prime? | Factors |
|---|---|---|
| 51 | No | 3 × 17 |
| 57 | No | 3 × 19 |
| 87 | No | 3 × 29 |
| 91 | No | 7 × 13 |
| 119 | No | 7 × 17 |
| 221 | No | 13 × 17 |
| 97 | Yes | 97 |
The 25 primes below 100 are 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.
Why 1 isn’t prime, and the largest number
Leaving 1 out keeps every prime factorization unique. If 1 were prime, 6 could be written as 2 × 3, 1 × 2 × 3, 1 × 1 × 2 × 3 and so on.
The limit, 9,007,199,254,740,991 (2⁵³ − 1), is the largest whole number a browser stores exactly. The largest prime below it is 9,007,199,254,740,881. On slow devices, very large numbers may stop after a few seconds with a message.
To find the common factors of two or more numbers, use the GCF and LCM calculator.