Long addition calculator
Add two whole numbers the way it is done on paper, column by column with every carry shown: 456 plus 789 gives 1245, with three carries. Numbers of up to 10000 digits stay exact. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- First text
- 456
- Second text
- 789
- Sum
- 1245
- Digit count
- 4
- Carry count
- 3
- Column count
- 4
Long addition is the column method taught in every elementary classroom: write two non-negative integers one above the other, add each decimal place from the ones column, and write a carry of one into the next column whenever a place totals ten or more. This long addition calculator accepts those two addends as decimal digit strings, runs that schoolbook procedure, and returns the exact sum as a string plus the carry written in every column. Native floating-point numbers lose integer identity past nine quadrillion, so a twenty-digit homework total cannot trust a language plus operator. Failed validation is not billed.
What long addition means and how carry stays exact
Long addition, also called column addition or addition with regrouping, is the first multi-digit algorithm most children write by hand. Align the addends on the ones place, then walk leftward. In each column add the two digits that sit there and the carry that arrived from the column to the right.
If that total is less than ten, write the total as the sum digit and send a carry of zero. If the total is ten or more, write the ones digit of the total and send the tens digit — almost always one, and never more than one when only two single digits plus a previous carry of one are added, because nine plus nine plus one is nineteen. That last identity is why the schoolbook procedure never needs a carry greater than one for two addends.
The walk continues until both addends and the leftover carry are exhausted, which is why nine hundred ninety-nine plus one becomes one thousand instead of wrapping around. This long addition calculator implements exactly that walk. It does not accept a leading minus, because classroom long addition of two non-negative integers is a different search from signed arbitrary-precision addition; negatives, fractions, thousands separators, and scientific notation are rejected rather than silently reinterpreted.
It does not add matrices, polynomials, or mixed numbers. The contract is two non-negative decimal integers in and an exact digit-string sum out, together with the column-by-column carry trace a teacher would tick on a worksheet.
Where a long-addition calculator earns its keep
Classrooms and tutoring platforms use a long addition calculator so learners can check both the total and the regrouping marks for arbitrary whole numbers without dropping a carry in the tens column. Homework generators and learning-management graders need a deterministic oracle that marks a floating-point guess wrong when the item asked for an exact digit-string sum, and that never invents a carry greater than one for two addends.
Parents checking a third-grade packet want the same column identity the teacher will mark: ones, tens, hundreds, then the leftover one that creates an extra digit. Failed validation does not consume balance. You then have a reproducible classroom total for worksheets, LMS plugins, and edge workers without standing up an arithmetic service of your own.
When the search is signed big-integer addition, matrix addition, or polynomial addition, use those dedicated landings; this page stays on the elementary non-negative algorithm.
What you can do with it
Classroom and homework checks
Let students submit two whole-number addends and verify the exact digit-string sum plus the column carry marks against the textbook long-addition layout.
Exam and LMS auto-grading
Mark long-addition items with a deterministic oracle that rejects signs and decimals, and that never wraps a string of nines plus one.
Exact totals beyond native number precision
Add two non-negative digit strings that already overflow a JavaScript number or a spreadsheet cell, and keep every digit of the schoolbook sum.
FAQ
How does the long addition calculator add two whole numbers?
Send a and b as non-negative decimal digit strings.
Does long addition accept negative numbers or decimals?
No. Both addends must be non-negative integers written with digits 0-9 only.
Why is the carry never more than one?
Because each column adds only two digits and the carry from the right. The largest possible total is nine plus nine plus one, which is nineteen, so the most a column can pass on is a single 1.
How big can the numbers be?
Each number can have up to 10000 digits, and the sum stays exact. Everyday computer arithmetic starts losing whole-number accuracy past about nine quadrillion, which is why long totals are added here digit by digit.
How do I read the carries column by column?
Start from the ones. In 456 plus 789, 6 and 9 make 15: write 5 and carry 1. Then 5, 8 and the carry make 14, 4, 7 and the carry make 12, and the last carry becomes the leading 1 of 1245.
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/math/long-addition \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":"456","b":"789"}'const res = await fetch("https://api.kit.forhosting.com/math/long-addition", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": "456",
"b": "789"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/long-addition",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": "456",
"b": "789"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/long-addition", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":"456","b":"789"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":"456","b":"789"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/long-addition", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": "456",
"b": "789"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.long_addition",
"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 | 10000 |
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
Successful API calls use the published $0.002 base price.
What long addition means and how carry stays exact
Native sixty-four-bit words and IEEE-754 doubles are not part of the algorithm: every step is a finite digit operation, so a forty-digit ledger line plus another forty-digit line stays exact up to the published digit limit.
Input contract, column trace, limits, and errors
After whitespace is trimmed, leading zeros are stripped so that zero zero seven becomes seven and a string of zeros becomes a single zero. Each stripped magnitude may contain at most 10000 digits — that limit is declared and enforced so a pasted wall of digits cannot exhaust the isolate. Example: a equals four hundred fifty-six and b equals seven hundred eighty-nine yields sum one thousand two hundred forty-five, three carries, and four columns ending in a leftover one in the thousands place. Validation failures are not billed. POST a JSON object with two required fields, a and b. Each field is a non-negative decimal integer: a digit string with no sign and no decimal point, or a JSON number that is a safe non-negative integer. Empty strings, omitted fields, a leading plus or minus, thousands separators, spaces inside the digits, hexadecimal prefixes, and scientific notation fail with invalid_input naming the field. On success the body echoes the two addends in canonical form, returns sum as the exact decimal total, digit_count as the number of digits in that total, carry_count as how many columns produced a carry of one, column_count as the length of the walk, columns as the per-place record of digit_a, digit_b, carry_in, total, written digit, and carry_out, plus equation and formula strings restating sum equals a plus b. Successful API calls use the published $0.002 base price.
Where a long-addition calculator earns its keep
Finance notebooks that only need the non-negative schoolbook sum of two ledger strings can call this endpoint without pulling a signed multiprecision library. Keep each operand within the published digit limit, send values that would overflow JSON as strings rather than numbers, and pin the returned sum and carry_count in tests.
Technical questions
Why must large addends be strings instead of JSON numbers?
JSON numbers are IEEE-754 doubles. Integers larger than 9007199254740991 are not all representable, so a twenty-digit addend would already be rounded before the columns ran. Digit strings stay exact.
What does carry_count mean in the response?
It is the number of columns whose total was ten or more, so a carry of one was written into the next place. Nine hundred ninety-nine plus one has three such columns and produces a four-digit sum.
What does the long addition calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.