A divisibility rule is a shorthand and useful way of determining whether a given integer is divisible by a fixed divisor without performing the division, usually by examining its digits. Although there are divisibility tests for numbers in any radix, or base, and they are all different, this article presents rules and examples only for decimal, or base 10, numbers. Martin Gardner explained and popularized these rules in his September 1962 "Mathematical Games" column in Scientific American.

Divisibility rules for numbers 1−30 The rules given below transform a given number into a generally smaller number, while preserving divisibility by the divisor of interest. Therefore, unless otherwise noted, the resulting number should be evaluated for divisibility by the same divisor. In some cases the process can be iterated until the divisibility is obvious; for others (such as examining the last n digits) the result must be examined by other means.

For divisors with multiple rules, the rules are generally ordered first for those appropriate for numbers with many digits, then those useful for numbers with fewer digits.

+ Divisor Divisibility rule Examples 1 No specific condition. Any integer is divisible by 1. 2 is divisible by 1. 2 The last digit is even (0, 2, 4, 6, or 8).This follows from Pascal's criterion. See Kisačanin (1998), [ p. 100–101]A number is divisible by 2m, 5m or 10m if and only if the number formed by the last m digits is divisible by that number. See Richmond & Richmond (2009), [ p. 105] 1,294: 4 is even. 3 The sum of the digits is divisible by 3.Apostol (1976), [ p. 108]Richmond & Richmond (2009), [ Section 3.4 (Divisibility Tests), p. 102–108] 405 → 4 + 0 + 5 = 9 and 636 → 6 + 3 + 6 = 15 which both are divisible by 3,16,499,205,854,376 → 1 + 6 + 4 + 9 + 9 + 2 + 0 + 5 + 8 + 5 + 4 + 3 + 7 + 6 sums to 69 → 6 + 9 = 15, which is divisible by 3. Subtract the quantity of the digits 2, 5, and 8 in the number from the quantity of the digits 1, 4, and 7 in the number. 16,499,205,854,376 has four of the digits 1, 4 and 7 and four of the digits 2, 5 and 8; since 4 − 4 = 0 is a multiple of 3, the number 16,499,205,854,376 is divisible by 3. Subtracting twice the last digit from the rest is divisible by 3. 405: 40 − 5 × 2 = 40 − 10 = 30 = 3 × 10. 4 The last two digits form a number that is divisible by 4. 40,832: 32 is divisible by 4. If the tens digit is even, the ones digit must be 0, 4, or 8.If the tens digit is odd, the ones digit must be 2 or 6. 40,832: 3 is odd, and the last digit is 2. The sum of the ones digit and double the tens digit is divisible by 4. 40,832: 2 × 3 + 2 = 8, which is divisible by 4. 5 The last digit is 0 or 5. 495: the last digit is 5. 6 The number must be even, and the sum of the digits must be divisible by 3.Richmond & Richmond (2009), [ Section 3.4 (Divisibility Tests), Theorem 3.4.3, p. 107] 1,458: 1 + 4 + 5 + 8 = 18, so it is divisible by 3 and the last digit is even, hence the number is divisible by 6. Sum the ones digit, 4 times the 10s digit, 4 times the 100s digit, 4 times the 1000s digit, etc. 1,458: (4 × 1) + (4 × 4) + (4 × 5) + 8 = 4 + 16 + 20 + 8 = 48. 7 Forming an alternating sum of blocks of three from right to left gives a multiple of 7.Kisačanin (1998), [ p. 101] 1,369,851: 851 − 369 + 1 = 483 = 7 × 69. Adding 5 times the last digit to the rest gives a multiple of 7. 483: 48 + (3 × 5) = 63 = 7 × 9. Subtracting twice the last digit from the rest gives a multiple of 7. 483: 48 − (3 × 2) = 42 = 7 × 6. Adding 3 times the first digit to the next and then writing the rest gives a multiple of 7. 483: 4 × 3 + 8 = 20, 203: 2 × 3 + 0 = 6, 63: 6 × 3 + 3 = 21. Adding the last two digits to twice the rest gives a multiple of 7. 483,595: 95 + (2 × 4835) = 9765: 65 + (2 × 97) = 259: 59 + (2 × 2) = 63. Multiply each digit (from right to left) by the digit in the corresponding position in this pattern (from left to right): 1, 3, 2, −1, −3, −2 (repeating for digits beyond the hundred-thousands place). Adding the results gives a multiple of 7. 483,595: (4 × (−2)) + (8 × (−3)) + (3 × (−1)) + (5 × 2) + (9 × 3) + (5 × 1) = 7. Compute the remainder of each digit pair (from right to left) when divided by 7. Multiply the rightmost remainder by 1, the next to the left by 2 and the next by 4, repeating the pattern for digit pairs beyond the hundred-thousands place. Adding the results gives a multiple of 7. 194,536: 19|45|36; (5 × 4) + (3 × 2) + (1 × 1) = 27, so it is not divisible by 7,204,540: 20|45|40; (6 × 4) + (3 × 2) + (5 × 1) = 35, so it is divisible by 7. 8 If the hundreds digit is even, the number formed by the last two digits must be divisible by 8. 624: 24. If the hundreds digit is odd, the number obtained by the last two digits must be 4 times an odd number. 352: 52 = 4 × 13. Add the last digit to twice the rest. The result must be divisible by 8. 56: (5 × 2) + 6 = 16. The last three digits are divisible by 8. 34,152: examine divisibility of just 152: 19 × 8. The sum of the ones digit, double the tens digit, and four times the hundreds digit is divisible by 8. 34,152: 4 × 1 + 5 × 2 + 2 = 16.If the hundreds digit is even, the last two digits must be 00, 08, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88 or 96.34,200: 2 is even and the last two digits are 00If the hundreds digit is odd, the last two digits must be divisible by 4 but not by 8, i.e. 04, 12, 20, 28, 36, 44, 52, 60, 68, 76, 84 or 92.34,152: 1 is odd and the last two digits are 52 9 The sum of the digits is divisible by 9. 2,880: 2 + 8 + 8 + 0 = 18: 1 + 8 = 9. Subtracting 8 times the last digit from the rest gives a multiple of 9. 2,880: 288 − 0 × 8 = 288 − 0 = 288 = 9 × 32. 10 The last digit is 0. 130: the ones digit is 0. It is divisible by 2 and by 5. 130: it is divisible by 2 and by 5. 11 Form the alternating sum of the digits, or equivalently sum(odd) – sum(even). 918,082: 9 − 1 + 8 − 0 + 8 − 2 = 22 = 2 × 11. Add the digits in blocks of two from right to left. 627: 6 + 27 = 33 = 3 × 11. Subtract the last digit from the rest. 627: 62 − 7 = 55 = 5 × 11. Add 10 times the last digit to the rest. 627: 62 + 70 = 132: 13 + 20 = 33 = 3 × 11. If the number of digits is even, add the first and subtract the last digit from the rest. 918,082: the number of digits is even (6) → 1808 + 9 − 2 = 1815: 81 + 1 − 5 = 77 = 7 × 11. If the number of digits is odd, subtract the first and last digit from the rest. 14,179: the number of digits is odd (5) → 417 − 1 − 9 = 407: 0 − 4 − 7 = −11 = −1 × 11. 12 It is divisible by 3 and by 4. 324: it is divisible by 3 and by 4. Subtract the last digit from twice the rest. 324: 32 × 2 − 4 = 60 = 5 × 12. 13 Form the alternating sum of blocks of three from right to left. 2,911,272: 272 − 911 + 2 = −637. Add 4 times the last digit to the rest. 637: 63 + 7 × 4 = 91, 9 + 1 × 4 = 13. Subtract the last two digits from four times the rest. 923: 9 × 4 − 23 = 13. Subtract 9 times the last digit from the rest. 637: 63 − 7 × 9 = 0. 14 It is divisible by 2 and by 7. 224: it is divisible by 2 and by 7. Add the last two digits to twice the rest. 364: 3 × 2 + 64 = 70,1,764: 17 × 2 + 64 = 98. 15 It is divisible by 3 and by 5. 390: it is divisible by 3 and by 5. 16 If the thousands digit is even, the number formed by the last three digits is divisible by 16. 254,176: 176. If the thousands digit is odd, the number formed by the last three digits must be 8 times an odd number. 3408: 408 = 8 × 51. Add the last two digits to four times the rest. 176: 1 × 4 + 76 = 80, 1,168: 11 × 4 + 68 = 112. The last four digits is divisible by 16. 157,648: 7,648 = 478 × 16. 17 Subtract 5 times the last digit from the rest. 221: 22 − 1 × 5 = 17. Add 12 times the last digit to the rest. 221: 22 + 1 × 12 = 22 + 12 = 34 = 17 × 2. Subtract the last two digits from two times the rest. 4,675: 46 × 2 − 75 = 17. Add twice the last digit to 3 times the rest. Drop trailing zeroes. 4,675: 467 × 3 + 5 × 2 = 1,411: 141 × 3 + 1 × 2 = 425: 42 × 3 + 5 × 2 = 136: 13 × 3 + 6 × 2 = 51, 238: 23 × 3 + 8 × 2 = 85. 18 It is divisible by 2 and by 9. 342: it is divisible by 2 and by 9. 19 Add twice the last digit to the rest. 437: 43 + 7 × 2 = 57. Add 4 times the last two digits to the rest. 6,935: 69 + 35 × 4 = 209. 20 It is divisible by 10, and the tens digit is even. 360: is divisible by 10, and 6 is even. The last two digits are 00, 20, 40, 60 or 80. 480: 80 It is divisible by 4 and by 5. 480: it is divisible by 4 and by 5.21 Subtracting twice the last digit from the rest gives a multiple of 21. 168: 16 − 8 × 2 = 0. Adding 19 times the last digit to the rest gives a multiple of 21. 441: 44 + 1 × 19 = 44 + 19 = 63 = 21 × 3. It is divisible by 3 and by 7. 231: it is divisible by 3 and by 7. 22 It is divisible by 2 and by 11. 352: it is divisible by 2 and by 11. 23 Add 7 times the last digit to the rest. 3,128: 312 + 8 × 7 = 368: 36 + 8 × 7 = 92. Add 3 times the last two digits to the rest. 1,725: 17 + 25 × 3 = 92. Subtract 16 times the last digit from the rest. 1,012: 101 − 2 × 16 = 101 − 32 = 69 = 23 × 3. Subtract twice the last three digits from the rest. 2,068,965: 2,068 − 965 × 2 = 138. 24 It is divisible by 3 and by 8. 552: it is divisible by 3 and by 8. 25 The last two digits are 00, 25, 50 or 75. 134,250: 50 is divisible by 25. 26 It is divisible by 2 and by 13. 156: it is divisible by 2 and by 13. Subtracting 5 times the last digit from twice the rest of the number gives a multiple of 26. 1,248 : (124 × 2) − (8 × 5) = 208 = 26 × 8.27 Sum the digits in blocks of three from right to left. 2,644,272: 2 + 644 + 272 = 918. Subtract 8 times the last digit from the rest. 621: 62 − 1 × 8 = 54. Sum 19 times the last digit from the rest. 1,026: 102 + 6 x 19 = 102 + 114 = 216 = 27 × 8. Subtract the last two digits from 8 times the rest. 6,507: 65 × 8 − 7 = 520 − 7 = 513 = 27 × 19. 28 It is divisible by 4 and by 7. 140: it is divisible by 4 and by 7. 29 Add three times the last digit to the rest. 348: 34 + 8 × 3 = 58. Add 9 times the last two digits to the rest. 5,510: 55 + 10 × 9 = 145 = 5 × 29. Subtract 26 times the last digit from the rest. 1,015: 101 − 5 × 26 = 101 − 130 = −29 = 29 × −1 Subtract twice the last three digits from the rest. 2,086,956: 2,086 − 956 × 2 = 174. 30 It is divisible by 3 and by 10. 270: it is divisible by 3 and by 10. It is divisible by 2, by 3 and by 5. 270: it is divisible by 2, by 3 and by 5. It is divisible by 2 and by 15. 270: it is divisible by 2 and by 15. It is divisible by 5 and by 6. 270: it is divisible by 5 and by 6.

Step-by-step examples

Divisibility by 2 First, take any number (for this example it will be 376) and note the last digit in the number, discarding the other digits. Then take that digit (6) while ignoring the rest of the number and determine if it is divisible by 2. If it is divisible by 2, then the original number is divisible by 2.

Example 376 (The original number) 37 6 (Take the last digit) 6 ÷ 2 = 3 (Check to see if the last digit is divisible by 2) 376 ÷ 2 = 188 (If the last digit is divisible by 2, then the whole number is divisible by 2)

Divisibility by 3 or 9 First, take any number (for this example it will be 492) and add together each digit in the number (4 + 9 + 2 = 15). Then take that sum (15) and determine if it is divisible by 3. The original number is divisible by 3 (or 9) if and only if the sum of its digits is divisible by 3 (or 9).

Adding the digits of a number up, and then repeating the process with the result until only one digit remains, will give the remainder of the original number if it were divided by nine (unless that single digit is nine itself, in which case the number is divisible by nine and the remainder is zero).

This can be generalized to any standard positional system, in which the divisor in question then becomes one less than the radix; thus, in base-twelve, the digits will add up to the remainder of the original number if divided by eleven, and numbers are divisible by eleven only if the digit sum is divisible by eleven.

Example.