Sum Of Digits Calculator - Add the Base-10 Digits of Any Integer

Use this sum of digits calculator to add every base-10 digit of any integer. See the digit list, total, mod 9 cross-check, digital root, and digit count in one panel.

Updated: June 16, 2026 • Free Tool

Sum Of Digits Calculator

Any integer from about -9,999,999,999,999 to 9,999,999,999,999. Positive, negative, and zero are all allowed; negative inputs use the absolute-value convention.

Results

Sum of Digits
0
Mod 9 Cross-Check 0
Digital Root 0
Number of Digits 0
Base-10 Digit List 0

What Is a Sum of Digits Calculator?

A sum of digits calculator is a quick tool that adds together the base-10 digits of any integer. Type an integer, and the result panel shows the total, the digit list, the mod 9 cross-check, the digital root, and the digit count in a single read. The total is the sum 9 + 8 + 7 + 5 = 29 for 9875, and the digital root is the iterated version 2 + 9 = 11, 1 + 1 = 2.

  • Casting out nines: Confirm that two numbers agree on a long addition or multiplication by comparing their digit sums mod 9.
  • Number-sense puzzles: Solve puzzles that ask for the total of a long sequence of digits, such as contest problems.
  • Quick divisibility check: Read the mod 9 cross-check alongside the digit sum to confirm a divisibility-by-9 test on any integer.
  • Validate reference numbers: Compare the digit sum of an account or order number against a published check value.

The phrase sum of digits is number-theory terminology for the non-negative integer left over after you add the base-10 digits of a number together. The result is always less than 9 times the digit count, so the value stays small even when the input has many digits.

For the related mod 9 remainder that powers the casting-out-nines check shown in the result panel, our Modulo Calculator returns the remainder, modular inverse, and modular exponentiation for any pair of integers.

How the Sum of Digits Calculator Works

The calculator applies the digit-sum rule in three ways at once: it builds the digit list of the absolute value of n, sums the list, and computes the digital root and the mod 9 cross-check from the same list. The values are checked against each other on every input.

s(n) = 0 if n = 0; s(n) = sum of the base-10 digits of |n| if n != 0
  • n: The input integer whose digits are being summed. May be positive, negative, or zero.
  • s(n): The sum of digits. Equals 0 when n is 0, and is a non-negative integer otherwise.
  • digit list: The base-10 digits of |n| in their original order. For 9875 the list is 9, 8, 7, 5.
  • mod 9: The remainder of s(n) divided by 9, used as the casting-out-nines cross-check.

The calculator extracts the digits of the absolute value, sums them, and then iterates the sum until a single digit remains, so the digit list, the mod 9 cross-check, and the digital root all come from the same set of digits. For a non-integer input such as 9875.6 the calculator truncates the value toward zero to 9875 and then applies the rule, so the result is the digit sum of the truncated integer rather than the original decimal.

Multi-digit number 9875

n = 9875

9 + 8 + 7 + 5 = 29; 29 mod 9 = 2; iterated reduction 2 + 9 = 11, 1 + 1 = 2

Sum of digits: 29. Mod 9: 2. Digital root: 2. Digit count: 4. Digit list: 9, 8, 7, 5.

The four digits of 9875 add to 29. The mod 9 cross-check of 2 matches the digital root of 2, so the two cross-checks agree. The digit count of 4 tells you how many digits the input had.

According to Wolfram MathWorld, the digit sum of a non-negative integer n is the sum of its base-10 digits, the digit sum of 0 is 0, and the digit sum is congruent to n modulo 9 because 10 is congruent to 1 modulo 9.

The digital root shown in the result panel is the iterated version of the same rule, and Digital Root Calculator continues the reduction all the way to a single digit and reports the mod 9 cross-check and the step count alongside it.

Key Concepts Behind the Sum of Digits

Four small ideas explain why the digit sum behaves the way it does. They keep you from confusing the digit sum with the digital root or the mod 9 remainder.

