Digital root calculator
9875 becomes 29, then 11, then 2: its digital root is 2, reached in 3 steps. Enter any non-negative whole number, even one with up to 1000 digits, and see the root, the step count and each sum. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 9,875
- Digital root
- 2
- Additive persistence
- 3
The digital root of a non-negative integer is the single digit you obtain by repeatedly replacing the number with the sum of its decimal digits until only one digit remains. That process also defines additive persistence: the count of digit-sum steps required to reach a single digit. Both quantities appear in divisibility rules, checksum intuition, recreational number theory, and classroom exercises about congruence modulo nine. This calculator takes one non-negative integer, runs the iterative digit-sum algorithm deterministically, returns the digital root and the persistence count, and lists every intermediate step so you can verify the path by hand.
What digital root and additive persistence mean
Start with any non-negative integer written in base ten. Add its digits to produce a new non-negative integer that is strictly smaller whenever the original had more than one digit. Repeat until the result is a single digit in the range zero through nine.
That final digit is the digital root. The number of times you performed a full digit sum is the additive persistence. For example, nine thousand eight hundred seventy-five becomes twenty-nine, then eleven, then two: the digital root is two and the additive persistence is three.
Zero already is a single digit, so its digital root is zero and its persistence is zero. Single-digit inputs similarly need no steps. A deep reason the process is stable is modular arithmetic: for any positive n the digital root equals n modulo nine, except that multiples of nine map to nine rather than zero, while zero itself maps to zero.
That congruence explains classic divisibility tests by three and nine and is why two numbers with the same digital root share the same residue class modulo nine. Additive persistence is a separate complexity measure: how many iterations the digit-sum map needs before it stabilizes. Large strings of nines need more steps than sparse small digits, which makes persistence a useful teaching counterexample when students assume every digit function behaves like a single modular reduction.
How this calculator evaluates the repeated digit sum
The implementation first validates that n is present, finite, integral, and not negative. It then normalizes the value to a canonical digit string without deceptive leading zeros. While the current string has more than one character, the engine sums its digit codes, records a step with the previous value and the new digit sum, and continues from that sum written in decimal.
When a single digit remains, that digit is the digital root and the step count is the additive persistence. Independently, a modular closed form computed from the original digits confirms the same root, so a mismatch would surface as an internal consistency error rather than a silent wrong answer.
Practical use, limits, pricing, and delivery
Use the browser tool when you want an immediate digital root while studying divisibility, checking a contest problem, or explaining congruence modulo nine without installing a computer-algebra system. Accepted inputs are non-negative integers, including long digit strings up to one thousand digits so classroom examples and checksum demos are not forced into floating-point approximations. Results are fully deterministic: the same n always yields the same digital root, the same additive persistence, and the same ordered list of intermediate steps.
There is no language model, no external arithmetic service, and no randomness, so the capability is safe to pin in automated tests and reproducible notebooks.
What you can do with it
Homework and contest verification
Students and graders can confirm digital roots and additive persistence for arbitrary non-negative integers and inspect every intermediate digit sum without a local CAS.
Divisibility and modular-arithmetic teaching
Lesson materials that introduce congruence modulo nine can show the digital root beside the iterative path so learners connect digit sums to residues.
FAQ
What happens if n is negative?
Digital root is defined here for non-negative integers only; negatives are rejected and not charged.
What is additive persistence?
Additive persistence is the number of times you must replace a number by the sum of its digits until only one digit remains. Single-digit inputs have persistence zero.
Is the digital root calculator free?
The browser tool runs free on your device.
Does the digital root always match n modulo 9?
For positive n the digital root equals n mod 9, except multiples of nine map to nine instead of zero. Zero maps to zero. This calculator also returns the iterative steps so you can verify by hand.
What is the digital root of 9875?
It is 2. The digits of 9875 add up to 29, the digits of 29 add up to 11, and the digits of 11 add up to 2. That took 3 steps, so the additive persistence is 3.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/numth/digital-root \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":9875}'const res = await fetch("https://api.kit.forhosting.com/numth/digital-root", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": 9875
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/numth/digital-root",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": 9875
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/numth/digital-root", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":9875}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":9875}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/numth/digital-root", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"n": 9875
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.digital_root",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_digits | 1000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
How this calculator evaluates the repeated digit sum
Call the capability with a field n holding a non-negative integer, either as a JSON number within the safe integer range or as a decimal digit string for longer values up to the published digit limit. Negative inputs, non-integers, missing n, and strings that exceed the maximum digit length fail with invalid_input and are not charged.
Practical use, limits, pricing, and delivery
Each successful request is one billable item at $0.002; failed validation does not consume balance. Wire the endpoint into number-theory demos, divisibility tutorials, recreational math pages, or integer preprocessing steps where you already trust exact digit arithmetic more than approximate heuristics or opaque black-box calculators.
Integration use cases
Automated number-theory pipelines
Scripts that classify integers by digital root or measure additive persistence can call a single deterministic item-priced endpoint instead of embedding ad hoc digit loops.
Technical questions
How do I compute the digital root with this API?
Send a JSON body with non-negative integer field n to the numth.digital_root capability. The response returns digital_root, additive_persistence, and the ordered list of digit-sum steps.