Prime Number Checker
Check whether a whole number is prime or composite and explore its factors.
Check a Number
Enter a whole number to find out whether it is prime, composite or neither.
Result
Factors
How the Number Was Checked
What Is a Prime Number?
A prime number is a whole number greater than 1 that has exactly two positive factors: 1 and itself. This means it can only be divided evenly by 1 and the number itself.
Examples of prime numbers include 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29.
What Is a Composite Number?
A composite number is a whole number greater than 1 that has more than two positive factors. For example, 12 is composite because its factors are 1, 2, 3, 4, 6 and 12.
Prime Number Formula and Checking Method
A number greater than 1 is prime if it has no positive divisor other than 1 and itself.
To check whether a number is prime, it is sufficient to test possible divisors up to the square root of the number. If no divisor is found, the number is prime.
Examples of Prime and Composite Numbers
- 2: Prime — factors are 1 and 2.
- 7: Prime — factors are 1 and 7.
- 12: Composite — factors include 1, 2, 3, 4, 6 and 12.
- 15: Composite — factors are 1, 3, 5 and 15.
- 29: Prime — factors are 1 and 29.
Special Cases: 0 and 1
Zero and one are neither prime nor composite. Zero has infinitely many integer divisors, while one has only one positive factor. A prime number must have exactly two distinct positive factors.
Why Is 2 the Only Even Prime Number?
Every even whole number greater than 2 can be divided evenly by 2. It therefore has at least three positive factors: 1, 2 and itself. The number 2 has exactly two factors, so it is the only even prime number.
Frequently Asked Questions
What is a prime number?
A prime number is a whole number greater than 1 that has exactly two positive factors: 1 and itself.
Is 1 a prime number?
No. The number 1 is neither prime nor composite because it has only one positive factor.
Is 2 a prime number?
Yes. 2 is the smallest prime number and the only even prime number.
Is 0 a prime number?
No. Zero is neither prime nor composite.
How can I check whether a large number is prime?
Enter the number into the calculator above. It uses an efficient modular arithmetic test to check integers up to 64 bits.
Can negative numbers be prime?
In the standard definition used by this calculator, prime numbers are positive whole numbers greater than 1. Negative numbers are not treated as prime.
Related Math Calculators
Explore more free math tools from Easy Online Tool:
Percentage Calculator | Average Calculator | Fraction Calculator | Ratio Calculator | GCD & LCM Calculator | Random Number Generator