Base-10 digit sum

The digit sum is the result of adding the base-10 digits of a number together. Each digit is multiplied by 10 to a non-negative power, so the operation depends on base 10 specifically.

Mod 9 congruence

The digit sum of a positive integer n is congruent to n modulo 9, because 10 is congruent to 1 modulo 9. The mod 9 row in the result panel uses this property as a cross-check.

Difference from digital root

The digit sum is the result of adding the digits once. The digital root is the result of adding the digits and repeating the process on the result until only one digit remains. For 9875 the digit sum is 29 and the digital root is 2.

Casting out nines

Casting out nines is the long-standing technique that compares the mod 9 remainders of two numbers to confirm a long addition or multiplication.

The same mod 9 idea carries into divisibility by 9, casting-out-nines checks on long hand arithmetic, and quick sanity checks on long sequences of digits such as order or account numbers.

The reason 9 sits behind the cross-check is that 10 is congruent to 1 mod 9, a property that depends on base 10 specifically; for a hexadecimal or octal number the analogous digit sum is taken in that base, and our Base Converter translates an integer into binary, octal, or hexadecimal so the same digit-sum rule can be applied in another base.

How to Use the Sum of Digits Calculator

Enter any integer in the Integer (n) field and read the five result rows on the right. The calculator updates as you type, so you can swap between a single digit, a multiple of 9, a long integer, and a negative input.

  1. 1 Type the integer n: Enter any integer in the Integer (n) field. Whole numbers, large integers, and negative integers all work the same way; zero returns 0 across every output.
  2. 2 Read the digit sum: Look at the highlighted Sum of Digits row. The value is the total of the base-10 digits of the absolute value of n and is the primary answer.
  3. 3 Check the mod 9 cross-check: Use the Mod 9 row to confirm. The mod 9 remainder is 0 for any multiple of 9 and equals the digit sum mod 9 for any other n.
  4. 4 Follow the digital root: The Digital Root row shows the result of iterating the digit sum until a single digit remains. For 9875 the digit sum is 29 and the digital root is 2.
  5. 5 Inspect the digit list and count: The Base-10 Digit List row shows the digits of the absolute value of n in their original order, and the Number of Digits row reports the count.
  6. 6 Change the input to test cases: Type a new integer to see the result update in real time. Try a single digit, a multiple of 9, a long integer, and a negative value.

Example: a teacher needs the digit sum of 123456789 for a number-sense lesson. They type 123456789, read 45 in the Sum of Digits row, see 0 in the Mod 9 row, read 9 in the Digital Root row.

When a negative input such as -9875 is used, the digit sum matches the result for 9875 because the rule uses the absolute value; Absolute Value Calculator reports |n| and the sign together if you need to confirm.

Benefits of Using This Sum of Digits Calculator

The digit-sum rule is short, but applying it to a long integer by hand is the kind of work where small mistakes are easy to make. The calculator removes that risk and adds a cross-check.

  • Digit list and total in one view: The result panel shows the base-10 digit list and the total side by side, so the answer and the digits that produced it are visible at the same time.
  • Mod 9 cross-check built in: The mod 9 remainder is reported alongside the digit sum, so the casting-out-nines divisibility check is one glance away and can be cross-validated on every input.
  • Digital root cross-check: The digital root is shown in the same panel as the digit sum, so the iterated version of the rule is one glance away and the two values can be compared.
  • Handles zero, negatives, and large integers: Zero returns 0 without a special case. Negative inputs use the absolute-value convention. Large integers up to 13 digits are processed in a single pass.
  • Real-time updates on typing: The result panel updates as you type, so testing a single digit, a multiple of 9, a long integer, and a negative value takes no manual reset.

The biggest practical benefit is the cross-check. The digit sum, the mod 9 remainder, and the digital root are three independent ways to look at the same set of base-10 digits.

