Skip to main content
CalcMax

Long Division Calculator

Range: 0 – 1,000,000,000

Range: 1 – 1,000,000,000

Result

102

Quotient

Remainder
10
Step by step
1 / 12 = 0 r 1; 12 / 12 = 1 r 0; 3 / 12 = 0 r 3; 34 / 12 = 2 r 10
Check
12 * 102 + 10 = 1234

Long division is the written method for dividing one whole number by another when the answer does not come out evenly, and this page prints every step of it. For 1234 ÷ 12 the working is four lines. Divide 1 by 12: too small, so the quotient digit is 0 and the remainder is 1. Bring the next digit down to make 12, divide by 12: the digit is 1 and the remainder is 0. Bring down the 3 to make 3, divide by 12: the digit is 0 and the remainder is 3. Bring down the 4 to make 34, divide by 12: the digit is 2 and the remainder is 10. The quotient digits in order are 1, 0, 2 — so 1234 ÷ 12 is 102 remainder 10, and the last remainder, 10, is the one that stays. Every line of the algorithm has the same shape: take the value built so far, find how many whole times the divisor goes into it, record that count as one digit of the answer, and keep what is left over to be combined with the next digit. That is why the quotient always ends up with the same number of digits as the dividend, and why a zero can be a perfectly good digit of the answer — the 0 in the middle of 102 is doing real work. The remainder here is always the non-negative one, the convention where 0 is the smallest value it can take. For negative numbers the two conventions give different answers, and that case belongs on the remainder page. The last output is the check: divisor times quotient plus remainder equals dividend, which is not a separate computation but the definition of what a quotient and remainder mean. 12 × 102 + 10 is 1234, so the three numbers are consistent with each other. Two special cases come up. A dividend smaller than the divisor gives a quotient of 0 and a remainder equal to the dividend, since the divisor does not fit even once. And a divisor of 1 gives a quotient equal to the dividend with a remainder of 0, with one line per digit. The digits of the quotient are also where decimal expansions come from: when the working starts to repeat, as it does at 1 ÷ 7, the decimals repeat with it.

5432 ÷ 17 written out, one column per part of a step

stepvaluedivisordigitremainder
151705
2541733
33317116
41621799

Read across a row and you have one line of the working: the value being divided, the divisor it is compared against, the quotient digit produced, and what is left. The first row is 5 against 17, which is 0 times with 5 left, so the digit is 0. The next row takes the 4 down, making 54, and 54 ÷ 17 is 3 with 3 left. The pattern to notice is in the value column: each entry is the previous remainder with one more digit of the dividend appended, which is what bringing a digit down means, and it is the only thing that carries from one row to the next. The digit column collects into the answer, 0 3 1 9, which is 319, and the remainder column's last entry, 9, is the remainder of the whole division. Run the check on it: 17 × 319 + 9 = 5432. Notice that the leading 0 in the digit column is dropped from the answer and the middle 0 would not be — a zero digit means the divisor did not fit into that step's value, which is information, whereas a leading zero is just not written. The table is fixed at 5432 ÷ 17 and does not follow what you typed; the panel above does the same four columns for your numbers, one row per digit.

Formula

1234 ÷ 12 → 1/12 = 0 r 1; 12/12 = 1 r 0; 3/12 = 0 r 3; 34/12 = 2 r 10 ⇒ quotient 102, remainder 10, and 12 × 102 + 10 = 1234

1234
The dividend, the number being divided, a whole number from 0 to 1000000000. Zero is allowed and gives a quotient and remainder of 0. Negative numbers and decimals are refused, because the written algorithm below assumes digits and this page does not state a sign convention
12
The divisor, the number dividing it, a whole number from 1 to 1000000000. It cannot be 0: nothing can be divided into zero parts, and no quotient would satisfy the check. It may be larger than the dividend, in which case the quotient is 0 and the remainder is the dividend itself
1, 2, 3, 4
The digits of the dividend, taken one at a time from the left. Each step adds the next one to the remainder of the step before, which is what bringing a digit down means. The number of steps equals the number of digits in the dividend, so 1234 takes four steps and 1000000000 takes ten
0, 1, 0, 2
The quotient digit produced at each step: how many whole times the divisor fits into that step's value. A step whose value is smaller than the divisor contributes the digit 0, and those zeros are part of the answer — 102 has one in the middle, and dropping it would give 12
1, 0, 3, 10
The remainder left at each step, always the non-negative one. The last of them is the remainder of the whole division; the earlier ones are intermediate and disappear once the next digit is brought down. Nothing here is ever negative, which is why negative dividends belong on the remainder conventions page
dividend = divisor × quotient + remainder
The check output, and the definition of the whole operation rather than an extra result: for 1234 ÷ 12 it reads 12 × 102 + 10 = 1234. If that line is true, the quotient and remainder are correct by definition, and if it is false nothing else on the page can be trusted

