Skip to main content

How to Tell If a Number Is Prime Quickly by Hand (and When to Stop Guessing)

Chalkboard covered in handwritten arithmetic and number lists
Try the Tool
Scientific Calculator
Trig, algebra, primes, and base conversion in one powerful tool

You see a number on a receipt, a sports jersey, a license plate. Some part of your brain wants to know if it is prime. Most of the time the question feels harder than it actually is, because the way primality usually gets taught is "try every divisor up to the number itself." That is the slow way. There is a faster way that fits on a napkin, works for almost any number you will ever hand-check, and tells you when to stop.

This guide walks through that faster method end to end. Divisibility rules first, then the square-root ceiling that decides when to quit, then a short list of small primes that does almost all the work. At the end there is a section on when to give up and let a calculator finish the job.

pencil and notebook with handwritten arithmetic on a desk Photo by Lum3n on Pexels

What "prime" actually means in one sentence

A prime number is a whole number greater than 1 with exactly two positive divisors, 1 and itself. That is the entire definition. Every other property you might have heard (only odd primes after 2, primes thin out as numbers grow, every integer factors into primes uniquely) is a consequence of that one rule.

Numbers like 7, 11, and 13 are prime. Numbers like 9 (= 3 x 3) and 15 (= 3 x 5) are not. The number 1 is not prime by convention, because including it would break unique factorization.

For a more formal walkthrough with historical context, Wikipedia's article on prime numbers is a solid reference. For the deeper number theory, Wolfram MathWorld has stable, well-curated pages on most of the supporting concepts in this article.

Step 1: rule out 2, 3, and 5 with the rules you already know

About 73% of composite numbers under 1,000 are divisible by 2, 3, or 5. So before you do anything clever, run three checks that take less than a second each.

Divisibility by 2. The last digit is even. So 124, 778, and 2,016 are all even. If the number ends in 0, 2, 4, 6, or 8 and is not 2 itself, you are done. Not prime.

Divisibility by 3. Add the digits. If the sum is a multiple of 3, the number is divisible by 3. Take 471: 4 + 7 + 1 = 12, and 12 is divisible by 3, so 471 = 3 x 157. Done. The reason this works is that 10 leaves a remainder of 1 when divided by 3, so every power of 10 does too, which means a multi-digit number behaves like the sum of its digits modulo 3.

Divisibility by 5. The last digit is 0 or 5. So 235 and 1,000 are both out. The number 5 itself is prime; everything else ending in 5 is not.

If a number survives all three of these checks, it is coprime to 2, 3, and 5, and you have already eliminated most of the work.

Step 2: the square-root ceiling tells you when to stop

Here is the move most hand-check methods leave out, and it is the one that makes the rest of this fast.

You do not need to test every divisor up to the number itself. You only need to test divisors up to the square root of the number. The reason: if N = a x b and both a and b are larger than the square root of N, then a x b would be larger than N, which is a contradiction. So every composite number has at least one factor at or below its square root.

In practice, for a number around 200, you only need to check divisors up to about 14 (since 14^2 = 196). For a number around 1,000, you only need to check up to about 31. For a number around 10,000, you only need to check up to 100.

You can estimate a square root in your head well enough for this. Take 437. The nearest perfect squares are 400 (= 20^2) and 441 (= 21^2), so the square root of 437 is just under 21. So to check whether 437 is prime, you only need to test divisors up to 20.

open math reference book on a wooden table Photo by cottonbro studio on Pexels

Step 3: divide only by the small primes

This is the second time-saver. You do not need to try every integer from 2 up to the square root. You only need to try the primes in that range, because any composite divisor would already have been caught by one of its prime factors.

For numbers up to about 1,000, the primes you ever need to consider are:

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31

That is eleven numbers. Memorizing them once is one of the highest-leverage things you can do for hand arithmetic. With this list and the square-root ceiling, primality checking on any three-digit number takes well under a minute.

Step 4: divisibility tricks for 7, 11, and 13

For 2, 3, and 5 there are one-glance tests. For 7, 11, and 13 there are tricks, but they are slightly less elegant. Use them or just do the division by hand, whichever is faster for you.

Divisibility by 7. Take the last digit, double it, and subtract it from the rest of the number. If the result is divisible by 7, so is the original. Repeat if needed. Example: 161 → 16 - 2 = 14, which is 7 x 2. So 161 = 7 x 23. The trick works because 10 x (rest) + (last digit) and (rest) - 2 x (last digit) differ by a multiple of 21, which is divisible by 7.

Divisibility by 11. Alternate adding and subtracting the digits. If the result is 0 or a multiple of 11, so is the number. Example: 9,317 → 9 - 3 + 1 - 7 = 0, so 9,317 is divisible by 11 (in fact, 9,317 = 11 x 847). The reason: 10 = -1 (mod 11), so each digit contributes with alternating sign.

