Skip to content
Math

Digit Sum Calculator

Enter any whole number to get the sum of its digits and its digital root in one click. The calculator shows the full step-by-step addition, checks divisibility by 3 and 9, flags Harshad numbers, and explains the math. Results update as you type.

Your details

Enter a positive integer. Decimals and negative signs are ignored.
Digit sum = add all digits once. Digital root = keep summing until a single digit remains.
Digit SumMulti-digit sum
29

Sum of all individual digits in the number

Digital Root2
Number of Digits4
Divisible by 3No
Divisible by 9No
Harshad numberNo
2
1<22-32-44-64-77-97+

Digit sum: 29, digital root: 2

  • The 4-digit number has a digit sum of 29, which reduces to the digital root 2.
  • The digit sum (29) is not divisible by 3 or 9, so the number itself is not divisible by 3 or 9 either.

Next stepThe digital root (2) is a fingerprint of the number mod 9. Numbers with the same digital root differ by a multiple of 9.

What is the digit sum of a number?

The digit sum of a number is found by adding all of its individual digits together, ignoring their place value. For example, the digit sum of 9875 is 9 + 8 + 7 + 5 = 29. The process treats each digit as a standalone value from 0 to 9, regardless of whether it appears in the units, tens, or millions column. Digit sums appear throughout mathematics and everyday life: they underlie the divisibility rules for 3 and 9, they drive the ISBN and credit-card checksum algorithms, and they are a classical trick for quickly catching arithmetic errors.

What is the digital root?

The digital root goes one step further. If the digit sum itself has more than one digit, you add those digits together too, and keep repeating until you are left with a single digit from 1 to 9. For 9875: digit sum is 29, then 2 + 9 = 11, then 1 + 1 = 2, so the digital root is 2. There is a shortcut formula: the digital root equals the remainder when the number is divided by 9, except that a remainder of 0 means the digital root is 9 (not 0). So digital root = n mod 9, with 0 replaced by 9. This makes digital roots fast to compute mentally and useful for checking multiplication by hand.

Divisibility rules powered by digit sums

One of the most useful applications of digit sums is instant divisibility testing. A whole number is divisible by 3 if and only if its digit sum is divisible by 3. It is divisible by 9 if and only if its digit sum is divisible by 9. For example, 123,453 has digit sum 1+2+3+4+5+3 = 18. Since 18 is divisible by 9 (and by 3), the number 123,453 is divisible by both 9 and 3, without doing any long division. These rules work in any number of digits and are faster than dividing when numbers are large.

Harshad numbers and other digit-sum curiosities

A Harshad number (also called a Niven number) is a whole number that is exactly divisible by its own digit sum. The name comes from Sanskrit and means "joy-giver." For example, 18 has digit sum 9, and 18 / 9 = 2, so 18 is a Harshad number. Other examples include 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, and 27. Not all numbers are Harshad numbers: 19 has digit sum 10, and 19 / 10 is not a whole number, so 19 is not a Harshad number. Harshad numbers appear in number theory and recreational mathematics, and every digital root of 9 is automatically a Harshad number.

Digital root patterns and divisibility rules

Digital RootDivisible byNotes
1none (of 2,3,9)Indeterminate for 2; not 3 or 9
2none (of 3,9)Not divisible by 3 or 9
33Divisible by 3, not 9
4none (of 3,9)Not divisible by 3 or 9
5none (of 3,9)Not divisible by 3 or 9
63Divisible by 3, not 9
7none (of 3,9)Not divisible by 3 or 9
8none (of 3,9)Not divisible by 3 or 9
99 and 3Divisible by both 9 and 3

The digital root (1-9) tells you immediately which small numbers divide your number, without any division.

Frequently asked questions

How do I find the digit sum of a number?

Write down the number and add each individual digit together from left to right. For example, the digit sum of 74,821 is 7 + 4 + 8 + 2 + 1 = 22. Ignore any minus sign, decimal point, or spaces; only count the actual digit characters 0-9.

What is the difference between digit sum and digital root?

The digit sum adds all the digits once and may produce a multi-digit result. The digital root repeats the process on the result until a single digit (1-9) remains. For 569: digit sum = 5+6+9 = 20, digital root = 2+0 = 2. For any number whose digit sum is already a single digit, the digit sum and digital root are the same.

Why does the digital root formula use mod 9?

Because 10 is congruent to 1 (mod 9), any power of 10 is also congruent to 1 (mod 9). That means each digit contributes exactly its face value to the remainder when the number is divided by 9. Adding the digits therefore gives the same mod-9 remainder as the original number. Repeating until a single digit remains just keeps applying this identity until the result cannot shrink further. The only special case is 0 mod 9 = 0, but a digital root of 0 only happens for the number 0 itself; for any positive multiple of 9 the digital root is 9.

Can the digit sum be zero?

Only for the number 0 itself. Every positive integer has at least one non-zero digit (the leading digit must be at least 1), so its digit sum is at least 1. The number 0 has digit sum 0 and digital root 0, which is the sole exception to the rule that digital roots run from 1 to 9.

What are Harshad numbers and why do they matter?

A Harshad number is any positive integer that is evenly divisible by the sum of its own digits. They are studied in recreational mathematics and number theory. Every single-digit number is a Harshad number (since each is divisible by itself). Numbers with digital root 9 are always Harshad numbers because their digit sum is a multiple of 9, and the original number is also a multiple of 9.

How do digit sums help with divisibility by 3 and 9?

Because 10 is equivalent to 1 mod 9, every digit contributes its face value to the number modulo 9. If you add all the digits and the total is divisible by 3, the whole number is divisible by 3. If the total is divisible by 9, the whole number is divisible by 9. This is the fastest way to check large numbers by hand and is the basis of the classic "casting out nines" error-checking method.

Sources

Written by Dr. Rajiv Menon, PhD Applied Mathematician · Bengaluru, India

Applied mathematician bridging algebraic theory and computational tools for students, engineers, and everyday problem-solvers.

Search 3,500+ calculators

Loading search…