Skip to main content
ponderloop

Long Division Calculator

1234 ÷ 7 = 176 remainder 2, which is 176.(285714) as a decimal: the digits 285714 repeat for ever. Long division finds this one digit at a time by dividing, multiplying and subtracting, then bringing the next digit down. This calculator shows every step in a table and in the classic bracket layout, marks the repeating block of the decimal, and also handles decimals and negative numbers. It uses exact whole-number arithmetic, never floating point, for numbers of up to 30 digits.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

Whole numbers or decimals, up to 30 digits each. Negative numbers work too; the working uses their sizes.

1234 ÷ 7 = 176 remainder 2

The decimal repeats: the block 285714 (6 digits) starts right after the decimal point.

Quotient (whole number)
176
Remainder
2
Decimal expansion
176.(285714)
Repeating block
285714 (6 digits long)
Rounded to 4 decimal places
176.2857
As a fraction
1234/7
As a mixed number
176 2/7
Check
7 × 176 + 2 = 1234

The working

The classic layout, then the same working as a table you can read row by row.

     176.285714
  ┌────────────
7 │ 1234.000000
     7
    ──
     53
     49
     ──
      44
      42
      ──
       2 0
       1 4
       ─ ─
         60
         56
         ──
          40
          35
          ──
           50
           49
           ──
            10
             7
            ──
             30
             28
             ──
              2

The remainder 2 is the same as the one left after step 3, so the same digits come round again: the block repeats for ever.

Step by step: bring down, divide, multiply, subtract
StepBring downNumberDigit of the quotientMultiplySubtract
11, 21211 × 7 = 712 − 7 = 5
235377 × 7 = 4953 − 49 = 4
344466 × 7 = 4244 − 42 = 2
40 (after writing “.” in the quotient)202 (repeating)2 × 7 = 1420 − 14 = 6
50608 (repeating)8 × 7 = 5660 − 56 = 4
60405 (repeating)5 × 7 = 3540 − 35 = 5
70507 (repeating)7 × 7 = 4950 − 49 = 1
80101 (repeating)1 × 7 = 710 − 7 = 3
90304 (repeating)4 × 7 = 2830 − 28 = 2

Repeating decimals of 1/n for n = 2 to 30

Each row is the calculator’s own answer for 1 ÷ n. The repeating block is in brackets; the period is its length.
n1/n as a decimalRepeating blockPeriod lengthKind
20.5None0Ends
30.(3)31Repeats from the first place
40.25None0Ends
50.2None0Ends
60.1(6)61Repeats after a lead-in
70.(142857)1428576Repeats from the first place
80.125None0Ends
90.(1)11Repeats from the first place
100.1None0Ends
110.(09)092Repeats from the first place
120.08(3)31Repeats after a lead-in
130.(076923)0769236Repeats from the first place
140.0(714285)7142856Repeats after a lead-in
150.0(6)61Repeats after a lead-in
160.0625None0Ends
170.(0588235294117647)058823529411764716Repeats from the first place
180.0(5)51Repeats after a lead-in
190.(052631578947368421)05263157894736842118Repeats from the first place
200.05None0Ends
210.(047619)0476196Repeats from the first place
220.0(45)452Repeats after a lead-in
230.(0434782608695652173913)043478260869565217391322Repeats from the first place
240.041(6)61Repeats after a lead-in
250.04None0Ends
260.0(384615)3846156Repeats after a lead-in
270.(037)0373Repeats from the first place
280.03(571428)5714286Repeats after a lead-in
290.(0344827586206896551724137931)034482758620689655172413793128Repeats from the first place
300.0(3)31Repeats after a lead-in

Division facts: worked examples

Each row is the calculator’s own answer for the dividend and divisor in the first two columns.
DividendDivisorQuotientRemainderDecimal
123471762176.(285714)
100812412.5
17010.(142857)
227313.(142857)
103313.(3)
3551133163.(1415929203539823008849557522123893805309734513274336283185840707964601769911504424778761061946902654867256637168)
12.50.4310.131.25
112010.08(3)
181010.(012345679)
1441212012
59050.(5)
−175−3−2−3.4

Divisibility rules from 2 to 12

