KitQuarter

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.

KQ
Reviewed by the KitQuarter Editorial Team
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.

Prime number calculator hero: glossy 3D numbers 2, 3, 5, 7, 11 and 29 with labels Prime and Not Prime
Is it prime? 29 is prime; 60 is not — it breaks into 2, 3 and 5.

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.

NumberPrime?Prime factorization
29Yes — prime29
60No — not prime2^2 x 3 x 5
12No — not prime2^2 x 3
100No — not prime2^2 x 5^2
1No — neither prime nor compositeNone
Prime factorization chart: factor tree for 60 equals 2 times 2 times 3 times 5, and primes up to 20 listed
Factor tree for 60: 60 breaks into 2, 2, 3 and 5, and the primes up to 20 are 2, 3, 5, 7, 11, 13, 17 and 19.

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 50Count
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 4715

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.

Prime number calculator second hero: a student checking 29 is prime on a large screen with a green check mark
Check any number: enter it, and the calculator tells you if it is prime and shows its factors.

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.