A prime number has exactly two positive divisors: 1 and itself. Checking whether a number is prime means checking whether anything else divides into it evenly — if nothing does, it's prime; if even one other divisor exists, it's composite (or, in the special case of 1, neither).
The Prime-Testing Method
Test the number for divisibility by every prime starting from 2, stopping once you reach the square root of the number. If none of those primes divide in evenly, the number is prime. The square-root cutoff works for exactly the reason described in the companion factors guide: if a number had a factor larger than its square root, that factor would need a paired factor smaller than the square root, and you'd have already found it by testing up to that point.
You only need to test *prime* divisors, not every whole number, because any composite divisor is itself built from smaller primes — if a number were divisible by 6, it would necessarily also be divisible by 2 and 3 individually, both of which you've already tested by the time you'd reach 6.
Worked example: is 97 prime? √97 ≈ 9.85, so test primes up to 9: 2, 3, 5, 7. Is 97 even? No (ends in 7), so 2 doesn't divide it. Digit sum of 97 is 9+7=16, not divisible by 3. 97 doesn't end in 0 or 5, so 5 doesn't divide it. 97 ÷ 7 = 13.86, not whole. No prime up to 9 divides 97 evenly, so 97 is prime.
Worked example: is 91 prime? This is the classic trap number. √91 ≈ 9.54, test 2, 3, 5, 7. 91 is odd (not divisible by 2). Digit sum 9+1=10, not divisible by 3. Doesn't end in 0 or 5. But 91 ÷ 7 = 13 exactly — a whole number. 91 = 7 × 13, so 91 is composite, not prime, despite passing every "quick glance" test most people instinctively run (it's odd, doesn't end in 5, isn't an obvious multiple of anything small). This exact number trips up more people than almost any other — see the dedicated blog post on why 91 isn't prime for more on why it's such a persistent trap.
Why 1 isn't prime. By definition, a prime number has exactly two distinct positive divisors. The number 1 has only one divisor — itself — so it fails the definition outright. This isn't an arbitrary exclusion; if 1 counted as prime, the Fundamental Theorem of Arithmetic (which says every integer greater than 1 has one unique prime factorization) would break down, since you could pad any factorization with extra factors of 1 without changing its value. 1 is classified as neither prime nor composite — its own category.
Quick pre-checks before you start trial division. Even numbers greater than 2 are never prime, since they're all divisible by 2 — this immediately rules out half of all whole numbers with zero calculation. Numbers ending in 0 or 5 (other than 5 itself) are never prime, since they're divisible by 5. Beyond those two instant checks, digit-sum divisibility by 3 catches another chunk quickly. Running through these quick checks before committing to full trial division saves significant time on obviously composite numbers.
Numbers That Commonly Fool People
Beyond 91 (=7×13), a short list worth knowing: 51 (=3×17), 119 (=7×17), 133 (=7×19), 161 (=7×23), and 221 (=13×17). Notice a pattern — many of these traps involve 7 as a factor, precisely because 7 is large enough that its multiples don't jump out the way multiples of 2, 3, or 5 do, but still small enough to appear in numbers people commonly need to check.
A note on scale. Trial division up to the square root is completely practical for hand-checking numbers up into the hundreds or low thousands. For very large numbers (hundreds of digits, the kind used in cryptography), trial division becomes computationally infeasible even for computers, which is exactly the asymmetry that makes RSA encryption secure — multiplying two huge primes together is fast, but factoring the product back apart is not, for large enough primes.
Worked example: is 149 prime? √149 ≈ 12.2, so test primes 2, 3, 5, 7, 11. 149 is odd. Digit sum 1+4+9=14, not divisible by 3. Doesn't end in 0 or 5. 149÷7≈21.3, not whole. 149÷11≈13.5, not whole. No prime up to 12 divides evenly, so 149 is prime.
Worked example: is 221 prime? √221 ≈ 14.9, test 2, 3, 5, 7, 11, 13. 221 is odd, digit sum 2+2+1=5 (not divisible by 3), doesn't end in 0/5, 221÷7≈31.6 (not whole), 221÷11≈20.1 (not whole), 221÷13=17 exactly. 221 = 13 × 17, so 221 is composite — another number that passes every quick surface check but fails on a less obvious prime factor.
The Sieve of Eratosthenes
Write out every number from 2 to your limit. Starting from 2, cross out every multiple of 2 (except 2 itself). Move to the next number not yet crossed out (3), and cross out every multiple of 3. Repeat with each next surviving number. Whatever remains uncrossed when you've worked through numbers up to the square root of your limit is the complete list of primes in that range. This is significantly faster than testing each number individually with trial division when you need many primes at once, rather than checking a single specific number.
A mental habit worth building: primes below 50 memorized. 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 — fifteen primes, small enough to memorize completely, which covers every prime you'd ever need to test by hand for numbers up into the low thousands (since √2500=50). Having this list ready removes the need to rediscover which numbers are prime candidates every single time you check a new number.
Once you've confirmed a number isn't prime, the natural next step is finding what it actually breaks down into — its full prime factorization, covered in How to Find the Prime Factorization of a Number.