Calculate 1÷4, and it stops neatly at 0.25. But calculate 1÷3, and you get 0.333…, with the 3 repeating forever, while 1÷7 gives 0.142857142857…, with a whole 6-digit block (142857) repeating over and over. It's the same kind of division — so why does one stop and the other repeat forever? And why does the length of the repeating block (the "repetend") vary so much from one denominator to the next?
The secret lies in the remainder that comes up at each step of long division. Think about doing 1÷7 by hand. Divide 10 by 7 and you get quotient 1, remainder 3. Tack a 0 onto that remainder to get 30, divide by 7 again, and you get quotient 4, remainder 2. Keep going, and the remainder cycles through 3 → 2 → 6 → 4 → 5 → 1, and at the seventh step, the remainder becomes 1 again — the exact same remainder you started with. From that point on, the digits in the quotient have no choice but to repeat in exactly the same order, because the same remainder always leads to the exact same calculation next.
So why does 1÷4 stop neatly instead of repeating? Because the remainder hits 0 along the way. 10÷4 gives quotient 2, remainder 2. 20÷4 gives quotient 5, remainder 0. Once the remainder hits 0, there's nothing left to divide, so the division simply stops there (a terminating decimal). If the remainder never hits 0 but instead repeats a remainder that already showed up before, then everything in between repeats forever (a repeating decimal). In fact, the remainder can only ever be a whole number smaller than the divisor, so there are only finitely many possible remainders — which means that no matter how long you keep dividing, the remainder is bound to either hit 0 eventually or repeat one that's already come up before.
The length of the repeating block also depends entirely on the denominator. Once you've reduced the fraction, if the denominator's only prime factors are 2 and 5, you get a terminating decimal; otherwise, you're guaranteed a repeating decimal. 1/3 has a 1-digit repeating block (3), 1/7 has a 6-digit block (142857), and 1/11 has a 2-digit block (09) — even for denominators that look similar, the length of the repeating block is all over the place. This length is determined exactly by how many times you need to multiply 10's remainder modulo that denominator before it cycles back to 1.
Going the other way, you can turn a repeating decimal back into a fraction too. For example, let x = 0.181818…. Since the repeating block is 2 digits long, multiply both sides by 100. That gives 100x = 18.181818…, and subtracting the original x makes the repeating part vanish as if by magic: 100x − x = 18, or 99x = 18. Solving gives the exact fraction x = 18/99 = 2/11. It's remarkable that a digit string going on forever after the decimal point can be turned into a fraction that lands exactly on a whole-number ratio.
On our activity page, you can use a slider to step through the long division one stage at a time and watch exactly when the remainder starts repeating, change the denominator from 2 to 19 to see how the repeating block's length changes, and try turning a repeating decimal back into a fraction yourself.