gizmobench

Long Multiplication Calculator

Type two numbers and the stage writes the multiplication out the way it is done on paper: both points set aside, the digit strings multiplied, one partial product for every digit of the bottom number with its carries above it, then the addition and the line that puts the point back. 12.3 x 4.5 is worked as 123 x 45 = 5535, and because 12.3 has one decimal place and 4.5 has one, the rule reads 1 + 1 = 2 and the product is 55.35. The arithmetic runs on the digit strings themselves rather than on JavaScript numbers, so nothing is rounded: 0.1 x 0.2 comes back as exactly 0.02, and 999 x 999 shows its whole carry chain above 998,001. Up to 200 digits in each box, negative signs and thousands separators included.

12.3 x 4.5Exact200 digit cap
       1  2  3      from 12.3
x         4  5      from 4.5
  ------------
       1  1         carries
       6  1  5      123 x 5
       1            carries
    4  9  2         123 x 4, shifted one place
  ------------
    1               carries
    5  5  3  5

integers         123 x 45 = 5535
decimal places   1 + 1 = 2
product          55.35
Product
55.35
Partial products
2
Decimal places
1 + 1 = 2
Digits
4

2 partial products to write, 4 carries in all, and the point put back 2 places from the right.

The two numbers

Signs, decimal points and thousands separators are all fine: 1,234 and 1234 are read the same way. Up to 200 digits in each box.

The bottom number decides how much writing there is: one partial product per digit of it. 12.3 x 4.5 comes to 2 rows, and 4.5 x 12.3 comes to 3 rows for the same product, which is why the shorter number usually goes second.

Worked examples

Each one runs through the same function as your own numbers. Copy takes the expression and its product.

  • 12.3 x 4.5two partial products
    55.35
  • 999 x 999a long carry chain
    998,001
  • 0.02 x 0.5leading zeros
    0.01
Accuracy. Exact decimal arithmetic on the digit strings you type, up to 200 digits each. The integers are multiplied column by column and the point is placed by adding the two operands' decimal places, so nothing is rounded and no floating-point error can creep in. Every partial product and every carry is shown, in the order you would write them by hand.

Common questions

How do you do long multiplication with decimals?
Set both decimal points aside, multiply the digit strings as whole numbers, then put one point back with as many decimal places as the two numbers had between them. 12.3 x 4.5 is worked as 123 x 45 = 5535, and since each number had one decimal place the rule reads 1 + 1 = 2, so the product is 55.35. The stage shows every step of that: the row 123 x 5 giving 615, the row 123 x 4 shifted one place giving 492, the carries above each of them, the addition, and the line where the point goes back.
Where does the decimal point go in long multiplication?
Add the decimal places of the two numbers you multiplied, and that total is how many digits sit after the point in the product. It is a count, not a judgement, which is why this page prints the sum itself: 0.02 x 0.5 reads 2 + 1 = 3. Two times five is 10, three places along makes 0.010, and the working shows that placed form on its own line beside the tidied 0.01, so you watch the trailing zero being dropped rather than wonder where it went.
What is a partial product?
One row of the working: the top number multiplied by a single digit of the bottom one, then shifted left by that digit's place. There is one row per digit of the bottom number, so 12.3 x 4.5 writes 2 rows and 999 x 999 writes 3, and the count sits in the readout under the stage. A zero digit gets its row too, printed as 123 x 0 with a single 0 in it, because quietly leaving it out is how a column goes missing.
Does this calculator round the answer?
No, and it has nothing to round. Every value is a digit string and every step is integer arithmetic on digits between 0 and 9, so no floating-point number is ever created. That matters more than it sounds: a browser asked for 0.1 * 0.2 in its own arithmetic answers 0.020000000000000004, while this page multiplies 1 by 2 and moves the point two places to give exactly 0.02. The same holds at the other end, where two 200 digit numbers produce a product of up to 400 digits with every digit correct.
How many digits can this multiply?
Up to 200 in each box, the decimal point and the minus sign aside. Past that the page says how many digits it counted and asks you to shorten the number or split the multiplication, rather than quietly working on a different one. Two 200 digit numbers still multiply exactly, and the working is then 200 rows long, which is the real reason for the cap: the written layout stops being readable well before the arithmetic struggles.
Can it multiply negative numbers?
Yes. The columns work on the digits alone, so the sign is settled separately and stated in the working: one negative sign makes the product negative, two negative signs make it positive. So -12.3 x 4.5 produces the same 5535 in the columns and comes out as -55.35. A product of zero never carries a sign, which is why -5 x 0 is written as 0 and not as a negative zero.
Why does swapping the two numbers change the working?
Because the rows come from the bottom number, one per digit of it. 12.3 x 4.5 comes to 2 rows and 4.5 x 12.3 comes to 3 rows, for the same product of 55.35. On paper you put the number with fewer digits on the bottom so there is less to write and fewer carries to keep track of, and the Swap button here turns one order into the other in a single press.
Can I paste a number with commas in it?
Yes. Commas, spaces and underscores are read as thousands separators and removed before anything is multiplied, so 1,234 and 1234 are the same number here. Exponent notation is the one form turned away: 1e5 is refused with a message asking for 100000 written out in full, because the digits you can see in the columns are the whole point of the page.

Exact decimal arithmetic on the digit strings you type, up to 200 digits each. The integers are multiplied column by column and the point is placed by adding the two operands' decimal places, so nothing is rounded and no floating-point error can creep in. Every partial product and every carry is shown, in the order you would write them by hand.