How to use the repeating decimal and fraction converter
This converter works both ways between repeating decimals and fractions. In the first section you enter the whole-number part, the non-repeating digits and the repeating block to get a fraction in lowest terms; in the second you enter a numerator and denominator to see where the decimal starts repeating and how long the cycle is.
Repeating parts are hard to type with dots or overbars, so the repeating digits get their own box. For 0.01666… enter 01 as the non-repeating part and 6 as the repeating block. Leading zeros count as digits and must be kept, and negatives are entered with a minus sign in front of the whole-number part.
The formula is (the non-repeating and repeating blocks written together − the non-repeating block) ÷ (as many nines as repeating digits, followed by as many zeros as non-repeating digits). The answer is reduced by the greatest common divisor, shown as an improper fraction and as a mixed number when there is a whole part, and the working is printed as well.
Expanding a fraction works by long division until a remainder repeats, which reveals where the cycle starts and how long it is. A remainder of 0, as in 1/4, is reported as a terminating decimal, while 1/7 is written 0.(142857) with the repeat in parentheses. Denominators are accepted up to 100,000 and the repeat is printed up to 40 digits, with longer cycles shortened but their exact length still reported.
Frequently Asked Questions
With p non-repeating digits and q repeating digits, the fraction is (the two blocks written together − the non-repeating block) ÷ (q nines followed by p zeros). So 0.1666… becomes (16 − 1) ÷ 90 = 1/6.
Put only the digits that repeat in the repeating box and the digits before them in the non-repeating box. For 0.01666… that is 01 and 6. Leading zeros count as digits, so keep them.
The formula gives (9 − 0) ÷ 9 = 1, so it is exactly 1. The converter returns the same thing; this is not a rounding error but what the definition of a repeating decimal gives.