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.

By Adzita Editorial Team · Updated 2026-11-03 · How we build and check our tools

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

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.(142857)

22 = 7 × 3 + 1

Quotient (whole part)3
Remainder1
As a mixed number3 1/7
Decimal expansion3.(142857)
Digits before the repeat0
Length of the repeating block6

Long division steps

StepActionWorking numberQuotient digitSubtractRemainder
1Bring down 22002
2Bring down 2223211
3Bring down 0 (after the decimal point)10173
4Bring down 0 (after the decimal point)304282
5Bring down 0 (after the decimal point)202146
6Bring down 0 (after the decimal point)608564
7Bring down 0 (after the decimal point)405355
8Bring down 0 (after the decimal point)507491
9Bring down 0 (after the decimal point)10173
10Bring down 0 (after the decimal point)304282

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.

Fraction CalculatorAdd, subtract, multiply and divide fractions and mixed numbers with simplified, mixed and decimal answers.Decimal to Fraction CalculatorConvert terminating and repeating decimals to simplified fractions, or approximate with a denominator limit.GCF CalculatorGreatest common factor (GCD) of two or more whole numbers, with Euclidean algorithm steps.Percentage CalculatorPercent of a number, percent change, and increase or decrease by a percent, with working.