Prime Number Checker
Check if a number is prime.
Input
Result
What is a Prime Number Checker?
A Prime Number Checker determines whether a given number is prime or composite. It tests divisibility by all integers up to the square root of the number and instantly reports the result.
How to check for prime numbers manually (the formula)
For a number n, test whether it is divisible by any integer from 2 up to √n. If none divide evenly, the number is prime. If you find any divisor, the number is composite.
Example calculation
Check if 29 is prime. The square root of 29 is about 5.4. Test division by 2, 3, and 5. 29 ÷ 2 = 14.5, 29 ÷ 3 ≈ 9.67, 29 ÷ 5 = 5.8. No integer divides 29 evenly, so 29 is prime.
Common mistakes
- Thinking 1 is prime — 1 has only one factor, so it is neither prime nor composite.
- Thinking all odd numbers are prime — 9, 15, 21, 25, and many other odd numbers are composite.
- Testing beyond the square root — You only need to test divisors up to √n. Beyond that, divisors repeat in reverse order.
Frequently asked questions
What is a prime number?
A prime number has exactly two factors: 1 and itself.
Is 1 a prime number?
No, 1 is not a prime number because it has only one factor.
Is 2 a prime number?
Yes, 2 is the smallest and only even prime number.
How do I check if a number is prime?
Test whether it has any factors other than 1 and itself.
What are the first few prime numbers?
2, 3, 5, 7, 11, 13, 17, 19, 23, 29.