Prime Number Checker
Type any whole number up to 1 trillion and find out instantly if it is prime. You also get every factor, the prime factorization and the exact steps used. Free, no sign-up, and it runs right in your browser.
Prime list generator
How to use the Prime Number Checker
- Type a whole number in the box, or tap one of the examples.
- Press Check or the Enter key to see the verdict, all factors and the prime factorization.
- Open the step-by-step table to see every trial division that was performed.
- Use the previous and next prime buttons to jump to the nearest primes, or use the generator to list primes in a range.
What is a prime number?
A prime number is a whole number greater than 1 that has exactly two positive divisors: 1 and itself. The numbers 2, 3, 5, 7 and 11 are prime. A whole number greater than 1 with more than two divisors, such as 12 (1, 2, 3, 4, 6, 12), is called composite. The number 1 is neither prime nor composite, and neither is 0.
How to check if a number is prime
You never need to test every smaller number. If n = a × b, then at least one of a and b is at most √n. So if nothing up to √n divides n, nothing larger will either. This tool follows these steps:
- If n is less than 2, it is not prime.
- Test 2 and 3. If either divides n (and n is not 2 or 3 itself), n is composite.
- Test numbers of the form 6k − 1 and 6k + 1 (5, 7, 11, 13, 17, 19 and so on), because every prime above 3 has this form.
- Stop when the divisor squared is larger than n. If nothing divided evenly, n is prime.
Worked example: is 37 prime?
The square root of 37 is about 6.08, so only 2, 3 and 5 need testing. 37 ÷ 2 leaves remainder 1, 37 ÷ 3 leaves remainder 1, and 37 ÷ 5 leaves remainder 2. No remainder is zero, so 37 is prime.
Prime numbers up to 100
There are 25 primes below 100. Memorising this short list helps with fractions, factoring and mental maths.
| Range | Prime numbers | Count |
|---|---|---|
| 1 to 20 | 2, 3, 5, 7, 11, 13, 17, 19 | 8 |
| 21 to 50 | 23, 29, 31, 37, 41, 43, 47 | 7 |
| 51 to 100 | 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 | 10 |
Prime factorization explained
Every whole number greater than 1 can be written as a product of primes in exactly one way (apart from the order). To factor 60, divide by the smallest prime that fits, then repeat with the result: 60 ÷ 2 = 30, 30 ÷ 2 = 15, 15 ÷ 3 = 5, and 5 is prime. So 60 = 2² × 3 × 5.
The exponents also tell you how many factors a number has. Add 1 to each exponent and multiply: for 60 that is (2 + 1) × (1 + 1) × (1 + 1) = 12 factors. They are 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 and 60. Prime factorization is the quickest way to find a greatest common divisor, a least common multiple, or to simplify a fraction.
Common mistakes
- Calling 1 prime. A prime needs exactly two divisors. 1 has only one.
- Thinking all primes are odd. 2 is the only even prime.
- Stopping the √n test too early. For 49 you must test 7, because 7 × 7 = 49. Stopping at 6 would wrongly call it prime.
- Only testing 2, 3 and 5. 91 passes those tests but equals 7 × 13.
- Mixing up factors and multiples. Factors of 12 divide into it (1, 2, 3, 4, 6, 12). Multiples of 12 are 12, 24, 36 and so on.
Frequently asked questions
Is 1 a prime number?
No. A prime number must have exactly two different positive divisors, but 1 has only one divisor, itself. So 1 is neither prime nor composite.
Is 2 a prime number?
Yes. 2 is prime because its only divisors are 1 and 2. It is also the only even prime number, since every other even number is divisible by 2.
Is 91 prime?
No. 91 = 7 × 13, so it is composite. It looks prime because it is not divisible by 2, 3 or 5, but 7 divides it exactly.
What is the largest prime number?
There is no largest prime number, because the list of primes never ends. The largest prime found so far changes over time; as of late 2024 it was 2^136,279,841 − 1, a number with over 41 million digits.
How many prime numbers are there?
There are infinitely many prime numbers. Euclid proved this more than 2,000 years ago. There are 25 primes below 100 and 168 primes below 1,000.
What is the difference between prime and composite?
A prime number has exactly two positive divisors: 1 and itself. A composite number has more than two divisors, such as 12 (1, 2, 3, 4, 6, 12). The numbers 0 and 1 are neither prime nor composite.
How do I find the prime factorization of a number?
Divide the number by the smallest prime that goes into it, then repeat with the result until you reach 1. For example, 60 ÷ 2 = 30, 30 ÷ 2 = 15, 15 ÷ 3 = 5, so 60 = 2² × 3 × 5. The checker above does this automatically and shows a division ladder.
