Prime numbers have exactly two positive factors: 1 and themselves. Composite numbers have more than two. Both definitions apply to integers greater than 1.
Prime or composite?
Enter a positive integer from 1 to 1,000,000,000. See every positive factor, its factor pairs, and its prime factorization.
Positive factors
Prime factorization
Factor pairs
Prime: exactly two positive factors.
Composite: more than two positive factors.
1: neither prime nor composite.
Examples you can check
| Number | Positive factors | Classification |
|---|---|---|
| 1 | 1 | Neither |
| 2 | 1, 2 | Prime |
| 4 | 1, 2, 4 | Composite |
| 7 | 1, 7 | Prime |
| 9 | 1, 3, 9 | Composite |
| 17 | 1, 17 | Prime |
How to test a number
For an integer greater than 1, look for a factor other than 1 and the number itself. You only need to test possible divisors up to its square root: any larger divisor is paired with a smaller one.
Is 29 prime?
\(\sqrt{29}\approx5.39\). Check the primes 2, 3, and 5. None divides 29 exactly, so 29 is prime.
Is 91 prime?
\(91=7\times13\), so 91 is composite. An odd number can still be composite.
2 is the only even prime. Every even integer greater than 2 has 2 as an extra factor. Zero and negative integers are not classified as prime or composite in this elementary definition.
Prime and composite number game
Choose the numbers that match the game's requested category. Remember: 1 belongs to neither category. If the older game stops responding after a round, reload the page to restart it.
Practice
Classify 13, 21, 31, and 49.
Show answers
13 and 31 are prime. 21 is composite because \(21=3\times7\). 49 is composite because \(49=7\times7\).
Learn to break composite numbers into primes in the prime factorization lesson.