Digit sum calculator
The Digit sum calculator computes digit sum from the relation sum of decimal digits. It takes a single input (n) and returns the digit sum. These calculators suit students working through discrete mathematics and number theory coursework, programmers dealing with primes, divisibility, remainders, bit widths and number bases, and anyone who needs a number's property settled, a sequence term produced, or a value rewritten in another notation before building the next step of a proof or a program on it. Enter your values below and the result updates instantly, and you can share a permalink that pre-fills the exact calculation. Enter whole numbers, one to a field unless the label asks for a comma separated list, and check what each field actually wants before you type, since one may be a position in a sequence while another is a value to be tested, a modulus, a bit width or a target base. These answers are discrete rather than continuous, so a dropped, rounded or mistyped digit gives a completely different result rather than a slightly wrong one, and it is worth rereading your entries before you rely on the output. For example, with n = 99, the digit sum works out to 18, and the worked example further down the page shows every step so you can follow the arithmetic and reproduce it by hand. This is a standard formula rather than a jurisdiction-specific rule, so it does not depend on an external rate or schedule, and the figure above each result carries the date it was last verified. Each function here is defined only on its own slice of the integers, so a fractional entry does not describe a point on these sequences at all, while a negative or zero value is perfectly meaningful for some of these tools and outside the domain of others, which is worth knowing before you read anything into a surprising output. Size is the second limit: several of these sequences grow very fast, and once a term passes the point where ordinary computer arithmetic holds an integer exactly, the trailing digits of a very large result should not be leaned on.
With n = 99, the result is 18.
Applies to: any numeric inputs. Method: a standard formula, not a jurisdiction-specific rule. How we document and test our methods, checked 2026-07-09.
The formula
sum of decimal digits
Worked example
With n = 99:
- sum of decimal digits
- Digit sum = 18
This worked example is one of the automated golden-value tests this calculator must pass before it can publish.
What this assumes
- Inputs are real numbers in the units shown.
- The result is the exact value of sum of decimal digits; general information, not professional advice.
Frequently asked questions
What formula does this use?
sum of decimal digits. This is a standard formula rather than a jurisdiction-specific rule.
Does the result ever change over time?
No. This is a pure formula with no external rate, so the same inputs always give the same result.
Official sources and verification
- Method: a standard formula rather than a jurisdiction-specific rule; how we document and test our methods, checked 2026-07-09.
Reviewed by the CalculatorHub team, edited by James Graham, 2026-07-09. See our methodology. General information, not professional advice.