When a non-integer input such as 9875.6 is entered, this calculator truncates the value toward zero before applying the rule, so the result panel reports the digit sum of 9875 rather than 9875.6; for standard half-up, ceiling, and floor rounding rules that target a chosen precision instead, our Rounding Calculator shows the rounded value and the rule that produced it side by side.

Factors That Affect the Result and Its Limits

The rule itself is fixed, but a few choices about the input change the meaning of the result rows. The same single integer can be informative in one context and misleading in another.

Sign of the input

Positive and negative inputs use the absolute-value convention, so the digit sum of -9875 matches the digit sum of 9875.

Whether the input is a multiple of 9

Multiples of 9 always have a mod 9 cross-check of 0 and a digital root of 9, which is the casting-out-nines check that the result panel surfaces automatically.

Number of digits in the input

Long integers still have a small digit sum, because each digit contributes at most 9 to the total and the sum of 13 nines is 117.

Integer vs. non-integer input

The digit sum is defined for integers. A non-integer input such as 9875.6 is truncated toward zero (to 9875) before the rule is applied, so the result is the digit sum of the truncated value, not the original decimal.

  • The rule sums the base-10 digits. The digit sum of a hexadecimal or binary number uses the digits in that base, and this calculator only handles base-10 inputs.
  • The calculator takes one n and returns five rows for that n. For a list of values, run it once per value or batch the results in a spreadsheet.

When the question is about an integer, the result rows are the complete answer. The other math-conversion calculators cover the follow-up steps such as casting out nines on a long sum, validating an account number, or reducing a digit sum to a single digit.

According to Wikipedia, the sum of digits of a non-negative integer n is obtained by adding its base-10 digits together, the value is 0 when n is 0, and iterating the sum leads to the digital root.

When the input is the size of a factorial such as 6! = 720, this calculator returns the digit sum of 720; for the upstream n! computation that produced 720 in the first place, our Factorial Calculator handles the factorial and the multi-precision integer that goes with it.

Sum of digits calculator showing the base-10 digit list, total, mod 9 cross-check, digital root, and digit count for any integer input.
Sum of digits calculator showing the base-10 digit list, total, mod 9 cross-check, digital root, and digit count for any integer input.

Frequently Asked Questions

Q: What is the sum of digits of a number?

A: The sum of digits of an integer n is the non-negative integer left over after you add the base-10 digits of n together. The result is 0 when n is 0, and is a non-negative integer for any other n, so the same calculator covers zero, single digits, multiples of 9, and long integers.

Q: What is the sum of digits formula?

A: The closed-form sum of digits formula is s(n) = 0 if n = 0, and s(n) = the sum of the base-10 digits of |n| for any other integer n. The digit sum is congruent to n modulo 9, and iterating the sum gives the digital root 1 + ((n - 1) mod 9) for n > 0.

Q: How do I find the sum of digits step by step?

A: Write the integer in base 10, add its digits one at a time, and stop. For 9875: 9 + 8 + 7 + 5 = 29, so the sum of digits is 29. The calculator shows the digit list 9, 8, 7, 5 and the total 29 in the same result row.

Q: What is the sum of digits of 0?

A: The sum of digits of 0 is 0 by definition. Zero has no non-zero digits to add, and the mod 9 cross-check and the digital root both read 0, which is consistent with 0 being a multiple of 9.

Q: How are sum of digits and digital root related?

A: The digital root of a positive integer n is the result of iterating the sum of digits until only one digit remains. The two answers agree modulo 9, and the digital root equals 1 + ((n - 1) mod 9) for n > 0, while the sum of digits is the first step of that reduction.

Q: Where is the sum of digits used in real life?

A: The sum of digits shows up wherever a fast integer check is useful: the casting-out-nines divisibility test for long hand arithmetic, mental-math checks on long sequences of digits, contest number-sense puzzles, and quick sanity checks on account or order numbers where a full recheck is too expensive.