Prime Number Checker

Test primality, factor numbers, generate prime lists, and find the Nth prime.

First 50 Prime Numbers

What Is a Prime Number?

A prime number is a natural number greater than 1 that has exactly two distinct positive divisors: 1 and itself. Examples: 2, 3, 5, 7, 11, 13, 17... A number with more than two factors is called composite. The number 1 is neither prime nor composite by definition.

Euclid proved around 300 BCE that there are infinitely many primes — one of the most elegant proofs in mathematics. The Prime Number Theorem tells us approximately how many primes exist up to N: roughly N/ln(N). So near a large number like 10^9, about 1 in 20 numbers is prime.

Primes are the "atoms" of the integers: every natural number >1 factors uniquely into primes (the Fundamental Theorem of Arithmetic). This uniqueness makes primes essential in cryptography — RSA encryption uses the difficulty of factoring large numbers (products of two large primes) as its security basis.

Special Types of Primes

Twin primes: p and p+2 both prime (3,5), (11,13), (17,19)
Mersenne primes: 2ⁿ−1 (3, 7, 31, 127, ...)
Sophie Germain: p prime and 2p+1 also prime
Cousin primes: p and p+4 both prime (3,7), (7,11)
Sexy primes: p and p+6 both prime (5,11), (7,13)
Safe primes: p=(q−1)/2 where q is Sophie Germain prime

Frequently Asked Questions

A prime is a natural number greater than 1 with exactly two divisors: 1 and itself. Examples: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29. Every integer > 1 is either prime or can be factored into primes uniquely.
No. 1 is not prime because it has only one positive divisor (itself). Primes must have exactly two distinct positive divisors. Including 1 as prime would break the uniqueness of prime factorization.
Yes. 2 is the only even prime. All other even numbers are divisible by 2, giving them at least three divisors (1, 2, and themselves), making them composite.
For small numbers, trial division by all integers from 2 to √n suffices. For large numbers, Miller-Rabin is a fast probabilistic test. With the right deterministic witnesses, it is provably correct for all n < 3.2×10^18.
Twin primes are pairs of primes differing by 2: (3,5), (5,7), (11,13), (17,19), (29,31), (41,43)... The twin prime conjecture states infinitely many such pairs exist, but this remains unproven.
RSA encryption chooses two large primes p and q. Their product n=p×q is public; keeping p and q secret provides security because factoring large n is computationally hard. 2048-bit RSA uses primes of about 300 decimal digits.
Yes, proven by Euclid ~300 BCE. Assume a finite list of all primes p₁, p₂,...,pₙ. Form N = p₁×p₂×...×pₙ+1. Either N is prime (not in the list) or has a prime factor not in the list. Contradiction — the list can't be complete.
As of 2024, it is 2^82,589,933 − 1, a Mersenne prime with 24,862,048 digits, discovered by GIMPS in 2018. All record-breaking primes are Mersenne primes because the Lucas-Lehmer test is specially efficient for them.

Related Calculators