Divisibility Test: Is a Number Divisible by 2-12?
Enter a whole number to find out instantly whether it's divisible by 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 or 12 — with the exact quotient shown every time the division comes out even.
Calculator
Results
| Divisible by 2 | — |
| Divisible by 3 | — |
| Divisible by 4 | — |
| Divisible by 5 | — |
| Divisible by 6 | — |
| Divisible by 7 | — |
| Divisible by 8 | — |
| Divisible by 9 | — |
| Divisible by 10 | — |
| Divisible by 11 | — |
| Divisible by 12 | — |
How divisibility is tested
n is divisible by d if the remainder of n ÷ d is zero
The calculator tests the remainder of the division directly. There are also quick rules, handy for mental math: last digit even for 2, last digit 0 or 5 for 5, digit sum divisible by 3 (or by 9) for divisibility by 3 (or by 9), and alternating digit sum divisible by 11 for divisibility by 11.
Technical names marked with a star are defined in the glossary at the foot of the article.
What “divisible” means: remainder zero
A whole number n is divisible by d when n ÷ d leaves remainder* zero. The quotient is then a whole number. 840 ÷ 7 = 120 remainder 0, so 840 is divisible by 7. 841 ÷ 7 = 120 remainder 1, so 841 is not.
n is divisible by d if the remainder of n ÷ d is zero
That is the definition. Everything else on this page — last digits, digit sums, alternating signs — is a shortcut for spotting a zero remainder without writing the division. The table above does not use those shortcuts. It computes n mod d for each d from 2 to 12, and prints the quotient when the remainder is 0.
GCSE papers call these “divisibility rules”. An SAT item is more likely to say “which of the following is a factor of n”. Same test. The arithmetic is older than the exam board.
Last-digit tests for 2, 5 and 10
Base ten is kind to 2, 5 and 10. Only the units digit matters.
Last digit even — divisible by 2. 3,814 ends in 4, so 3,814 ÷ 2 = 1,907. Odd last digit: not even, not divisible by 2. That is all “even” means.
Last digit 0 or 5 — divisible by 5. 9,065 ends in 5, so 9,065 ÷ 5 = 1,813. End in 0 and 10 comes for free: 12,080 ÷ 10 = 1,208. Cheapest test of the lot. Nothing to add up. A number ending in 0 is divisible by 2 and by 5, hence by 10, which is just the combined-test idea in miniature.
Last two (or three) digits for 4 and 8
100 is itself a multiple of 4, so everything to the left of the last two digits is already taken care of. Last two digits form a multiple of 4 — that is the whole rule. 7,532 ends in 32, and 32 ÷ 4 = 8, so 7,532 ÷ 4 = 1,883. Ends in 18? 18 is not a multiple of 4; neither is the original number.
Last three digits for 8, same idea one step further: 1,000 = 8 × 125. 9,016 ends in 016, which is 16, and 16 ÷ 8 = 2, so 9,016 ÷ 8 = 1,127. Powers of two keep eating more digits from the right because 10k = 2k × 5k, and once k is large enough the twos in the power of ten already cover the divisor.
Digit sums for 3 and 9, and why they work
Write 10 as 9 + 1, 100 as 99 + 1, 1,000 as 999 + 1. Every power of ten is one more than a multiple of 9. Swap each 10k for 1 and the remainder modulo 9 does not move.
10 ≡ 1 (mod 9), so 10k ≡ 1 (mod 9)
Take 2,745. Split it: 2 × 1,000 + 7 × 100 + 4 × 10 + 5. Replace each power: 2 × (999 + 1) + 7 × (99 + 1) + 4 × (9 + 1) + 5. The 999, 99 and 9 pieces are multiples of 9. What is left is the digit sum* 2 + 7 + 4 + 5 = 18, itself a multiple of 9. So 2,745 is as well (2,745 ÷ 9 = 305). If the digit sum is not a multiple of 9, the original number is not either.
The same splitting works modulo 3, because 9, 99 and 999 are multiples of 3 too. That is why one sum polices both rules. A multiple of 9 is always a multiple of 3; 15 is a multiple of 3 and not of 9. 5,217 → 5 + 2 + 1 + 7 = 15, which passes 3 (5,217 ÷ 3 = 1,739) and fails 9. If the sum remains bulky, add the digits of the sum (15 → 1 + 5 = 6) and test that instead.
The digit sum does not give the quotient. It only answers yes or no. 2,745 ÷ 9 has yet to be divided.
The alternating sum for 11
10 is 11 − 1, so 10 ≡ −1 (mod 11). Square it: 100 ≡ (+1). Cube it: 1,000 ≡ −1. The powers of ten flip sign as the digits move left. Adding the digits with alternating signs is just evaluating the number modulo 11.
10 ≡ −1 (mod 11), so n ≡ d0 − d1 + d2 − d3 + ⋯ (mod 11)
On 3,146, from the units end: 6 − 4 + 1 − 3 = 0. From the left: 3 − 1 + 4 − 6 = 0. Same answer this time, because the number has four digits and the overall sign does not flip. Zero is a multiple of 11, and 3,146 ÷ 11 = 286. 1,331 (which is 11³) gives 1 − 3 + 3 − 1 = 0 as well. So does 2,728 if the walk starts from the left: 2 − 7 + 2 − 8 = −11, and −11 counts.
If the alternating sum* is bulky, feed it through the same rule. 74,613 → 3 − 1 + 6 − 4 + 7 = 11, and the test stops. 840 gives 0 − 4 + 8 = 4, which is not a multiple of 11 — and 840 is not divisible by 11, as the table reports.
Combined tests: 6 and 12
6 = 2 × 3, and those two share no prime factor: they are coprime*. A number divisible by both 2 and 3 is divisible by 6. Even, and the digit sum is a multiple of 3. 4,326 is even; 4 + 3 + 2 + 6 = 15; 4,326 ÷ 6 = 721.
12 = 3 × 4, again coprime ingredients. The tests for 3 and 4 together. 2,244 ends in 44, 44 ÷ 4 = 11; 2 + 2 + 4 + 4 = 12; 2,244 ÷ 12 = 187.
Combined tests want coprime ingredients. Testing 2 and 4 does not give 8 — 4 already includes 2. 12 is even and divisible by 4, and 12 ÷ 8 is not an integer. The right combination of several divisors is not their product; it is their LCM, which has its own section below.
The awkward rule for 7
The usual version: peel off the last digit, double it, subtract that from the rest, and keep going. Land on 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70 (or the negative of one of those) and the original number is divisible by 7.
- 1,001 → 100 − 2×1 = 98, and 98 = 14 × 7. So 1,001 ÷ 7 = 143.
- 861 → 86 − 2 = 84 = 12 × 7. So 861 ÷ 7 = 123.
- 1,365 → 136 − 10 = 126, then 12 − 12 = 0. So 1,365 ÷ 7 = 195.
Other versions float around — multiply the last digit by 5 and add it, or work in three-digit blocks, because 1,000 ≡ −1 (mod 7). They are all correct. On a three- or four-digit number, none of them beats writing the division out. That is the gap with 2, 5 or 10, where one glance is enough.
This page does not rebuild the rule. It computes n mod 7 and, when the remainder is zero, prints the quotient (1,001 ÷ 7 = 143). The last-digit trick is for mental arithmetic, not for the machine.
So if paper is to hand, divide. The rule for 7 is a fallback when the work must stay among the digits, not a shortcut.
Shared factors and cancelling a fraction by hand
Cancelling 36/60 by hand is a hunt for shared factors. The rules tell where to start.
- 36 and 60 both even → divide by 2 → 18/30.
- Both even again → 2 again → 9/15.
- 9 → 9, 15 → 1 + 5 = 6, both multiples of 3 → 3/5.
3 and 5 share no factor other than 1. The fraction is in lowest terms. A formal HCF algorithm was never run; the small primes were visible. On 154/231 the rule for 11 jumps out (1 − 5 + 4 = 0 and 2 − 3 + 1 = 0), so 11 cancels and 14/21 remains, then 2/3.
When the numbers are larger, or there are several of them, the HCF / LCM calculator and the fraction calculator do the cancelling in one go and always return a reduced result. The prime-factor page answers the same question from the exponents.
Several tests at once: the LCM of the divisors
If a number is divisible by 4 and by 6, it need not be divisible by 24. 12 is divisible by both, and 12 ÷ 24 is not a whole number. The right combination is not the product; it is the least common multiple*.
if d1 and d2 both divide n, then lcm(d1, d2) divides n
lcm(4, 6) = 12, and 12 does divide 12. lcm(8, 9) = 72, because 8 and 9 share no prime: the LCM is then the product. 5,040 is divisible by 8 and by 9, hence by 72 (5,040 ÷ 72 = 70). The combined classroom tests work the same way: 6 = lcm(2, 3), 12 = lcm(3, 4).
5,040 is a common multiple of 2 through 10 and of 12; the LCM of that whole list is 2,520, and 5,040 = 2 × 2,520. Not a coincidence: 5,040's prime factors are exactly what that LCM needs, with one spare 2. 5,040 is also 7!, which is why it passes so many of the rows on this page.
Why this page tests the remainder
The code asks n % d === 0 for each d from 2 to 12, then prints the integer quotient. That is the definition of divisibility. A remainder on a 15-digit integer is one operation for a computer.
Replaying the classroom rules — peel a last digit, sum, alternate — would be more code, the same yes/no, and no quotient. Those rules are for a head, or a scrap of paper. The table never “adds the digits modulo 3”: it takes 5,040 modulo 3, finds remainder 0, and reports 5,040 ÷ 3 = 1,680. The two routes always agree. Only the path changes.
Keeping the rules in the write-up is so a result can be checked by hand, or a number on a bus ticket sized up, without coming back here.
Trailing zeros and powers of ten
10, 100, 1,000, 10,000… This is the one rule already used without naming it. As many trailing zeros are needed as the exponent. 4,700 is divisible by 100, not by 1,000 (one zero short). 8,000, with its three zeros, is divisible by 1,000.
n is divisible by 10k if it has at least k trailing zeros
It is just 2 and 5 in disguise. 10k = 2k × 5k, so at least k twos and k fives are required. In base ten each trailing zero is exactly one extra (2, 5) pair. No zero at the end, not a multiple of 10. A single zero, not a multiple of 100.
Two and five are the primes of the decimal system. In another base the trailing-zero test would pick out different primes. Counting is in tens, so powers of ten sit on the page.
Zero is never a divisor
Division by zero is undefined. There is no remainder of n ÷ 0, and no quotient. That is why 0 is missing from the 2–12 list, and why the form rejects anything that is not a strictly positive integer.
People say “zero is divisible by every non-zero integer”: 0 = 0 × d, remainder 0. The converse is false. Nothing is divisible by 0. The two sentences look alike; they put zero in opposite places.
1, at the other extreme, divides everything (quotient = the number itself). It is not tested either: the answer is always yes, so the row would be noise. Useful tests start at 2.
Rules past 12: 13, 16, 25
A divisibility test can be written for any whole number. Past 12 they get as heavy as dividing, except where base ten continues to help.
For 25, look at the last two digits: 00, 25, 50 or 75. 1,575 ends in 75, so 1,575 ÷ 25 = 63. 1,600 ends in 00, 1,600 ÷ 25 = 64. 50 and 100 are the same glance: last two digits 00 or 50 for 50; 00 for 100. For 13, a 7-style recipe: last digit times 4, added to the rest. 104 → 10 + 4×4 = 26 = 2 × 13, so 104 ÷ 13 = 8. 143 → 14 + 12 = 26 again, and 143 ÷ 13 = 11. It works. On three digits, writing 13 as the divisor is quicker.
15 is 3 and 5 together (coprime): last digit 0 or 5, and digit sum a multiple of 3. 75 passes, 45 passes, 35 fails the 3. 16 looks at the last four digits, because 10,000 is a multiple of 16 — base ten again, another power of two. Beyond that, the remainder this page already computes is the honest tool: one remainder, one quotient, no extra rhyme to memorise.
Glossary
- Remainder
- What is left after a whole-number division. n is divisible by d exactly when that leftover is 0. The table on this page reports the quotient only in that case.
- Digit sum
- The sum of the decimal digits of a number. Because 10 ≡ 1 (mod 9) and (mod 3), the digit sum has the same remainder as the original number modulo 9 (and modulo 3). A yes/no test, not a quotient.
- Alternating sum
- Digits added with signs + − + − …, usually from either end. Because 10 ≡ −1 (mod 11), this sum has the same remainder as the number modulo 11. Zero, 11, −11, 22… all count as multiples of 11.
- Coprime
- Two integers whose greatest common divisor is 1. Combined divisibility tests (6 = 2×3, 12 = 3×4, 15 = 3×5) work because the pieces share no prime factor; the product is then the LCM.
- LCM
- Least common multiple: the smallest positive integer that is a multiple of every number in a list. If d1 and d2 both divide n, their LCM divides n. Not always equal to the product — only when the two are coprime.