This is the written method itself, so the people who need it are learning it. The step string is the working that would otherwise be shown on paper, and it is worth comparing against your own line by line when an answer disagrees — the place the two diverge is the mistake, which is more useful than being told the right number. The check line is the other half of that: divisor times quotient plus remainder equals dividend, and a reader who has the quotient and remainder can confirm them without redoing the long division at all. Beyond coursework the same decomposition is how division is handled whenever whole numbers cannot be split — 1234 items into groups of 12 gives 102 full groups with 10 left over, and the remainder is the part that cannot be distributed. A remainder of 0 means the division came out evenly. The algorithm is also where decimal expansions come from: carrying the working past the decimal point with a remainder of zero appended produces the decimals of the quotient, and when a remainder repeats, so does the decimal — 1 ÷ 7 cycles through the same six remainders forever, which is why 1/7 has a repeating six-digit pattern. Programming languages have two common ways to handle a negative dividend, truncation and flooring, and they disagree; the non-negative remainder printed here is the flooring one, and the remainder page shows both side by side.

Worked examples

  1. 1234 ÷ 12, the default

    1. Bring down the 1: 1 ÷ 12 goes 0 times, so the first quotient digit is 0 and 1 is left over
    2. Bring down the 2: the value is 12, and 12 ÷ 12 goes 1 time with nothing left over
    3. Bring down the 3: the value is 3, and 3 ÷ 12 goes 0 times, leaving 3
    4. Bring down the 4: the value is 34, and 34 ÷ 12 goes 2 times with 10 left over
    5. The quotient digits in order are 0, 1, 0, 2 — written without the leading zero that is 102
    6. The final remainder is 10, and the check confirms it: 12 × 102 + 10 = 1234

    The default, and the one that shows why zeros in the quotient matter. The third step contributes a 0 because 3 is smaller than 12, and that digit is not decoration — the answer is 102 and not 12. The leading 0 from the first step is dropped, since 102 and 0102 are the same number written differently. The check line is worth reading as a sentence: the divisor times the answer plus what was left over gives back the number you started with.

  2. 5432 ÷ 17, the reference table's example

    1. Bring down the 5: 5 ÷ 17 goes 0 times, leaving 5
    2. Bring down the 4: the value is 54, and 54 ÷ 17 goes 3 times (3 × 17 = 51) leaving 3
    3. Bring down the 3: the value is 33, and 33 ÷ 17 goes 1 time (17) leaving 16
    4. Bring down the 2: the value is 162, and 162 ÷ 17 goes 9 times (9 × 17 = 153) leaving 9
    5. The quotient digits are 0, 3, 1, 9, which is 319, and the remainder is 9

    The four lines the table below lays out one column at a time, and the reason it is worth reading both: each step multiplies the divisor back out to find the largest product that still fits — 3 × 17 = 51 against 54, then 1 × 17 = 17 against 33, then 9 × 17 = 153 against 162 — and the remainder is the gap. The gaps here are 3, 16 and 9, all smaller than the divisor 17, which is the invariant that makes each quotient digit the largest one that works.

  3. A repeating remainder: 1000000000 ÷ 7

    1. Bring down the 1: 1 ÷ 7 goes 0 times, leaving 1
    2. Bring down each 0 in turn, giving 10, 30, 20, 60, 40, 50, then 10 again
    3. The quotient digits are 1, 4, 2, 8, 5, 7 and then 1, 4, 2, 8 repeating
    4. After the seventh step the remainder returns to 1, so the whole cycle starts over
    5. The quotient is 142857142 and the final remainder is 6

    The remainders here run 1, 3, 2, 6, 4, 5 and then back to 1 — the cycle of 1/7, which is why the quotient digits repeat as 142857. That repetition is not a quirk of this dividend: whenever a remainder repeats, everything after it repeats too, since the next step depends only on the value brought down. It is also the reason a fraction in decimal form either terminates or repeats, and why 1/7 has a repeating block of six digits.

  4. When the divisor is larger than the dividend: 7 ÷ 999999999

    1. There is one digit to bring down, the 7
    2. 7 ÷ 999999999 goes 0 times, since 999999999 is far larger than 7
    3. The quotient digit is 0 and the whole dividend is left over
    4. The quotient is 0 and the remainder is 7

    A quotient of 0 is a real answer and not a failure. When the divisor does not fit even once, nothing is taken away, so the remainder is the entire dividend and the check reads 999999999 × 0 + 7 = 7. The step list is a single line because the dividend has a single digit — the number of steps always equals the number of digits being divided, never the size of the divisor.

