Digit sums and digital roots
A digit sum is simply every digit of a number added together: for 987 that is 9+8+7, which gives 24. The digital root goes one step further and keeps repeating the digit sum until only one digit is left. Adding the digits of 24 gives 6, so the digital root of 987 is 6. This calculator reports the single-pass digit sum and the fully reduced digital root separately, and chains the intermediate values with arrows so the process is visible.
You can also reach the digital root without repeating anything. For any whole number n above zero, 1 + (nā1) mod 9 always equals the digital root. That is why the digital root carries essentially the same information as the remainder after dividing by 9, with a remainder of 0 read as 9 instead. A digital root of 9 therefore means the number is a multiple of 9, and a dedicated row reports that when it happens. The single exception is n = 0, where the formula is skipped and the digital root is defined as 0.
Signs have nothing to do with digits, so a negative input is handled by absolute value. Values with a decimal point have no digit sum and are rejected, and inputs are capped at one quadrillion in absolute value so the integer arithmetic stays exact. The mod 9 property behind all of this is the classic casting out nines check, still handy for catching transposed digits in hand-copied figures.
Frequently Asked Questions
Add the digits, and if the result still has two or more digits add them again, repeating until a single digit is left. 987 becomes 24 and then 6, so its digital root is 6.
Yes, 1 + (nā1) mod 9 gives it directly. The one exception is n = 0, where the formula is skipped and the digital root is defined as 0.
The sign has nothing to do with the digits, so the calculation uses the absolute value. ā456 and 456 both have a digit sum of 15 and a digital root of 6.