A quick test for whether a division leaves a remainder of 0. The last column is the calculator dividing the example number.
DivisorRuleExampleWhat the rule looks atDivision
2The last digit is 0, 2, 4, 6 or 8.1358last digit 81358 ÷ 2 = 679 remainder 0
3The digits add up to a multiple of 3.4521digit sum 4 + 5 + 2 + 1 = 124521 ÷ 3 = 1507 remainder 0
4The last two digits make a multiple of 4.31724last two digits 24, and 24 ÷ 4 = 631724 ÷ 4 = 7931 remainder 0
5The last digit is 0 or 5.7865last digit 57865 ÷ 5 = 1573 remainder 0
6The number is divisible by both 2 and 3.4518last digit 8 and digit sum 184518 ÷ 6 = 753 remainder 0
7Remove the last digit and subtract double it from what is left; the result is 0 or a multiple of 7 (repeat if needed).2639263 − 2 × 9 = 245, and 245 = 7 × 352639 ÷ 7 = 377 remainder 0
8The last three digits make a multiple of 8.7416last three digits 416, and 416 ÷ 8 = 527416 ÷ 8 = 927 remainder 0
9The digits add up to a multiple of 9.7164digit sum 7 + 1 + 6 + 4 = 187164 ÷ 9 = 796 remainder 0
10The last digit is 0.3470last digit 03470 ÷ 10 = 347 remainder 0
11Add and subtract the digits alternately, from the right; the result is 0 or a multiple of 11.9185alternating sum + 5 − 8 + 1 − 9 = −119185 ÷ 11 = 835 remainder 0
12The number is divisible by both 3 and 4.3576digit sum 21 and last two digits 763576 ÷ 12 = 298 remainder 0

How to do long division

  1. Set up the division. Write the dividend (1234) inside the bracket and the divisor (7) outside it to the left. If either number has a decimal point, move the point the same number of places in both until both are whole numbers.
  2. Take enough digits. Start from the left and take the fewest digits that make a number at least as big as the divisor: 12 here, because the first digit alone is smaller than 7.
  3. Divide, multiply, subtract. 7 goes into 12 1 time, so write 1 above the last digit you used. Multiply (1 × 7 = 7), then subtract (12 − 7 = 5).
  4. Bring down the next digit. Bring the next digit down next to the remainder to make 53, and repeat: 7 × 7 = 49, then 53 − 49 = 4. The next step gives 44: 6 × 7 = 42, then 44 − 42 = 2.
  5. Read off the quotient and remainder. When every digit has been brought down, the digits you wrote are the quotient (176) and what is left is the remainder (2). Check it: 7 × 176 + 2 = 1234.
  6. Carry on past the decimal point if you want a decimal. Write a decimal point in the quotient, bring down a 0 next to the remainder and keep going: 20 gives 2 × 7 = 14. The division ends when the remainder is 0 and repeats once a remainder comes round again: 176.(285714).

Frequently asked questions

