Repeating Decimals and How to Turn Them Back Into Fractions
Convert any repeating decimal into an exact fraction, and learn why fractions repeat, how long the block can be and when decimals stop.
Key takeaways
- Multiplying by a power of ten and subtracting removes the infinite tail of a repeating decimal.
- A fraction in lowest terms terminates exactly when its denominator has no prime factors other than 2 and 5.
- Long division of whole numbers must eventually reach zero or revisit a remainder, so the digits end or repeat.
- Decimals that neither terminate nor repeat are irrational numbers.
To turn a repeating decimal into a fraction, multiply it by a power of ten that shifts the repeating block into line with itself, then subtract. The endless tails cancel, leaving an ordinary equation. For x = 0.272727..., 100x − x = 27, so x = 27/99 = 3/11.
Every repeating decimal is a fraction of two whole numbers, and every such fraction either terminates or repeats. The reasons are simple enough to check by hand.
Notation
A repeating decimal has a block of digits that recurs forever. Writers mark it with a bar over the block, with dots above its first and last digits, or with parentheses. In plain text, parentheses are clearest.
| Decimal | Written compactly | Fraction |
|---|---|---|
| 0.333... | 0.(3) | 1/3 |
| 0.272727... | 0.(27) | 3/11 |
| 0.1666... | 0.1(6) | 1/6 |
| 0.142857142857... | 0.(142857) | 1/7 |
The part before the block, like the 1 in 0.1(6), is called the non-repeating part or preperiod. The length of the block is the period.
The basic method
Start with a block that begins right after the decimal point. Let x be the number.
x = 0.777...
10x = 7.777...
10x − x = 7 the tails match and cancel
9x = 7
x = 7/9 For a block of two digits, multiply by 100.
x = 0.272727...
100x = 27.272727...
99x = 27
x = 27/99 = 3/11 The pattern is clear. A pure repeating block of n digits equals that block, read as a whole number, over a string of n nines. So 0.(142857) = 142857/999999, which reduces to 1/7. Watch for leading zeros inside the block: 0.(027) means 27/999, which is 1/37.
When there is a non-repeating part
Use two multiplications: one to move the preperiod to the left of the point, and another to move one full block further.
Take x = 2.3454545..., which is 2.3(45).
10x = 23.454545...
1000x = 2345.454545...
1000x − 10x = 2345 − 23
990x = 2322
x = 2322/990 = 129/55 Check by dividing: 129 ÷ 55 = 2.3454545...
A second example is 0.1(6). Here 10x = 1.666... and 100x = 16.666..., so 90x = 15 and x = 15/90 = 1/6.
Three more conversions
A two-digit block. For x = 0.(81), compute 100x − x = 81, so x = 81/99. Dividing top and bottom by 9 gives 9/11.
A whole-number part. For 1.(6), you may split off the whole number: 1 + 6/9 = 1 + 2/3 = 5/3. This is often quicker than multiplying the entire expression.
A longer preperiod. Take 0.58(3). Two digits come before the block, so multiply by 100 first, then by 1000.
100x = 58.333...
1000x = 583.333...
900x = 525
x = 525/900 = 7/12 For a negative decimal, convert the size and then attach the minus sign: −0.(4) is −4/9.
You may also notice a shortcut for the mixed case. Write all the digits up to the end of the first block as a whole number, subtract the digits of the preperiod, and put the result over as many nines as the block is long, followed by as many zeros as the preperiod is long. For 0.58(3), that is (583 − 58)/900 = 525/900. The shortcut is simply the subtraction above done in one line, so use the longer version until the reason is familiar.
Conversion also makes arithmetic exact. To add 0.(3) and 0.(45), turn them into 1/3 and 5/11. In 33rds these are 11/33 and 15/33, giving 26/33, which is 0.(78). Adding rounded decimals would only have approximated that.
Why the subtraction is legitimate
Subtracting two endless strings may feel like a trick. It is justified because a repeating decimal is a convergent infinite series, and such series may be multiplied by a constant and subtracted term by term.
The same answer comes from summing the series directly.
0.272727... = 27/100 + 27/10000 + 27/1000000 + ...
first term a = 27/100, ratio r = 1/100
sum = a/(1 − r) = (27/100)/(99/100) = 27/99 This is a geometric series, which converges whenever the size of the ratio is less than 1. Without that condition the subtraction trick can give nonsense. Applying it to 1 + 2 + 4 + 8 + ... would "prove" the total is −1, though the series has no finite sum.
The method also settles a famous case. If x = 0.999..., then 10x − x = 9, so x = 1. The two strings name the same number, as discussed in whether 0.999 repeating equals 1.
Why fractions repeat
Do long division to find 1/7. At each step you have a remainder, multiply it by 10 and divide by 7.
remainder: 1 → 3 → 2 → 6 → 4 → 5 → 1
digit: 1 4 2 8 5 7 When dividing by n, the only possible remainders are 0 to n − 1. If you reach 0, the decimal stops. Otherwise there are only n − 1 choices, so some remainder must recur, and from then on the digits copy themselves. That gives a bound: the period of a fraction with denominator n is at most n − 1.
Some denominators reach the bound. The period of 1/7 is 6 and the period of 1/17 is 16. Others fall well short: 1/13 = 0.(076923) has period 6, and 1/41 = 0.(02439) has period 5.
Which decimals terminate
A decimal that stops is a fraction over a power of ten. For instance, 0.375 = 375/1000 = 3/8. So a fraction in lowest terms terminates exactly when its denominator divides some power of 10, meaning the only primes in it are 2 and 5.
| Denominator | Prime factors | Behavior |
|---|---|---|
| 8 | 2 × 2 × 2 | Stops after 3 places |
| 20 | 2 × 2 × 5 | Stops after 2 places |
| 11 | 11 | Repeats from the start |
| 12 | 2 × 2 × 3 | Two fixed places, then repeats |
The number of places before repetition is the larger of the two exponents on 2 and 5 in the denominator. For 12 = 2² × 3 that is 2, so 1/12 = 0.08(3).
The period is determined by the rest of the denominator. If m has no factor of 2 or 5, the period of 1/m is the smallest positive k such that 10ᵏ leaves remainder 1 on division by m. This is a question of clock-style arithmetic. For m = 37, 10³ = 1000 = 27 × 37 + 1, so the period is 3.
The period of a prime denominator
For a prime p other than 2 or 5, the period of 1/p always divides p − 1. You can see it in the examples: the period of 1/11 is 2, which divides 10. The period of 1/13 is 6, which divides 12. The period of 1/37 is 3, which divides 36, and the period of 1/41 is 5, which divides 40.
The reason is Fermat's little theorem, which says that 10 raised to the power p − 1 leaves remainder 1 when divided by such a prime. So after p − 1 steps the long division is certainly back where it began. The actual cycle may be shorter, but it has to fit a whole number of times into p − 1.
Which primes reach the full length p − 1 is less settled. It is widely conjectured that infinitely many primes do, a case of a conjecture due to Emil Artin, but this had not been proved for the base ten as of the mid-2020s. A question you can pose to a curious child therefore leads quickly to the edge of what is known.
A curious pattern in sevenths
The sevenths share one cycle of digits, started at different points.
- 1/7 = 0.(142857)
- 2/7 = 0.(285714)
- 3/7 = 0.(428571)
The reason is visible in the remainder chain. Computing 2/7 simply begins the same loop at remainder 2. Multiplying out, 142857 × 7 = 999999, which matches the nines rule from earlier. Other denominators with maximal period, such as 17, share this rotating behavior.
Predicting before you divide
Put the two rules together and you can describe a decimal without computing it. Take 7/88. It is in lowest terms, and 88 = 2³ × 11. The three factors of 2 mean three digits come before the repetition starts. The remaining 11 has period 2, because 100 leaves remainder 1 on division by 11. So you expect three fixed digits followed by a repeating pair.
Dividing confirms it: 7 ÷ 88 = 0.079(54). You can reverse the process as a check. The digits up to the end of the first block are 07954, the preperiod is 079, and (7954 − 79)/99000 = 7875/99000. Dividing top and bottom by 1125 gives 7/88.
This kind of prediction is a good test of understanding, and it catches calculator results that have been rounded in the last place.
Other bases
Whether a fraction terminates depends on the base. One third repeats in base ten but is exactly 0.4 in base twelve. In base two it is 0.(01), and one tenth repeats there too, which explains odd results in computer arithmetic.
The conversion method works in any base: multiply by the base instead of ten. In base two, x = 0.(01) gives 4x = 1.(01), so 3x = 1 and x = 1/3. What never changes is whether a number is rational.
Decimals that never repeat
Since every rational number terminates or repeats, and every terminating or repeating decimal is rational, anything else is irrational. The digits of √2 and π never fall into a permanent loop. You can also build an irrational number on purpose, such as 0.101001000100001..., where the runs of zeros keep growing. It has an obvious pattern but no repeating block. For more on the distinction, see telling rational from irrational numbers.
No finite list of digits can prove a number irrational. A block that seems not to repeat might simply be very long. Irrationality needs an argument.
Pitfalls to avoid
- Multiplying by the wrong power. The shift must equal the period length, or the tails will not match.
- Counting the preperiod as part of the block. In 0.1(6), only the 6 repeats.
- Rounding mid-calculation. Treating 1/3 as 0.33 makes three of them 0.99.
- Forgetting to reduce. 27/99 is correct but 3/11 is clearer.
Check every conversion by dividing the final fraction. If the digits return, you are done.
Common questions
Can one number have two decimal forms?
Yes, but only a number with a terminating decimal. It can also be written with endless nines: 0.25 equals 0.24(9). Every other real number has exactly one decimal expansion.
How long can I wait for a block to appear?
For a fraction with denominator n, the repeating pattern must begin within the first n or so digits, and its length is below n. A calculator display may be too short to show it. For 1/17, you need 16 digits before the block closes, so doing the long division while recording remainders is more dependable than reading a screen.