Prime Number Checker

Check if any number is prime, find prime factors, and list all primes up to N.

Choose a mode above and enter a number to begin.

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. The first few primes are 2, 3, 5, 7, 11, 13, 17, 19, 23…

Primality Test
Check divisors up to √n
If no integer from 2 to √n divides n, then n is prime. This is O(√n) efficient.
Sieve of Eratosthenes
Cross out multiples of each prime
Start with 2, mark all multiples as composite. Move to the next unmarked number — it must be prime. Repeat up to √N.

Frequently asked questions

Is 1 a prime number?

No. By definition, prime numbers must be greater than 1 and have exactly two positive divisors (1 and itself). The number 1 has only one divisor, so it is neither prime nor composite.

Is 2 the only even prime?

Yes. 2 is the only even prime because all other even numbers are divisible by 2, giving them a divisor other than 1 and themselves.

What is prime factorization?

Prime factorization expresses a number as a product of its prime factors. For example, 360 = 2³ × 3² × 5. This is unique for every number — a result called the Fundamental Theorem of Arithmetic.

How many primes are there?

Infinitely many. Euclid proved this around 300 BCE: assume there are finitely many primes, multiply them all and add 1 — the result is divisible by none of them, so a new prime must exist.

What are twin primes?

Twin primes are pairs of primes that differ by 2, such as (3,5), (11,13), (17,19), (41,43). Whether infinitely many twin primes exist is an unsolved problem (Twin Prime Conjecture).