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
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
──
2The 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 | Bring down | Number | Digit of the quotient | Multiply | Subtract |
|---|---|---|---|---|---|
| 1 | 1, 2 | 12 | 1 | 1 × 7 = 7 | 12 − 7 = 5 |
| 2 | 3 | 53 | 7 | 7 × 7 = 49 | 53 − 49 = 4 |
| 3 | 4 | 44 | 6 | 6 × 7 = 42 | 44 − 42 = 2 |
| 4 | 0 (after writing “.” in the quotient) | 20 | 2 (repeating) | 2 × 7 = 14 | 20 − 14 = 6 |
| 5 | 0 | 60 | 8 (repeating) | 8 × 7 = 56 | 60 − 56 = 4 |
| 6 | 0 | 40 | 5 (repeating) | 5 × 7 = 35 | 40 − 35 = 5 |
| 7 | 0 | 50 | 7 (repeating) | 7 × 7 = 49 | 50 − 49 = 1 |
| 8 | 0 | 10 | 1 (repeating) | 1 × 7 = 7 | 10 − 7 = 3 |
| 9 | 0 | 30 | 4 (repeating) | 4 × 7 = 28 | 30 − 28 = 2 |
Repeating decimals of 1/n for n = 2 to 30
| n | 1/n as a decimal | Repeating block | Period length | Kind |
|---|---|---|---|---|
| 2 | 0.5 | None | 0 | Ends |
| 3 | 0.(3) | 3 | 1 | Repeats from the first place |
| 4 | 0.25 | None | 0 | Ends |
| 5 | 0.2 | None | 0 | Ends |
| 6 | 0.1(6) | 6 | 1 | Repeats after a lead-in |
| 7 | 0.(142857) | 142857 | 6 | Repeats from the first place |
| 8 | 0.125 | None | 0 | Ends |
| 9 | 0.(1) | 1 | 1 | Repeats from the first place |
| 10 | 0.1 | None | 0 | Ends |
| 11 | 0.(09) | 09 | 2 | Repeats from the first place |
| 12 | 0.08(3) | 3 | 1 | Repeats after a lead-in |
| 13 | 0.(076923) | 076923 | 6 | Repeats from the first place |
| 14 | 0.0(714285) | 714285 | 6 | Repeats after a lead-in |
| 15 | 0.0(6) | 6 | 1 | Repeats after a lead-in |
| 16 | 0.0625 | None | 0 | Ends |
| 17 | 0.(0588235294117647) | 0588235294117647 | 16 | Repeats from the first place |
| 18 | 0.0(5) | 5 | 1 | Repeats after a lead-in |
| 19 | 0.(052631578947368421) | 052631578947368421 | 18 | Repeats from the first place |
| 20 | 0.05 | None | 0 | Ends |
| 21 | 0.(047619) | 047619 | 6 | Repeats from the first place |
| 22 | 0.0(45) | 45 | 2 | Repeats after a lead-in |
| 23 | 0.(0434782608695652173913) | 0434782608695652173913 | 22 | Repeats from the first place |
| 24 | 0.041(6) | 6 | 1 | Repeats after a lead-in |
| 25 | 0.04 | None | 0 | Ends |
| 26 | 0.0(384615) | 384615 | 6 | Repeats after a lead-in |
| 27 | 0.(037) | 037 | 3 | Repeats from the first place |
| 28 | 0.03(571428) | 571428 | 6 | Repeats after a lead-in |
| 29 | 0.(0344827586206896551724137931) | 0344827586206896551724137931 | 28 | Repeats from the first place |
| 30 | 0.0(3) | 3 | 1 | Repeats after a lead-in |
Division facts: worked examples
| Dividend | Divisor | Quotient | Remainder | Decimal |
|---|---|---|---|---|
| 1234 | 7 | 176 | 2 | 176.(285714) |
| 100 | 8 | 12 | 4 | 12.5 |
| 1 | 7 | 0 | 1 | 0.(142857) |
| 22 | 7 | 3 | 1 | 3.(142857) |
| 10 | 3 | 3 | 1 | 3.(3) |
| 355 | 113 | 3 | 16 | 3.(1415929203539823008849557522123893805309734513274336283185840707964601769911504424778761061946902654867256637168) |
| 12.5 | 0.4 | 31 | 0.1 | 31.25 |
| 1 | 12 | 0 | 1 | 0.08(3) |
| 1 | 81 | 0 | 1 | 0.(012345679) |
| 144 | 12 | 12 | 0 | 12 |
| 5 | 9 | 0 | 5 | 0.(5) |
| −17 | 5 | −3 | −2 | −3.4 |
Divisibility rules from 2 to 12
| Divisor | Rule | Example | What the rule looks at | Division |
|---|---|---|---|---|
| 2 | The last digit is 0, 2, 4, 6 or 8. | 1358 | last digit 8 | 1358 ÷ 2 = 679 remainder 0 |
| 3 | The digits add up to a multiple of 3. | 4521 | digit sum 4 + 5 + 2 + 1 = 12 | 4521 ÷ 3 = 1507 remainder 0 |
| 4 | The last two digits make a multiple of 4. | 31724 | last two digits 24, and 24 ÷ 4 = 6 | 31724 ÷ 4 = 7931 remainder 0 |
| 5 | The last digit is 0 or 5. | 7865 | last digit 5 | 7865 ÷ 5 = 1573 remainder 0 |
| 6 | The number is divisible by both 2 and 3. | 4518 | last digit 8 and digit sum 18 | 4518 ÷ 6 = 753 remainder 0 |
| 7 | Remove the last digit and subtract double it from what is left; the result is 0 or a multiple of 7 (repeat if needed). | 2639 | 263 − 2 × 9 = 245, and 245 = 7 × 35 | 2639 ÷ 7 = 377 remainder 0 |
| 8 | The last three digits make a multiple of 8. | 7416 | last three digits 416, and 416 ÷ 8 = 52 | 7416 ÷ 8 = 927 remainder 0 |
| 9 | The digits add up to a multiple of 9. | 7164 | digit sum 7 + 1 + 6 + 4 = 18 | 7164 ÷ 9 = 796 remainder 0 |
| 10 | The last digit is 0. | 3470 | last digit 0 | 3470 ÷ 10 = 347 remainder 0 |
| 11 | Add and subtract the digits alternately, from the right; the result is 0 or a multiple of 11. | 9185 | alternating sum + 5 − 8 + 1 − 9 = −11 | 9185 ÷ 11 = 835 remainder 0 |
| 12 | The number is divisible by both 3 and 4. | 3576 | digit sum 21 and last two digits 76 | 3576 ÷ 12 = 298 remainder 0 |
How to do long division
- 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.
- 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.
- 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).
- 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.
- 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.
- 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 free tools
- Factor CalculatorList every factor of a number with its factor pairs, count and sum, and whether it is prime, perfect or abundant. Plus common factors of 2 or 3 numbers.
- Area CalculatorPick a shape (rectangle, triangle, circle, trapezoid, ellipse, polygon, ring and more) and get its area and perimeter, with the formula and working.
- Factorial CalculatorCalculate n! exactly for any n up to 10,000: digit count, first and last digits, trailing zeros, n!!, subfactorial !n and Stirling’s approximation.
- Modulo CalculatorFind a mod n for any integers up to 200 digits, with floor and truncated remainders side by side, plus congruence, aᵇ mod n and the modular inverse.
- Average Speed CalculatorAverage speed from total distance and time, or from several legs. See why equal distances at 30 and 60 mph average 40 mph, not 45.
- Fraction, Decimal and Percent ConverterEnter a fraction, decimal or percent and see the other two exactly, with the lowest-terms fraction, mixed number and repeating decimals like 0.(3).
More: Percent, fractions and arithmeticAll math & numbersAll toolsHome & DIY calculators