Limitations

Both numbers must be whole numbers. The dividend runs from 0 to 1000000000 inclusive, and the divisor from 1 to 1000000000 inclusive. A divisor of 0 is refused: there is no number that, multiplied by 0, gives back a non-zero dividend, so no quotient and remainder could satisfy the check. Negative numbers are refused rather than handled with a sign rule, because the written algorithm shown here works on digits and the two conventions for negative division disagree — this page prints the non-negative remainder, and the case where that matters belongs on the remainder page, which shows both conventions side by side. Decimals are refused: the algorithm can be extended past a decimal point by appending zeros, but that is a different procedure and this page does not do it, though the repeating remainders above are where those decimals come from. Zero as a dividend is accepted and gives a quotient of 0 with a remainder of 0. The step list has one line per digit of the dividend, so a ten-digit dividend produces ten lines and the panel is long by design — that is the working, not a summary of it. The reference table below is fixed at 5432 ÷ 17 and does not follow your input; the panel above answers your numbers, and the table is there to show what each column of a step means. Every value is exact and nothing is rounded.

Frequently asked questions

How do I do long division step by step?
Work from the left of the dividend, one digit at a time. Divide the value built so far by the divisor, write down how many whole times it fits as the next digit of the answer, and keep the leftover. Then bring the next digit down — append it to the leftover — and repeat until the digits run out. For 1234 ÷ 12 that gives 0, 1, 0, 2 as the digits and a final remainder of 10, so the answer is 102 remainder 10.
What is the difference between the quotient and the remainder?
The quotient is how many whole times the divisor fits into the dividend, and the remainder is what is left over when it no longer fits. They are tied together by the definition: dividend equals divisor times quotient plus remainder. For 1234 ÷ 12 the quotient is 102 and the remainder is 10, and 12 × 102 + 10 gives back 1234. The remainder is always smaller than the divisor, which is what makes the quotient the largest whole number that works.
Why is the remainder never negative here?
Because this page uses the convention where the remainder is the non-negative one — the largest multiple of the divisor that does not exceed the dividend is subtracted, and what is left is between 0 and the divisor. Programming languages often truncate instead, which can leave a negative remainder: dividing −1 by 2 gives a remainder of −1 under truncation and 1 under this convention. The remainder page shows both side by side. Negative dividends are refused here rather than handled with one silent choice.
Can the answer have a zero in it?
Yes, and the zero is part of the answer. A zero digit appears whenever the value at that step is smaller than the divisor, so 1234 ÷ 12 produces the digits 0, 1, 0, 2 — the middle zero cannot be dropped, since 102 and 12 are different numbers. Only a leading zero is omitted, because 0102 and 102 are the same number.
What happens when the dividend is smaller than the divisor?
The quotient is 0 and the remainder is the whole dividend. 7 ÷ 999999999 goes 0 times, so nothing is subtracted and all of the 7 is left over; the check reads 999999999 × 0 + 7 = 7. The step list has one line, because the number of steps always equals the number of digits in the dividend rather than anything about the divisor.
Why do the remainders start repeating?
Because each step depends only on the value brought into it, so once a remainder comes back the whole sequence after it repeats. Dividing 1000000000 by 7 produces the remainders 1, 3, 2, 6, 4, 5 and then 1 again, so the quotient digits repeat as 142857. This is where repeating decimals come from: carrying the same working past a decimal point with zeros appended turns that cycle into the repeating block of 1/7.

References

Related calculators