StatGardenREF. DESK
Calculators/Maths/Sum of digits
Maths

Sum of digits calculator

Adds up the individual digits of a whole number in one pass (not repeated to a single digit).

Published 24 September 2026

What this calculator does

The digit sum of a number is exactly what it sounds like: write the number out and add its digits together. For 48,213 that is 4 + 8 + 2 + 1 + 3, which comes to 18. It is a single pass, performed once and left there.

That last point is where people trip. Adding the digits repeatedly until only one digit is left gives the digital root, which is a different quantity. 48,213 has a digit sum of 18 and a digital root of 9, because 1 + 8 is 9. This calculator does the single pass, not the repeated one.

The formula

FormulaFor n with digits d₁d₂…dₖ: sum = d₁ + d₂ + … + dₖ

The number is taken without its sign, rounded to a whole number, split into its individual digits, and those digits are added together. A minus sign contributes nothing, since it is not a digit. The count of digits is reported alongside the total, and the breakdown shows each digit in the addition so the working can be checked at a glance.

TermMeaning
Digit sumThe total of the individual digits, added once.
Digital rootThe result of repeating the digit sum until a single digit remains, always a value from 1 to 9 for any positive number.
Digit countHow many digits the number is written with, which sets the largest possible digit sum at nine times that count.

The inputs explained

FieldWhat to enter
NumberThe number whose digits are to be added. Negative signs are ignored and decimals are rounded to a whole number first.

When to use it

Applying a divisibility test

A number is divisible by 3 exactly when its digit sum is, and by 9 exactly when its digit sum is. Summing the digits of a large number is far quicker than dividing it, which is why these two tests are the ones people actually remember.

Checking a checksum or puzzle condition

Digit sums appear in identification numbers, competition puzzles and recreational maths problems, often as a quick condition a candidate answer has to satisfy before anything else is tried.

Verifying long-hand arithmetic

Casting out nines uses digit sums to catch errors in addition and multiplication done by hand. The digit sums of the inputs, combined the same way as the inputs themselves, must match the digit sum of the answer.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How does the digit sum compare across different numbers?

Five numbers chosen to show that the digit sum has little to do with the size of the number.

Digit sums and digit counts
NumberSum of digitsNumber of digits
999273
1,00014
48,213185
99,999455
123,456,789459
Size and digit sum are barely related. 999 sums to 27, while 1,000, one larger, sums to 1. The last two rows land on the same total of 45 from quite different numbers, one being five nines and the other running straight through every digit from 1 to 9.

Questions

What is the difference between a digit sum and a digital root?

The digit sum adds the digits once. The digital root keeps repeating that until a single digit is left. For 48,213 the digit sum is 18 and the digital root is 9. For any number under 10 they are the same, which is why the distinction is easy to miss at first.

Why do divisibility tests for 3 and 9 use the digit sum?

Because every power of ten leaves a remainder of 1 when divided by 9, so a number and its digit sum always leave the same remainder. The same holds for 3, since 3 divides 9. No other single-digit divisor has that property in base ten, which is why there is no equally tidy test for 7.

Does a negative sign change the digit sum?

No. Only the digits are added, and the sign is not one of them, so −4,321 and 4,321 both give 10.

What is the largest possible digit sum for a given number of digits?

Nine times the digit count, reached when every digit is a 9. A five-digit number cannot have a digit sum above 45, which is why 99,999 in the table sits at that ceiling.

For the repeated version that reduces to a single digit, see the digital root calculator. To test divisibility directly across a range of divisors, see the divisibility test calculator.