Prime Number Checker
Check if a number is prime, find its factors, and discover nearby primes
Check a Number
Find Primes in Range
What is a Prime Number?
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. In other words, a prime number can only be divided evenly by 1 and the number itself.
Prime Numbers
Examples: 2, 3, 5, 7, 11, 13, 17, 19, 23...
- 2 is the only even prime
- Divisible only by 1 and itself
- Building blocks of all numbers
Composite Numbers
Examples: 4, 6, 8, 9, 10, 12, 14, 15...
- Have more than 2 factors
- Can be factored into primes
- 4 = 2 x 2, 12 = 2 x 2 x 3
Special Case: 1 is NOT Prime
By definition, 1 is neither prime nor composite. It's a "unit" - the multiplicative identity.
First 100 Prime Numbers
Interesting Prime Number Facts
Twin Primes
Pairs of primes that differ by 2: (3,5), (5,7), (11,13), (17,19)...
Mersenne Primes
Primes of the form 2^n - 1: 3, 7, 31, 127, 8191...
Prime Gap
Gaps between consecutive primes grow larger, but primes are infinite.
Cryptography
Large primes are crucial for RSA encryption and online security.
How to Check if a Number is Prime
- Is it less than 2? If yes, it's not prime.
- Is it 2? If yes, it's prime (the only even prime).
- Is it even? If yes and greater than 2, it's not prime.
- Check divisibility: Test odd numbers from 3 up to √n. If any divide evenly, it's not prime.
- Passed all tests? The number is prime!
Example: Is 29 prime?
√29 ≈ 5.4, so check: 3, 5
29 ÷ 3 = 9.67 (not even)
29 ÷ 5 = 5.8 (not even)
→ 29 is PRIME