Home / Math / Long Division Calculator
Long Division Calculator with Remainder and Repeating Decimals
Divide one whole number by another and see the quotient, the remainder, the decimal expansion with any repeating block marked, and the working shown digit by digit.
How long division works
Long division processes the dividend one digit at a time from the left. At each step you append the next digit to the current remainder, find how many whole times the divisor fits into that working number (a digit from 0 to 9), write that digit in the quotient, and subtract the product to get a new remainder.
For 22 ÷ 7: the first digit 2 is smaller than 7, so the quotient digit is 0 and the remainder is 2. Bring down the next 2 to make 22; 7 goes in three times (21), leaving 1. The whole-number answer is 3 with remainder 1, which can be written 22 = 7 × 3 + 1. The table above reproduces this layout, step by step.
Continuing into decimals
To go past the point, keep the remainder and bring down a zero each time. With remainder 1 for 22 ÷ 7, the working number becomes 10, then 7 goes in once (remainder 3), then 30 gives 4 (remainder 2), then 20 gives 2 (remainder 6), and so on. The digits 1, 4, 2, 8, 5, 7 follow, and the next remainder is 1 again, which is exactly where the decimal part began.
Since a remainder is always less than the divisor, only finitely many different remainders are possible. Either one of them is zero, so the decimal ends, or one repeats, so the digits cycle from that point on.
Terminating versus repeating decimals
The tool detects a repeat by recording each remainder when it first appears. When a remainder shows up a second time, everything after the first occurrence repeats. The longest possible block has length one less than the divisor, and 1 ÷ 7 achieves it with six digits.
A fraction in lowest terms terminates only if its denominator has no prime factors other than 2 and 5. So 1 ÷ 8 = 0.125 and 3 ÷ 20 = 0.15 end, while 1 ÷ 3, 1 ÷ 6 and 1 ÷ 7 do not. A divisor with factors of 2 or 5 as well as others, such as 6, gives a short non-repeating prefix before the cycle: 1 ÷ 6 = 0.1(6).
Checking your answer and the limits here
- Check by multiplying. Quotient × divisor + remainder must equal the dividend.
- Whole numbers only. To divide decimals, multiply both numbers by the same power of ten until the divisor is whole, then divide.
- Size limits. The dividend is limited to about a trillion and the divisor to one million, so the cycle search stays quick.
- Long blocks. Only the first 60 digits of a very long repeating block are displayed; its true length is still reported.
Worked example
Divide 22 by 7. The whole part is 3 with remainder 1, and the decimal repeats the block 142857 forever.
Inputs
| Dividend (number being divided) | 22 |
|---|---|
| Divisor (number to divide by) | 7 |
Result
22 = 7 × 3 + 1
| Quotient (whole part) | 3 |
|---|---|
| Remainder | 1 |
| As a mixed number | 3 1/7 |
| Decimal expansion | 3.(142857) |
| Digits before the repeat | 0 |
| Length of the repeating block | 6 |
Long division steps
| Step | Action | Working number | Quotient digit | Subtract | Remainder |
|---|---|---|---|---|---|
| 1 | Bring down 2 | 2 | 0 | 0 | 2 |
| 2 | Bring down 2 | 22 | 3 | 21 | 1 |
| 3 | Bring down 0 (after the decimal point) | 10 | 1 | 7 | 3 |
| 4 | Bring down 0 (after the decimal point) | 30 | 4 | 28 | 2 |
| 5 | Bring down 0 (after the decimal point) | 20 | 2 | 14 | 6 |
| 6 | Bring down 0 (after the decimal point) | 60 | 8 | 56 | 4 |
| 7 | Bring down 0 (after the decimal point) | 40 | 5 | 35 | 5 |
| 8 | Bring down 0 (after the decimal point) | 50 | 7 | 49 | 1 |
| 9 | Bring down 0 (after the decimal point) | 10 | 1 | 7 | 3 |
| 10 | Bring down 0 (after the decimal point) | 30 | 4 | 28 | 2 |
- The digits in brackets repeat forever.
Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.
Frequently asked questions
How do I do long division by hand?
Work digit by digit from the left: bring down a digit, see how many times the divisor fits, write that digit above, subtract, and repeat with the remainder.
What does the bracket in the decimal mean?
The digits inside the brackets repeat forever. For example 0.1(6) means 0.1666666 and so on, and 3.(142857) means 3.142857142857 and so on.
How long can a repeating block be?
For a divisor d the block has at most d − 1 digits. The maximum is reached by some divisors such as 7, whose block is six digits long.
Why does 1 divided by 8 end but 1 divided by 3 does not?
A fraction terminates when the denominator, in lowest terms, has only prime factors 2 and 5. Eight is two cubed; three is a different prime.
How do I write the remainder as a fraction?
Put the remainder over the divisor and attach it to the whole quotient. 22 divided by 7 is 3 with remainder 1, or 3 and one seventh.