Mathwords logoMathwords

Digit Sum — Definition, Formula & Examples

Digit sum is the result you get when you add up all the individual digits of a number. For example, the digit sum of 274 is 2 + 7 + 4 = 13.

Given a non-negative integer nn with decimal representation dkdk1d1d0d_k d_{k-1} \dots d_1 d_0, the digit sum of nn is defined as S(n)=d0+d1++dkS(n) = d_0 + d_1 + \cdots + d_k, where each di{0,1,2,,9}d_i \in \{0, 1, 2, \dots, 9\}.

Key Formula

S(n)=d0+d1+d2++dkS(n) = d_0 + d_1 + d_2 + \cdots + d_k
Where:
  • S(n)S(n) = The digit sum of the number n
  • did_i = The digit in the i-th place of n (ones, tens, hundreds, etc.)

How It Works

To find a digit sum, write out the number and add each digit from left to right. For 582, compute 5+8+2=155 + 8 + 2 = 15. Sometimes you need the repeated digit sum (also called the digital root), where you keep summing the digits of the result until you reach a single digit: 151+5=615 \to 1 + 5 = 6. Digit sums power two key divisibility rules: a number is divisible by 3 if its digit sum is divisible by 3, and divisible by 9 if its digit sum is divisible by 9.

Worked Example

Problem: Find the digit sum of 4,938 and determine whether the number is divisible by 9.
Identify the digits: The digits of 4,938 are 4, 9, 3, and 8.
Add the digits: Sum all four digits together.
4+9+3+8=244 + 9 + 3 + 8 = 24
Apply the divisibility rule: Check whether 24 is divisible by 9. Since 24÷9=224 \div 9 = 2 remainder 66, the digit sum 24 is not divisible by 9.
Answer: The digit sum of 4,938 is 24, so 4,938 is not divisible by 9 (but it is divisible by 3, since 24 ÷ 3 = 8 with no remainder).

Why It Matters

Digit sums give you a fast mental shortcut for checking divisibility by 3 and 9 without performing long division. This technique appears frequently in middle-school number theory problems and math competitions, and accountants historically used a related method called "casting out nines" to catch arithmetic errors.

Common Mistakes

Mistake: Confusing the digit sum with the digital root and stopping too early or going too far.
Correction: The digit sum is the result of adding the digits once (e.g., for 99 it is 18). The digital root repeats the process until a single digit remains (18 → 9). Know which one a problem is asking for.