Welcome back to Divisibility Shortcuts! In the first lesson, you discovered that divisibility by 2, 5, and 10 comes down to a single glance at the last digit — a shortcut powered by the way base ten handles multiples of 10. Now, in this second lesson of five, we move on to two new divisors that demand a different approach: 3 and 9. This time, the last digit alone will not be enough. Instead, you will learn a technique called the digit-sum test, a method that checks all the digits at once. By the end of this lesson, you will be able to test divisibility by 3 and 9 quickly, and you will understand the place-value reasoning that makes the trick work.
When the Last Digit Is Not Enough
Consider the numbers 13, 23, 33, 43, 53, 63, , , and . They all end in , yet only some of them are divisible by (specifically , , and ). The last digit is the same every time, but divisibility changes. This tells us that the last digit cannot be the deciding factor for .
What Is a Digit Sum?
The digit sum of a number is simply the total you get when you add each of its individual digits together. For example:
The digit sum of 47 is 4+7=11.
The digit sum of 583 is 5+.
Divisibility by 3: The Digit-Sum Test
Here is the rule: a whole number is divisible by 3 if and only if the sum of its digits is divisible by 3.
The process has two stages. First, compute the digit sum. Then, check whether that sum is divisible by 3. Let's walk through a few examples:
Number
Digit Sum
Digit Sum ÷ 3
Divisible by 3?
123
1+2+3=6
6
Divisibility by 9: A Stricter Version
The rule for 9 follows exactly the same pattern but with a higher bar: a whole number is divisible by 9 if and only if the sum of its digits is divisible by 9.
Let's revisit the same numbers and test for 9:
Number
Digit Sum
Digit Sum ÷ 9
Divisible by 9?
123
6
6÷9=0 R
How the Two Rules Relate
Since 9 is itself a multiple of 3, the test for 9 is simply a tighter version of the test for 3. When you check a number against both rules, there are exactly three possible outcomes:
Divisible by both 3 and 9 — the digit sum is divisible by 9 (which guarantees divisibility by too). Example: .
Why the Digit-Sum Rule Works
Understanding why a shortcut works keeps it from feeling like mere memorization, and once again the answer lives in place value. Consider a three-digit number written in expanded form:
number=a×100+b×10+c
We can rewrite each power of 10 using the fact that and :
Digit-Sum Test on a Real-World Number
Let's put the full process together with a practical scenario. Suppose a warehouse receives a shipment of 7,938 items, and you need to know whether they can be packed evenly into crates of 3 or crates of 9 with nothing left over.
Step 1 — Compute the digit sum.
7+9+3+8=
Quick-Reference Table
Here is a compact summary to keep alongside the last-digit rules from our first lesson:
Divisor
Rule
Example: 432 (4+3+2=9)
Example: 520 (5+2+0=)
Conclusion and Next Steps
In this lesson, you learned that divisibility by 3 and 9 can both be tested by computing the digit sum of a number. If that sum is divisible by 3, the number is divisible by 3; if the sum is divisible by 9, the number is divisible by 9 (and by 3 as well). The reason this works is that each power of is just one more than a multiple of , so the leftover from every digit collects into the digit sum. These two rules now join the last-digit tests for , , and in your growing toolkit of divisibility shortcuts.
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal
73
83
93
3
3
33
63
93
3
Why not? The last-digit shortcut works for 2, 5, and 10 because 10 is divisible by each of those numbers. The divisor 3, however, does not divide 10 evenly. Because of this mismatch, every digit in the number plays a role — and we need a test that looks at all of them. That test is the digit sum.
8+
3=
16
The digit sum of 2,019 is 2+0+1+9=12.
If the digit sum itself is a large number, you can sum its digits again. For instance, 16→1+6=7. This repeated summing can make it even easier to judge divisibility, but a single pass is usually all you need.
÷
3=
2
Yes
247
2+4+7=13
13÷3=4 R 1
No
5,031
5+0+3+1=9
9÷3=3
Yes
Notice that 247 has a digit sum of 13. If you are unsure whether 13 is divisible by 3, sum its digits again: 1+3=4. Since 4 is not divisible by 3, neither is 13, and neither is 247.
6
No
247
13
13÷9=1 R 4
No
5,031
9
9÷9=1
Yes
The number 123 passes the test for 3 but fails the test for 9. Meanwhile, 5,031 passes both. This makes sense: 9=3×3, so any number divisible by 9 is automatically divisible by 3 as well. The reverse, however, is not true.
3
81→8+1=9
Divisible by 3 only — the digit sum is divisible by 3 but not by 9. Example: 51→5+1=6.
Divisible by neither — the digit sum is not divisible by 3. Example: 43→4+3=7.
There is no scenario where a number is divisible by 9 but not by 3. Keeping these three categories in mind will help you classify any number quickly.
10=9+1
100=99+1
a×(99+1)+b×(9+1)+c
Distributing and regrouping gives us:
=always divisible by 9a×99+b×9+digit sum(a+b+c)
The first group is clearly divisible by 9 (and therefore by 3), because 99 and 9 are both multiples of 9. That means the original number and the digit sum leave the same remainder when divided by 9 or by 3. So if the digit sum is divisible by 3, the whole number must be too — and the same logic applies to 9.
This reasoning extends to numbers of any length, because every power of 10 is one more than a string of nines: 1,000=999+1, 10,000=9,999+1, and so on. A string of nines is always divisible by 9, so the leftover from every digit position collects neatly into the digit sum.
27
Step 2 — Check divisibility of the digit sum.
Is 27 divisible by 3? Yes, because 27÷3=9.
Is 27 divisible by 9? Yes, because 27÷9=3.
Conclusion:7,938 is divisible by both 3 and 9, so the items can be packed evenly into crates of either size.
If you want extra confidence, you can sum the digits of 27 once more: 2+7=9, which is clearly divisible by both 3 and 9. This repeated summing is a helpful safety net whenever the digit sum is still a multi-digit number.
7
3
Digit sum divisible by 3
9÷3=3 ✔
7÷3=2 R 1 ✘
9
Digit sum divisible by 9
9÷9=1 ✔
7÷9=0 R 7 ✘
Remember: passing the test for 9 automatically means passing the test for 3, but not the other way around.
10
9
2
5
10
Now it is time to put the digit-sum test into action! In the upcoming practice tasks, you will compute digit sums for recipe ingredients, analyze utility meter readings, and explain the reasoning behind the rule in your own words. Let's see those digits add up!