Expanded form calculator
The expanded form calculator takes a single number and breaks it into the sum of its place-value components, digit by digit.
Run — free
An integer like 7304 comes back as 7000 + 300 + 4, and a decimal like 204.75 comes back as 200 + 4 + 0.7 + 0.05, so every digit is shown next to the exact value it contributes. Negative numbers, very small decimals and large values are all handled, and any input that is not a finite number is rejected with a clear error instead of a wrong answer. It is the place-value exercise students meet in school, automated and exact: you send one number, you receive the ordered list of terms, the canonical expression as a string, and per-term detail showing each digit, its power of ten and its signed contribution. The same code runs free on this page and through the API.
What expanded form actually means
Every digit in a number owes its value to two things: the digit itself and the position it sits in. The 7 in 7304 is not seven, it is seven thousand, because it occupies the thousands place. Expanded form is simply the habit of writing that out loud: you decompose the number into one term per non-zero digit, where each term is the digit multiplied by its power of ten, and you add the terms together. It is one of the first formal ideas in arithmetic because it explains why our number system works at all — ten symbols and a positional rule can write any quantity. This endpoint performs that decomposition exactly, including across the decimal point, where places become tenths, hundredths and thousandths. A digit of 5 in the second decimal place of 204.75 contributes 0.05, and the response says so explicitly. The result always reconstructs the original number when the terms are summed, so the output doubles as a check on itself: if the terms do not add back to the input, something upstream went wrong.
How the expansion is computed
The input is validated first: it must be a finite number, and numeric strings such as "-204.75" are accepted for convenience, while text, null and non-finite values are rejected with an invalid-input error that is never charged. The validated number is then converted to a plain decimal string — exponential notation is unrolled by hand — so that even very large or very small finite values are decomposed digit by digit without floating-point drift. Each digit is paired with its place, defined as the power of ten it occupies relative to the decimal point, and zero digits are skipped because they contribute nothing. Terms are built as exact decimal strings and only then turned into numbers, and the signed terms, the canonical expression and the per-term detail are returned together. The computation is fully deterministic: no network, no randomness, no clock, so the same input always produces byte-identical output, which is what makes the free browser version and the paid API version agree exactly.
Where it fits in practice
Teachers and tutoring platforms use expanded form to generate exercises and to check student answers automatically: instead of comparing free text, they compare the structured term list. Educational apps use the per-term detail to render interactive breakdowns, colouring each digit by its place as the student explores a number. Content pipelines use it to produce worked examples at scale, because one call yields both the machine-readable terms and the printable expression. Beyond education, the decomposition is a handy debugging view anywhere a quantity must be explained to a human — finance dashboards, scientific readouts and reports all benefit from showing which orders of magnitude dominate a figure. The endpoint runs on our edge, keeps nothing after the call, and is priced at $0.002 per request, with the same logic available free in the browser on this page for interactive use, so you only pay when you automate it in a script, a backend or a batch job that processes many numbers.
What you can do with it
Generate place-value exercises
Produce expanded-form questions and answer keys for a worksheet or tutoring app from a list of numbers, in one call per number.
Check student answers automatically
Compare a submitted decomposition against the structured term list instead of parsing free-text sums by hand.
Explain a figure in a report
Show which orders of magnitude dominate a quantity by rendering its place-value breakdown next to the number.
FAQ
What does it cost?
$0.002 per request via the API. It is also free to use in your browser on this page.
What input is accepted?
Any finite number, passed as a number or as a numeric string such as "-204.75". Anything else returns an invalid-input error and is not charged.
Are decimals supported?
Yes. Fractional digits expand into fractional place values: 204.75 becomes 200 + 4 + 0.7 + 0.05.
What happens with negative numbers?
The magnitude is expanded and the sign is applied to the whole expression: -204.75 becomes -(200 + 4 + 0.7 + 0.05), and each returned term is signed.
What exactly is returned?
The original number, the ordered list of signed terms, the canonical expanded-form expression as a string, and per-term detail with each digit, its power of ten and its contribution.
Is the result deterministic?
Yes. The algorithm uses no network, no randomness and no clock, so the same input always yields byte-identical output.
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/math/expanded-form \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"number":7304.5}'const res = await fetch("https://api.kit.forhosting.com/math/expanded-form", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"number": 7304.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/expanded-form",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"number": 7304.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/expanded-form", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"number":7304.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"number":7304.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/expanded-form", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"number": 7304.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.expanded_form",
"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.
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. |