Prime Number Calculator: Check If a Number Is Prime
Enter a whole number to find out if it is prime, see its prime factorization, and list every prime up to that number.
Formulas verified against standard references. Calculator logic tested with verified worked examples. Last reviewed: October 2026. Our methodology
How Prime Checking Works
A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. To check a number, try dividing it by every whole number up to its square root. If none divides it evenly, it is prime.
This check pairs well with the LCM and GCD calculator, which uses the same idea of divisors to compare two numbers.
Prime numbers also appear in counting problems, so if you want to count arrangements, try the permutation and combination calculator.

How to Find Prime Factors
To factor a number, divide it by the smallest prime that divides it evenly, then repeat with the quotient until only 1 remains. The divisors you used, with their counts, are the prime factorization.
For example, 60 divided by 2 gives 30, divided by 2 gives 15, divided by 3 gives 5, and divided by 5 gives 1. So 60 = 2^2 x 3 x 5.
Worked Examples
Check 29: its square root is about 5.39, so test the primes 2, 3 and 5. None divides 29 evenly, so 29 is prime, and its only prime factor is 29 itself.
Check 60: it is even, so 2 divides it, and it is not prime. Its factorization is 60 = 2^2 x 3 x 5.
The primes up to 20 are 2, 3, 5, 7, 11, 13, 17 and 19. There are 8 of them.
| Number | Prime? | Prime factorization |
|---|---|---|
| 29 | Yes — prime | 29 |
| 60 | No — not prime | 2^2 x 3 x 5 |
| 12 | No — not prime | 2^2 x 3 |
| 100 | No — not prime | 2^2 x 5^2 |
| 1 | No — neither prime nor composite | None |

Prime Numbers Up to 50
The table below lists every prime up to 50. Use it to check small numbers quickly, or enter a number above to test any whole number and see its factors.
| Primes up to 50 | Count |
|---|---|
| 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 | 15 |
Common Mistakes
1 is not a prime number: it has only one divisor, itself, while a prime needs exactly two. 2 is the only even prime, because every other even number is divisible by 2.
A number with a factor other than 1 and itself is composite, not prime. Checking divisors only up to the square root is enough, because any larger factor pairs with a smaller one you would already have found.

Frequently asked questions
What is a prime number?
A whole number greater than 1 with exactly two divisors: 1 and itself.
Is 29 a prime number?
Yes. No prime up to its square root (2, 3 or 5) divides 29 evenly.
Is 60 a prime number?
No. 60 = 2^2 x 3 x 5, so it has divisors other than 1 and itself.
What are the prime factors of 60?
2, 2, 3 and 5, written as 2^2 x 3 x 5.
What are the primes up to 20?
2, 3, 5, 7, 11, 13, 17 and 19.
Is 1 a prime number?
No. 1 is neither prime nor composite, because it has only one divisor.
Why check divisors only up to the square root?
Any factor larger than the square root pairs with a smaller factor, so if no smaller factor exists, the number is prime.
Related calculators
LCM & GCD Calculator
Find the least common multiple and greatest common divisor of two numbers.
Use calculatorPermutation & Combination Calculator
Count arrangements and selections with permutations and combinations.
Use calculatorQuadratic Equation Solver
Solve quadratic equations step by step and find their roots.
Use calculator