Prime Number Checker
Enter any number to check if it is prime. Get the prime factorization, number of divisors, and nearby primes.
What Is a Prime Number?
A prime number is a whole number greater than 1 that can only be divided evenly by 1 and itself. The first few primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. The number 2 is the only even prime number, since every other even number is divisible by 2.
Prime Factorization
Every whole number greater than 1 can be written as a product of prime numbers in exactly one way (ignoring order). This is called the Fundamental Theorem of Arithmetic. For example, 360 = 2³ x 3² x 5. Prime factorization is used in simplifying fractions, finding the greatest common divisor (GCD), and calculating the least common multiple (LCM).
To test if N is prime: check divisibility by
every prime up to √N
Why Primes Matter
Primes are the building blocks of all whole numbers, but they also have major practical uses. Modern internet encryption (RSA) relies on the fact that multiplying two large primes is easy but factoring the result back into those primes is extremely hard. Your online banking, shopping, and messaging all depend on prime numbers.
Is 1 a prime number?
No. By definition, a prime number must be greater than 1. Including 1 as prime would break the Fundamental Theorem of Arithmetic, which guarantees a unique prime factorization for every number. For example, 12 could be written as 2 x 2 x 3 or 1 x 2 x 2 x 3 or 1 x 1 x 2 x 2 x 3, making factorizations non-unique.
Is 0 a prime number?
No. Zero is not prime because it is divisible by every number (0 divided by any non-zero number equals 0). Prime numbers must be greater than 1 and have exactly two divisors.
Are there infinitely many primes?
Yes. Euclid proved this around 300 BCE with a famous proof by contradiction. Assume there are finitely many primes. Multiply them all together and add 1. The result is not divisible by any prime on the list, which is a contradiction. So there must be infinitely many primes.
What are twin primes?
Twin primes are pairs of primes that differ by exactly 2, like (11, 13) and (17, 19). It is widely believed that there are infinitely many twin prime pairs, but this has not been proven. It remains one of the oldest open questions in mathematics.