How does long division work?
Long division splits one big division into small ones, one digit at a time. For each step you divide the current number by the divisor to get a quotient digit, multiply that digit by the divisor, subtract the product, and bring down the next digit of the dividend. For 1234 ÷ 7: 12 ÷ 7 gives 1, leaving 5; bring down the 3 to get 53, which gives 7; and so on, ending with the quotient 176 and the remainder 2. The calculator writes out each of these steps in a table and in the classic layout.
What is the difference between a remainder and a decimal?
They are two ways to finish the same division. A remainder stops at whole numbers and says what is left over: 1234 ÷ 7 = 176 remainder 2, or 176 2/7 as a mixed number. A decimal carries on past the decimal point by bringing down zeros: 176.(285714), which is about 176.2857 to 4 places. Use a remainder when the things being shared cannot be split, such as people or boxes, and a decimal for measurements and money.
Why do some decimals repeat?
Every step of long division leaves a remainder smaller than the divisor, so there are only so many remainders to leave. Once a remainder comes round for the second time, the digits that follow are the same as the first time, and so on for ever. For 1 ÷ 7 the remainders are 1, 3, 2, 6, 4, 5 and then 1 again, so the block 142857 repeats: 0.(142857). A remainder of 0 ends the decimal instead, as in 1 ÷ 8 = 0.125.
Which fractions end and which repeat?
Write the fraction in lowest terms. If its denominator has no prime factors other than 2 and 5, the decimal ends; otherwise it repeats. Among 1/n for n = 2 to 30, the decimals that end are for n = 2, 4, 5, 8, 10, 16, 20, 25. All the others repeat, such as 1/6 = 0.1(6), where a lead-in of 1 digit comes before the repeating block, because 6 has a factor of 2 as well as a factor of 3. The reference table above lists every case.
How long can the repeating block be?
At most one digit fewer than the divisor, because that is how many non-zero remainders there are. Among 1/n for n up to 30 the longest block is 28 digits, for n = 29. Primes whose block is the longest possible, p − 1 digits, are called full reptend primes; below 30 they are 7, 17, 19, 23, 29. A longer example is 1/97, whose block is 96 digits long. The calculator follows a decimal for up to 200 places and says so when a block is longer than that.
How do I divide decimals with long division?
Move the decimal point the same number of places to the right in both numbers until both are whole, then divide as usual: the quotient does not change. For 12.5 ÷ 0.4 move the point one place to get 125 ÷ 4, which is 31.25. The calculator does this scaling for you and says how many places it moved. Its remainder is in the units of your original numbers: 0.1 here, because 0.4 × 31 + 0.1 = 12.5.
How do I check a long division answer?
Multiply the divisor by the quotient and add the remainder; you should get the dividend back. For this example: 7 × 176 + 2 = 1234. For a division with no remainder, such as 144 ÷ 12, the check is just divisor × quotient: 12 × 12 = 144.
How can I tell if a number divides exactly, without dividing?
Use a divisibility rule. A number is divisible by 3 when its digits add up to a multiple of 3: 4521 has digit sum 12, and the calculator confirms 4521 ÷ 3 = 1507 remainder 0. By contrast 4522 has digit sum 13, and 4522 ÷ 3 leaves remainder 1. The divisibility table above gives a rule and a worked example for each divisor from 2 to 12.
What happens with negative numbers, zero and division by zero?
The working uses the sizes of the numbers. The quotient is negative when exactly one of the two numbers is, and the remainder takes the sign of the dividend, so −17 ÷ 5 = −3 remainder −2. Zero divided by any non-zero number is 0. Dividing by zero is undefined, because no number multiplied by 0 gives anything but 0, so the calculator says so instead of showing a result.
How do I turn a repeating decimal back into a fraction?
Put the repeating block over as many nines as it has digits and reduce. For 0.(142857) the block 142857 has 6 digits, so it is 142857/999999, and dividing top and bottom by 142857 gives 1/7. The decimal to fraction calculator does this for any decimal; this calculator also shows the fraction, in lowest terms, of the division you typed.
What are the limits of this calculator?
Each number can have up to 30 digits including those after the decimal point. The decimal expansion is followed for up to 200 places, which is enough to show where any decimal that ends stops, and the step-by-step working shows up to 50 decimal places. If a repeating block is longer than 200 digits, the calculator says so and shows the digits it found. Because the arithmetic is exact, there is no rounding error in any digit.
Is anything I type sent anywhere?
No. The numbers are used only in your browser to work out the result and are not sent anywhere.

How it works

Both numbers are read as exact decimals (digits and the position of the point, never as binary floats) with at most 30 digits each, then multiplied by the same power of ten so that both become whole numbers A (the dividend) and B (the divisor); this does not change the quotient. The quotient q and remainder r are those of Euclidean division, A = q × B + r with 0 ≤ r < B, computed with BigInt. The step-by-step working is the school algorithm: the fewest leading digits of A that make a number of at least B are taken first, and each following step brings down the next digit, writes the quotient digit ⌊current ÷ B⌋, multiplies it by B and subtracts. After the last digit, if the remainder is not 0, a decimal point is written and a 0 is brought down at each step. The decimal expansion is produced by that same algorithm while remembering the step at which each remainder first appeared: a remainder of 0 means the decimal ends, and a remainder seen before means the digits since that step repeat for ever, which gives the length and position of the repeating block. A remainder is always between 0 and B − 1, so a repeat must occur within B steps. The expansion is followed for at most 200 decimal places, which always reaches the end of a decimal that ends for numbers of 30 digits (a terminating decimal of such inputs has at most 199 places), and the working shows at most 50 of them; a repeating block longer than the cap is reported as such. The fraction and mixed number are reduced with the greatest common divisor of A and B. Negative numbers are divided by their sizes: the quotient is negative when exactly one number is, and the remainder takes the sign of the dividend. The rounded value is half up from the exact quotient. The divisibility rules and the properties of repeating decimals (a fraction in lowest terms ends exactly when its denominator has no prime factors other than 2 and 5, and the period is the multiplicative order of 10 modulo the part of the denominator that is coprime to 10) are standard results. Everything runs in your browser and nothing you type is sent anywhere.

Sources

More: Percent, fractions and arithmeticAll math & numbersAll toolsHome & DIY calculators