Prime Number Checker
Check whether a number is prime, see its prime factorization and find the next prime number.
What is a prime number?
A prime number is a whole number greater than 1 whose only divisors are 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. A number greater than 1 that is not prime is called composite. The number 1 is neither prime nor composite.
How the checker works
To test a number n, it is enough to try dividing by primes up to √n: if n had a factor larger than √n, it would also need a matching factor smaller than √n. The calculator divides by 2 and then by every odd number up to the square root, recording each factor it finds.
Is 391 prime? √391 ≈ 19.8, so test divisors up to 19. 391 ÷ 17 = 23 exactly, so 391 = 17 × 23 and is not prime. The next prime after 391 is 397.
The fundamental theorem of arithmetic
Every whole number above 1 can be written as a product of primes in exactly one way, ignoring order. For example 360 = 2³ × 3² × 5. This prime factorization is the basis for finding GCF and LCM and for simplifying fractions.
Why primes matter
Large primes underpin modern encryption. RSA keys use the product of two primes hundreds of digits long; multiplying them is easy, but factoring the product back into its primes would take ordinary computers far longer than the age of the universe.
Quick divisibility rules
- Divisible by 2 if the last digit is even; by 5 if it ends in 0 or 5.
- Divisible by 3 if the sum of digits is divisible by 3; by 9 if the sum is divisible by 9.
- Divisible by 11 if the alternating sum of digits is divisible by 11.
Frequently asked questions
Is 1 a prime number?
No. A prime must have exactly two distinct divisors, and 1 has only one. Excluding 1 keeps prime factorizations unique.
Is 2 the only even prime?
Yes. Every other even number is divisible by 2, so it has at least three divisors.
How many prime numbers are there?
Infinitely many, as Euclid proved around 300 BC. There are 25 primes below 100 and 168 below 1,000.
Last reviewed Oct 20, 2026. Results are estimates; check important decisions with a qualified professional.