Prime Number Calculator
Test whether any number is prime, find its nearest primes, and list all primes up to a given target.
What is a Prime Number?
A prime number is a natural number greater than 1 that has exactly 2 distinct positive factors: 1 and itself. The first 10 prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. The number 2 is the only even prime number — every other even number is divisible by 2 and therefore composite.
There are 25 prime numbers below 100, 168 primes below 1,000, and 78,498 primes below 1,000,000. The Prime Number Theorem states the number of primes below n approximates n / ln(n). Prime numbers are the atoms of arithmetic — the Fundamental Theorem of Arithmetic guarantees every integer greater than 1 factors uniquely into primes.
How to Test if a Number is Prime
The Sieve of Eratosthenes eliminates composite numbers step by step. Watch it identify all 25 primes below 100.
Sieve of Eratosthenes
Click Run to start the sieve.