A number is prime if it has no divisors other than 1 and itself — this checks any whole number directly.
How it works
Testing divisibility by every whole number from 2 up to the square root of the number being checked; if none divide evenly, the number is prime.
What this does not include
This does not include full prime factorization for composite numbers — it reports only the smallest factor found, not every factor.
How to use this calculator
- Enter a whole number.
A worked example
17 has no divisors other than 1 and itself → 17 is prime.
18 divides evenly by 2 → 18 is not prime, with 2 as its smallest factor.
1 is a special case: 1 is not prime — by definition, a prime number must have exactly two distinct divisors, and 1 only has one.
What the terms mean
| Term | Meaning |
|---|---|
| Prime number | A number greater than 1 divisible only by 1 and itself |
| Smallest factor | The lowest number (other than 1) that divides evenly into a composite number |
Edge cases worth knowing
1 is neither prime nor composite — a rule that trips up a lot of people, since 1 technically has no factor besides itself.
2 is the only even prime number — every other even number is divisible by 2, which immediately disqualifies it from being prime.
Frequently asked questions
Why check only up to the square root?
If a number has a factor larger than its square root, it must also have a matching factor smaller than the square root — so checking beyond that point can never find a new factor.
Is 1 a prime number?
No — by definition, a prime number must have exactly two distinct divisors (1 and itself); 1 has only one divisor, so it’s excluded.
Is 2 the only even prime number?
Yes — every other even number is divisible by 2, which disqualifies it from being prime.