Prime Checker
Is a number prime?
About This Calculator
A prime number is divisible only by 1 and itself. Primes are the building blocks of all integers and fundamental to cryptography, hash functions, and number theory.
Formula
Trial division: test all integers 2 to sqrt(n)
If none divide evenly, n is prime
1 is not prime; 2 is the only even prime
Example Calculation
Is 97 prime?
- sqrt(97) ≈ 9.85 — test divisors 2, 3, 5, 7
- 97 / 2 = 48.5, 97 / 3 = 32.3, 97 / 5 = 19.4, 97 / 7 = 13.9
- None divide evenly
97 is prime
First 20 Prime Numbers
| Position | Prime | Position | Prime |
|---|---|---|---|
| 1st | 2 | 11th | 31 |
| 2nd | 3 | 12th | 37 |
| 3rd | 5 | 13th | 41 |
| 4th | 7 | 14th | 43 |
| 5th | 11 | 15th | 47 |
| 6th | 13 | 16th | 53 |
| 7th | 17 | 17th | 59 |
| 8th | 19 | 18th | 61 |
| 9th | 23 | 19th | 67 |
| 10th | 29 | 20th | 71 |
Frequently Asked Questions
Why is 1 not a prime number?
By convention, 1 is excluded from the primes because including it would break the Fundamental Theorem of Arithmetic, which states every integer has a unique prime factorization.
How do I quickly test if a large number is prime?
Only test divisibility by primes up to the square root of n. If no prime up to sqrt(n) divides n evenly, it is prime.
Are there infinitely many prime numbers?
Yes. Euclid proved this around 300 BC: assume a finite list of primes, multiply them all and add 1 — the result is either prime itself or divisible by a prime not in the list.