What makes a number prime
A prime number is a whole number greater than 1 whose only divisors are 1 and itself — exactly two divisors. Any number with more divisors is composite. This tool trial-divides up to √n, which is enough to find every factor.
- n — the number being checked
- i — trial divisor, tested up to √n
More detail
Why only test up to √n
Divisors come in pairs that multiply to n — for 36, 2 pairs with 18, 3 with 12, 4 with 9, 6 with 6. One member of every pair is always ≤ √n, so once you've tested every candidate up to the square root you've found them all. That's why checking 17 only needs trial divisors 2, 3, and 4 (since 4² = 16 < 17 < 25 = 5²).
Quick screen. Every prime above 3 is of the form 6k ± 1. If a number isn't 2 or 3 and isn't next to a multiple of 6, it can't be prime — a fast mental filter before you divide.
Frequently asked questions
Is 17 a prime number?
Yes. 17's only divisors are 1 and 17 (two divisors), so it's prime. Enter 17 above to see the divisor list and count.
Is 1 a prime number?
No. A prime must have exactly two distinct divisors, but 1 has only one (itself). By convention 1 is neither prime nor composite — this tool reports it as 'not prime'.
Why is 12 composite?
12 has six divisors — 1, 2, 3, 4, 6, and 12 — which is more than two, so it's composite (not prime). Enter 12 above to see all of them listed.
What is the smallest prime number?
2 — it's the only even prime, since every other even number is divisible by 2. The next primes are 3, 5, 7, 11, and 13.