Divisibility Rules Checker
Inputs
| Integer | 12,345 |
|---|
Divisibility Rules Checker
Check instantly whether an integer is divisible by 2 through 11, applying classic digit-sum and last-digit rules from number theory.
Divisibility is one of the foundational ideas in number theory: an integer n is divisible by a non-zero integer d when the division n ÷ d produces no remainder — or equivalently, when there exists an integer k such that n = d × k. This calculator applies the standard divisibility rules for each divisor from 2 to 11, reporting immediately whether your chosen integer satisfies each one.
Divisibility rules by divisor
By 2
A number is divisible by 2 if and only if its last digit is even: 0, 2, 4, 6, or 8. This follows directly from the fact that 10 ≡ 0 (mod 2), so every place value above the units digit contributes a multiple of 2.
By 3
Sum all the digits. If the digit sum is divisible by 3, so is the original number. For example, 12345 has digit sum 1 + 2 + 3 + 4 + 5 = 15, and 15 ÷ 3 = 5, so 12345 is divisible by 3. The rule works because 10 ≡ 1 (mod 3), making each digit's contribution to the total equal to its face value modulo 3.
By 4
Examine only the last two digits. If the two-digit number they form is divisible by 4, the full number is too. For 12345, the last two digits give 45; 45 ÷ 4 = 11.25, so 12345 is not divisible by 4. This shortcut works because 100 is exactly divisible by 4, so digits in the hundreds place and above contribute nothing to the remainder.
By 5
A number is divisible by 5 if its last digit is 0 or 5. The reasoning is the same as for 2: 10 ≡ 0 (mod 5), so only the units digit matters.
By 6
A number is divisible by 6 if and only if it is divisible by both 2 and 3. Since 6 = 2 × 3 and gcd(2, 3) = 1, the two conditions are independent and both must hold.
By 7
No single-step digit trick exists for 7, but a workable iterative method does: double the last digit, subtract the result from the number formed by the remaining digits, and repeat until the value is small. If the final result is 0 or a multiple of 7, the original number is divisible by 7. For 343: double the last digit (3 × 2 = 6), subtract from 34 → 28; 28 ÷ 7 = 4, so 343 is divisible by 7. This calculator evaluates the modulo directly, making the iterative rule unnecessary.
By 8
Check only the last three digits. If they form a number divisible by 8, so is the full number, because 1000 = 8 × 125 is exactly divisible by 8. For 12345, the last three digits give 345; 345 ÷ 8 = 43.125, so 12345 is not divisible by 8.
By 9
Apply the digit-sum rule, but test divisibility by 9 instead of 3. For 12345, digit sum = 15; 15 ÷ 9 = 1.67, so 12345 is not divisible by 9. The rule works for exactly the same reason as the rule for 3: 10 ≡ 1 (mod 9).
By 10
A number is divisible by 10 if and only if its last digit is 0. This is simply the combination of the rules for 2 and 5.
By 11
Compute the alternating digit sum starting from the rightmost digit: add the units digit, subtract the tens digit, add the hundreds digit, and so on, alternating signs as you move left. If the result is 0 or a multiple of 11, the number is divisible by 11. For 12345, working from the right: 5 − 4 + 3 − 2 + 1 = 3; 3 is not divisible by 11, so 12345 is not. The underlying reason: 10 ≡ −1 (mod 11), so each digit alternately contributes +1 and −1 times its face value.
Worked example
Is 55440 divisible by each of 2 through 11?
- By 2: last digit 0 → yes
- By 3: digit sum 5 + 5 + 4 + 4 + 0 = 18; 18 ÷ 3 = 6 → yes
- By 4: last two digits 40; 40 ÷ 4 = 10 → yes
- By 5: last digit 0 → yes
- By 6: divisible by both 2 and 3 → yes
- By 7: 55440 ÷ 7 = 7920 exactly → yes
- By 8: last three digits 440; 440 ÷ 8 = 55 → yes
- By 9: digit sum 18; 18 ÷ 9 = 2 → yes
- By 10: last digit 0 → yes
- By 11: alternating sum 0 − 4 + 4 − 5 + 5 = 0 → yes
55440 = 2⁴ × 3² × 5 × 7 × 11 is divisible by all ten divisors from 2 to 11.
Special case: zero
Zero is divisible by every non-zero integer. The definition requires an integer k satisfying 0 = d × k; choosing k = 0 works for any d. This calculator returns "divisible" for n = 0 across all ten tests.
Precision limit
The calculator uses 64-bit floating-point arithmetic, which represents integers exactly up to 2⁵³ ≈ 9 × 10¹⁵. For integers beyond 10¹⁵ in absolute value, rounding errors may cause incorrect results. For large-number divisibility problems, consider a dedicated arbitrary-precision library.
Frequently Asked Questions (FAQ)
Why does the digit-sum rule work for 3 and 9?
Every power of 10 leaves a remainder of 1 when divided by 9 (and also by 3): 10 ≡ 1, 100 ≡ 1, 1000 ≡ 1, and so on, all mod 9. This means the value of a number modulo 9 equals the sum of its digits modulo 9. For example, 12345 has digit sum 1+2+3+4+5 = 15, and 15 mod 9 = 6, so 12345 is not divisible by 9. The same reasoning applies mod 3, since 10 ≡ 1 mod 3 as well.
What is the divisibility rule for 7?
The most practical mental-arithmetic test for 7: double the last digit, subtract it from the remaining number, and check whether the result is divisible by 7. Repeat until the number is small enough to recognise. For example, to test 343: last digit 3, double it to 6, subtract from 34 to get 28; 28 ÷ 7 = 4, so 343 is divisible by 7. This calculator computes the exact remainder directly, which is faster than the digit-manipulation rule for large numbers.
Is 0 divisible by every number?
By the standard definition, an integer a is divisible by a non-zero integer d when there exists an integer k such that a = dk. For a = 0, choose k = 0: 0 = d × 0 holds for every non-zero d. So yes, 0 is divisible by every non-zero integer. This calculator returns 'divisible' for n = 0 and all divisors from 2 to 11.
Are there divisibility rules for primes larger than 11?
Yes, though they grow progressively less convenient. For 13: multiply the last digit by 4 and add to the remaining number; repeat. For 17: multiply the last digit by 5 and subtract; repeat. For 19: multiply the last digit by 2 and add; repeat. These rules work because of the multiplicative inverse of 10 modulo the prime — the same principle underlying the rules for 7 and 11. In practice, direct division or a calculator is faster than digit-manipulation for primes above 13.