ForHosting KIT · Math

Long multiplication calculator

Multiply two whole numbers the schoolbook way and see every partial product: 123 times 45 gives the rows 615 and 4920, which add up to 5535. Numbers of up to 256 digits stay exact. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Multiplicand
123
Multiplier
45
You get
Product
5535
Partial count
2

Long multiplication is the column method taught in every arithmetic course: write two whole numbers, multiply the top number by each digit of the bottom number from right to left, shift each partial product one extra place to the left, and add those rows to obtain the product. This calculator takes the multiplicand and the multiplier as decimal strings so the operands can be far larger than a native integer type, then applies that exact schoolbook walk and returns both the product and every partial product as strings. Leading zeros are stripped.

What long multiplication is and how partial products work

Long multiplication is the written algorithm that produces the product of two non-negative whole numbers one decimal digit at a time. You write the multiplicand above the multiplier, lining up the ones, tens, hundreds, and every higher place. Starting at the ones digit of the multiplier you multiply the entire multiplicand by that single digit, carrying tens into the next column exactly as you would in a one-digit times-table problem.

That row is a partial product. Then you move one digit left in the multiplier, multiply the multiplicand again, and write the new partial product shifted one extra place to the left because that digit is worth ten times as much. Each further digit of the multiplier shifts its row one more place.

After every digit of the multiplier has produced a row, you add the partial products column by column, carrying when a column sums to ten or more, and the sum is the product of the original numbers. A zero digit in the multiplier produces a zero row; you still record it so the place of every later row stays honest. The method is deterministic, works for any length of decimal string, and is the same procedure printed in elementary textbooks.

This calculator implements that walk on digit characters rather than on a language-native integer, so a number with dozens or hundreds of digits is handled the same way a two-digit classroom example is handled. The response lists every partial product with the multiplier digit and the place — the power of ten — that produced it, which is useful when you are checking a student's tableau column by column instead of only comparing the final answer.

Input contract, the digit walk, and error behaviour

Each field is a decimal digit string; leading zeros are allowed and then stripped so that seven and zero-zero-seven compare as the same number. After both operands are canonicalized the engine walks the multiplier from the ones place to the highest place. For each digit it multiplies the multiplicand by that digit, appends as many zeros as the current place, stores that row as a partial product, and adds the row into a running total.

A zero digit still emits a zero partial so the array length always equals the number of digits in the canonical multiplier. Example: one hundred twenty-three times forty-five yields unshifted six hundred fifteen and four hundred ninety-two, partials six hundred fifteen and four thousand nine hundred twenty, and product five thousand five hundred thirty-five.

Where long multiplication comes in handy

Classrooms and tutoring platforms use a long multiplication calculator so learners can check a handwritten column layout without a teacher redoing every carry and every shifted row by hand. Exam-prep generators and learning-management systems need a deterministic oracle that marks a negative or non-integer operand as invalid rather than silently rounding a decimal or dropping a sign a buggy grader might treat as success.

Accounting and inventory scripts that already store quantities as decimal strings — invoice line totals, pack counts, serial tallies — can multiply without converting through a floating-point type that would round past fifteen significant digits. Failed validation does not consume balance. Keep each operand within the published digit ceiling, pin the returned product string and the partial-product array in tests, and you get reproducible exact multiplication for homework, LMS plugins, and edge workers without standing up a computer-algebra system or a big-integer library of your own.

Classroom and homework checks

Let students submit a multiplicand and a multiplier and verify the exact product plus every shifted partial product, matching the paper algorithm.

Exact string arithmetic in scripts

Multiply inventory counts, invoice quantities, or other decimal-string values that may exceed the safe integer limit without floating-point rounding.

How do I multiply two whole numbers with this long multiplication calculator?

Send the multiplicand and the multiplier as decimal digit strings.

How large can the numbers be?

Each operand may have at most 256 decimal digits. Send values as strings so digits past the language's safe integer limit stay exact; leading zeros are stripped before the multiplication.

What is a partial product?

It is the whole multiplicand multiplied by one digit of the multiplier and shifted left by that digit's place. Adding every partial product column by column gives the final answer, and each row is listed so you can check it.

What happens when the multiplier has a zero digit?

That digit produces a row of zeros. It is still recorded, so every later row keeps its correct place and the column addition at the end lines up properly.

What happens if a number is negative or has a decimal point?

It is refused with a message naming the problem. Long multiplication here works on non-negative whole numbers only, so minus signs, decimal points, thousands separators and letters are never rounded or guessed.

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.

POSThttps://api.kit.forhosting.com/math/long-multiplication

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.

curl -X POST https://api.kit.forhosting.com/math/long-multiplication \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"multiplicand":"123","multiplier":"45"}'
{
  "multiplicand": "123",
  "multiplier": "45"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.long_multiplication",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_digits256
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

If either input is not a non-negative integer the request fails with invalid_input instead of rounding or inventing a result.

Input contract, the digit walk, and error behaviour

POST a JSON body with two required fields: multiplicand, the non-negative integer being multiplied, and multiplier, the non-negative integer you multiply by. Numeric JSON integers and numeric strings are accepted for convenience, but values that must stay exact past the fifty-three-bit safe-integer limit should always be sent as strings. Missing fields, empty strings, minus signs, decimal points, thousands separators, letters, and strings longer than two hundred fifty-six digits all fail with invalid_input naming the field, and those failures are not billed. On success the body returns multiplicand, multiplier, product, partial_count, and partial_products, where each entry has digit, place, unshifted (the product before the place shift) and partial (the addend actually summed).

Exam and LMS auto-grading

Mark long-multiplication items with a deterministic oracle that rejects a negative or non-integer operand as invalid_input and never rounds a decimal in silence.

What happens if an input is negative or not a whole number?

The task fails with invalid_input. This calculator covers non-negative integers only, so a minus sign, a decimal point, or any non-digit character is rejected, and the failed call is not billed.

Does the calculator show the partial products from each digit?

Yes. The response includes partial_products, one entry per digit of the multiplier, with the digit, its place (0 for ones, 1 for tens, and so on), the unshifted row, and the shifted partial that is added. partial_count is the length of that array.

What does the long multiplication calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →