Work out digit sum instantly with clear inputs, formula shown and shareable results.
The digit sum adds every digit of a number. Because 10 ≡ 1 (mod 9), the digit sum is congruent to the original number modulo 9, which is the basis of the divisibility test for 9 and of casting out nines.
Digit sum
S(v) = sum of the decimal digits of v, S(v) ≡ v (mod 9)
9 + 8 + 7 + 6 + 5 = 35, and repeating gives 8.
Digit sums of the operands must combine the same way as the operands themselves modulo 9, so a mismatch reveals an error.