Search for a tool
Sum of Digits

Tool to find the sum of all digits of a number. The digit sum of a number is often used in numerology and sometimes in math problems.

Results

Sum of Digits -

Tag(s) : Number Games, Arithmetics

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Sum of Digits' tool for free! Thank you!

Sum of Digits

Digit Sum Calculator








See also: Digital Root

Answers to Questions (FAQ)

What is the sum of digits in a number? (Definition)

The sum of a number's digits is the addition of all its constituent digits.

A number is made up of digits, as a word is made up of letters. In base 10 (decimal), there are 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

How to calculate the sum of digits in a number?

Add all the digits of the number one by one.

Example: The number $ 123 $ has three digits (1, 2, and 3). The total is $ 1 + 2 + 3 = 6 $

This operation can be done mentally for small numbers, or using a tool like dCode.

How to calculate a digital root?

The digital root is computed through recursive reduction (repeated sum) that consists in repeating the addition operation until the result has only one digit.

Example: 789: $ 7+8+9 = 24 $ and $ 2+4 = 6 $

A mathematical formula makes it possible to calculate the numerical root $ r $ directly: $$ r(n) = n - 9 \left\lfloor \frac{n}{9} \right\rfloor $$

What is the difference between a number and a digit?

A digit is to a number what a letter is to a word.

A number is made up of digits, as a word is made up of letters.

Be sure to refer to the sum of the digits in a number (expressions like the sum of a digit or the sum of a number are meaningless).

There are only 10 digits: '0, 1, 2, 3, 4, 5, 6, 7, 8, 9' (in base 10), but there are an infinite number of numbers!

Numbers can have a single digit, such as 1, 2, or 3 (they are both numbers and digits).

What is a Harshad number?

A Harshad number is a number divisible by the sum of its digits.

Example: $ 18 $ is a Harshad number because $ 1 + 8 = 9 $ and $ 18 / 9 = 2 $

Source code

dCode retains ownership of the "Sum of Digits" source code. Any algorithm for the "Sum of Digits" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Sum of Digits" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Sum of Digits" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Sum of Digits" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).

Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).

To cite dCode.fr on another website, use the link: https://www.dcode.fr/digits-sum

In a scientific article or book, the recommended bibliographic citation is: Sum of Digits on dCode.fr [online website], retrieved on 2025-10-29, https://www.dcode.fr/digits-sum

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Sum of Digits' tool for free! Thank you!


https://www.dcode.fr/digits-sum
© 2025 dCode — The ultimate collection of tools for games, math, and puzzles.
â–˛  
Feedback