Why some fractions repeat
Our decimals are built on ten, and ten is 2 × 5. A fraction whose reduced denominator is made only of 2s and 5s can be rewritten with a power of ten underneath, and a power of ten underneath is exactly what a terminating decimal is.
3/8 works because 8 is 2³: multiply top and bottom by 5³ and it becomes 375/1000, which is 0.375 and finished. 1/3 cannot, because no multiplication turns a 3 into a power of ten.
So the test is simple and it happens before any division: reduce, factorise the denominator, and look for anything that is not a 2 or a 5. The tool does exactly that and says which case you are in before it starts dividing.
How long the repeat is
The repeat has two parts and both are fixed by the denominator. Write it as 2ᵃ × 5ᵇ × d′, where d′ has no 2s or 5s left in it.
The digits before the repeat starts — the run-in — number exactly max(a, b). The repeating block is exactly as long as the smallest power of ten that leaves remainder 1 when divided by d′. For 12 = 2² × 3, that is a run-in of 2 and a block of 1, which is why 7/12 is 0.58(3).
Notice what is missing from that: the numerator. Every fraction with the same reduced denominator repeats after the same number of digits. 1/7, 2/7, 3/7 and the rest all have six-digit blocks, and in fact all six are the same six digits in a different order.
The repeat lives in the remainders
Long division produces a digit and a remainder at each step. The digits are what you write down, but the remainders are what determine everything: the next digit depends only on the current remainder, so the moment a remainder comes back, everything after it must copy what happened before.
That is why the repeat is inevitable rather than coincidental. There are only finitely many possible remainders — fewer than the denominator — so one has to recur within that many steps, and the block can never be longer than the denominator minus one.
The table in the tool marks the step where the remainder returns. It is usually visible there a line before you would have spotted the pattern in the digits.
1/7 and the six digits
1/7 = 0.(142857), and the block is six long because six is the smallest power of ten leaving remainder 1 on division by 7. 10¹ leaves 3, 10² leaves 2, then 6, then 4, then 5, and 10⁶ finally leaves 1.
Six is one less than seven, which is the largest a block can possibly be. Denominators that achieve it are called full reptend primes, and 7, 17, 19, 23 and 29 are among them. 13 is not: 1/13 also has a six-digit block, but thirteen would have allowed twelve.
The other sevenths are the same cycle started at a different point: 2/7 is 0.(285714), 3/7 is 0.(428571). That is the remainder argument again — they all pass through the same six remainders, just entering the loop somewhere else.
Rounding, and when to say so
Most tools round silently. This one shows the exact decimal first and then, separately, the rounded forms — each labelled as exact or approximate at that width.
The distinction matters more than it looks. 1/3 to four places is 0.3333, and that is not 1/3; adding three of them gives 0.9999 rather than 1. Errors of that kind accumulate quietly through a spreadsheet and surface as a penny that will not reconcile.
If the work will be added up, keep the fraction as long as you can and round once at the end. If it will be read by a person, round early and say what you rounded to.
Fraction, decimal, percentage
All three are the same number in different clothes. A percentage is just the decimal moved two places: 3/8 is 0.375 is 37.5%.
The repeat travels with it. 1/3 is 0.(3) and 33.(3)%, not 33.33% — which is why a third of a class, a third of a budget and a third of a discount are all slightly more than the 33% people usually write.
The tool gives the percentage exactly, with its own repeating block where there is one. For percentage increases, decreases and comparisons, the Percentage Calculator is the page for that.
Sources and methodology
The results about period length are classical number theory. These are where they are set out.
Method. The fraction is reduced first, because the period depends on the reduced denominator and not on the numerator. The twos and fives are divided out to give the run-in length directly; the order of 10 modulo what remains is computed by repeated multiplication, giving the block length. Long division is then run for exactly that many digits, recording every remainder, and the point at which a remainder recurs is marked. Prediction and division are computed independently and must agree. That engine is verified on every change against 58 hand-written assertions, including that the block length equals the order of 10 modulo the coprime part of the denominator for every denominator up to three hundred, computed separately in the test from the way the engine computes it. The count and the per-case breakdown are published on the formula verification page.
Read the guide
Going the other way — a decimal back to an exact fraction, repeating ones included — is the Decimal to Fraction Calculator. If the fraction needs reducing first and you want to see the divisor, the Simplify Fractions Calculator shows both routes to it.