Divisibility by 13. Take the last digit, multiply it by 4, and add it to the rest. Repeat. Example: 169 → 16 + 9 x 4 = 52, which is 13 x 4. So 169 = 13 x 13. This one is less famous, but it works on the same principle as the rule for 7.

For 17, 19, 23, 29, and 31, the divisibility tricks get fiddly. At that point most people just do the division. It is still fast because the square-root ceiling has already shrunk the list of divisors you have to try.

Worked examples

Let's run two numbers all the way through.

Is 169 prime? Last digit is 9, so not even. Digit sum is 1 + 6 + 9 = 16, not divisible by 3. Last digit is not 0 or 5. Square root of 169 is 13 exactly. So we only need to try 7, 11, and 13. 169 / 7 = 24.14, no. 169 / 11 = 15.36, no. 169 / 13 = 13 exactly. So 169 = 13 x 13. Not prime.

Is 211 prime? Last digit is 1, so not even. Digit sum is 4, not divisible by 3. Last digit is not 0 or 5. Square root of 211 is just under 15 (since 14^2 = 196 and 15^2 = 225). So we need to try 7, 11, and 13. 211 / 7 = 30.14, no. 211 / 11 = 19.18, no. 211 / 13 = 16.23, no. We have exhausted every prime up to the square-root ceiling. 211 is prime.

The whole exercise took about 30 seconds.

hand-drawn numbered grid with circled values on graph paper Photo by Beyzanur K. on Pexels

When to give up and use a calculator

The square-root ceiling is generous, but it has a practical limit. Once the number is big enough that even the trimmed list of small primes is too long to scan by hand, switch tools.

A rough rule: for a four-digit number, hand-checking is still pleasant. The square root is at most 100, the relevant prime list has 25 entries, and a patient person can finish in a few minutes. For a five-digit number, the square root is up to about 316, the prime list has 65 entries, and you are now budgeting for ten or fifteen minutes if you are doing this without help. That is the point where reaching for a Scientific Calculator actually saves time. The same calculator handles base conversion and prime factorization, which is useful when the answer is "not prime" and you want to see all the factors.

There is also a class of numbers where hand-checking is hopeless on principle: very large semiprimes (products of two primes near the square root). Those are the numbers that underpin RSA cryptography, and the difficulty of factoring them is what makes that whole field possible. A modern factoring routine still goes through every small prime, just at a billion checks per second. The method does not change. The volume does.

For a working overview of what those routines actually do, Khan Academy has accessible lessons on number theory, and the OEIS is the canonical reference for any integer sequence you may bump into along the way.

Common mistakes

A few traps that catch people once and then never again.

Forgetting 1 is not prime. This breaks unique factorization. Just remember the definition starts with "greater than 1."

Stopping at half the number instead of the square root. Stopping at N/2 is much slower than stopping at sqrt(N) and gains you nothing. The square-root ceiling is provable in one line; trust it.

Testing composite divisors after the primes. Once you have tried 2, 3, 5, 7, 11, 13, you have already implicitly checked 4, 6, 8, 9, 10, 12, 14, 15. Adding them back in is wasted effort.

Skipping 2 because the number "feels odd." It is worth one second to glance at the last digit and confirm.

A short recap you can write on a card

Here is the entire method in seven lines.

  1. If the last digit is even (and the number is not 2), it is not prime.
  2. If the digits add to a multiple of 3 (and the number is not 3), it is not prime.
  3. If the last digit is 0 or 5 (and the number is not 5), it is not prime.
  4. Estimate the square root. That is your ceiling.
  5. Divide by 7, 11, 13, and the rest of the small primes up to that ceiling.
  6. If nothing divides evenly, the number is prime.
  7. If something divides evenly, you have a factor; the number is not prime.

That is the whole thing. You can practice it on phone numbers, sports scores, and addresses until it becomes background noise. For checks beyond what is comfortable by hand, a Scientific Calculator with built-in prime factorization will finish in one tap.

old wooden abacus close-up with beads in counting position Photo by Tara Winstead on Pexels

Where to go from here

If primality checking lit something up, a few directions are worth exploring next.

For the underlying theory and visual intuition, Numberphile's channel has clear, friendly explanations of the structures that show up around primes (twin primes, Mersenne primes, the prime counting function). For computational work, Project Euler is a long list of problems where the fastest solution usually depends on understanding primes well.

And inside this site, the math and science section of the EvvyTools tools directory has a few related calculators worth a bookmark, including base conversion, GCD/LCM, and the same scientific calculator linked above. The EvvyTools blog has more practical guides in this same shape if mental-math shortcuts are your thing.

You will not need any of those for the next number you eyeball on a license plate. The seven-line card is enough.

137 Foundry — custom app building studio
Share: X Facebook LinkedIn
Honey-Do Tracker — home maintenance for landlords and property managers