The Quick Answer

No. Not all prime numbers are odd. The number 2 is prime and it's even. That's the only exception, but it's enough to make the statement false. Everything else you read will build from there. I see this come up constantly in online forums and sometimes in first-year university office hours. Students memorize the sequence 2, 3, 5, 7, 11 and then generalise from a small sample. It's a natural cognitive error. The definition of a prime number is an integer greater than 1 that has exactly two distinct positive divisors: 1 and itself. Evenness or oddness isn't in the definition. The fact that 2 qualifies is just arithmetic. Here's what actually matters in practice. When you're writing code or doing manual factorisation, treating 2 like every other odd prime will cost you time. I spent about two hours debugging a primality test one afternoon because I had a loop that skipped even numbers entirely. The function returned false for 2 every single time. Once I added an explicit check for 2 before the loop, the bug disappeared. That was 2023, still a fresh memory because the fix was that simple and the consequence was annoying.

The Miller-Rabin primality test is the standard tool people reach for when they need to verify large numbers. It works on 2 without special handling because the algorithm tests bases against the number directly. But if you use an optimised trial division approach, which many beginners do, you typically divide by 2 first, then iterate through odd candidates only. That's correct. The mistake is forgetting the initial 2 check or assuming the odd-only loop covers everything.

Why the Confusion Exists

Most primes above 2 are indeed odd. Roughly 95 percent of primes under one million are odd, and that proportion stays essentially flat as you go higher. The density argument makes the generalisation feel intuitively right. But intuitive right and mathematically correct are different things. A single counterexample disproves a universal claim, and 2 is that counterexample. There's also a subtle linguistic issue. People hear "all primes are odd" and then encounter the twin prime conjecture, which pairs primes like (3, 5) and (11, 13). They think about the pattern and forget the outlier. The twin prime discussion reinforces the oddness pattern without mentioning 2, which sits alone as the only even prime with no twin at distance 2 in the same way the others do.

Get the Full Details

A Complete Timeline of All Might's Life in My Hero Academia
A Complete Timeline of All Might's Life in My Hero Academia

The Technical Details That Matter

If you're implementing anything that depends on prime classification, here is the practical structure I use and recommend. Check for 2 first. If the input is 2, return prime. If the input is even and not 2, return composite. Then test odd divisors from 3 up to the square root of the number. This cuts the iteration count in half compared to testing every integer, and for a number around 10^9 it reduces worst-case operations from roughly 31,623 down to about 15,811. A common pitfall is applying the odd-only loop to numbers below 4 without adjusting the upper bound. If you pass 3 into a function that checks 2, skips evens, and then starts the loop at 3 with a condition using strictly less than the square root, you'll miss 3 because the square root of 3 is approximately 1.73 and the loop condition fails immediately. I encountered this in a coding challenge last year and lost about twenty minutes before I realised the boundary condition was wrong. The fix is to ensure the loop uses less than or equal to the square root, or to handle 3 explicitly. Another detail people overlook is that the distinction between even and odd primes matters for certain cryptographic implementations. RSA key generation relies on selecting large random primes. The generator skips even candidates by construction, but it must still verify that 2 itself isn't somehow selected, which is statistically impossible at the scale involved but the logic should still be sound. More importantly, some implementations of the AKS primality test have edge-case behaviour around small primes that requires explicit handling before the general algorithm runs.

What This Means for Your Work

If you're doing mathematics, the takeaway is straightforward: 2 is prime, 2 is even, therefore not all primes are odd. If you're writing software, add the explicit even-prime check and move on. Don't overcomplicate it. The number theory behind why 2 is the only even prime is simple enough to state in one sentence: any even number greater than 2 is divisible by 2 and at least one other number, so it has more than two divisors. I've seen people try to generalise further and claim that all primes greater than 2 are odd, which is technically true but trivial. The interesting question isn't whether the generalisation holds, it's whether people understand why the exception exists and how to handle it in practice. That's the part that actually affects your work.