CompoundPage

Decimal to Fraction Calculator

Exact fractions, repeating decimals included: the decimal to fraction calculator turns 0.41(6) into exactly 5/12, not a rounding of it.

For 0.41666... enter 0.416 above and 1 here: the final 6 repeats. For 0.142857142857... enter 0.142857 and 6.

As a fraction3/8

As a mixed number
3/8
Check: the fraction back as a decimal Exact.
0.375
Step 1: put it over a power of ten 3 decimal places, so the denominator is 10^3.
375/1000
Step 2: reduce 125 is the greatest common divisor of 375 and 1000.
divide both by 125 to get 3/8
Denominator 8 factorizes as Only 2s and 5s, which is exactly the condition for a decimal that terminates.
2^3
On a tape measure Exactly a sixteenth, so it is a mark on a standard tape.
3/8 inch
Common decimals and their fractions
DecimalFractionTerminates?
0.51/2yes
0.251/4yes
0.1251/8yes
0.06251/16yes
0.21/5yes
0.(3)1/3no: 3 is not 2 or 5
0.1(6)1/6no: 6 = 2 x 3
0.(142857)1/7no: six-digit cycle
0.(1)1/9no
  • A decimal entered as a plain number is treated as exact and terminating. Use the repeating field to say that the final digits go on forever, which gives a different (and usually much tidier) fraction.
  • A fraction terminates as a decimal exactly when its reduced denominator has no prime factors besides 2 and 5. Everything else repeats.

How the Decimal to Fraction Calculator works

Converting a terminating decimal to a fraction is two steps. Put the digits over the matching power of ten, then reduce. 0.375 has three decimal places, so it is 375/1000, and dividing both by their greatest common divisor of 125 gives 3/8.

Repeating decimals need a different trick, and it is the reason this calculator exists. Most calculators silently treat 0.333 as three hundred and thirty-three thousandths rather than as a third.

The trick is algebraic. Let x = 0.3333... Then 10x = 3.3333..., and subtracting the first from the second gives 9x = 3, so x = 1/3. The infinite tail cancels because both numbers have the same one. Generalized: a block of n repeating digits gives a denominator of n nines, so 0.(142857) is 142857/999999, which reduces to 1/7.

When the repeat does not start immediately there is one more factor. For 0.41(6), that is 0.41666..., the repeating block is one digit and sits two places in, so the denominator is 9 x 100 = 900 and the numerator is 416 - 41 = 375. That gives 375/900 = 5/12. The general form is (all the digits, minus the digits before the repeat) over (n nines followed by k zeros), where n is the length of the repeating block and k is how many places come before it.

Which decimals repeat at all has a clean answer. A fraction in lowest terms terminates exactly when its denominator's only prime factors are 2 and 5, because ten is 2 x 5 and a terminating decimal is a fraction over a power of ten. So 1/8 terminates (8 = 2^3), 1/20 terminates (20 = 2^2 x 5), and 1/6 does not (6 = 2 x 3). The 3 is the problem. This also tells you the cycle length: for 1/7 it is 6, for 1/11 it is 2, and for 1/13 it is 6, each being the multiplicative order of 10 modulo the denominator.

One practical use dominates the search traffic for this: inches. A tape measure is marked in sixteenths, so a decimal measurement from a drawing or a CNC readout needs converting to the nearest useful fraction. 0.375 is exactly 6/16, which reduces to 3/8, a real mark on the tape. 0.4 is 6.4/16, which is not a mark at all; the nearest is 3/8 and you are 0.0125 of an inch out. Machinists work in thousandths precisely to avoid this, and carpenters work in sixteenths and round.

The last point is about precision rather than arithmetic. A decimal typed into a form is only as exact as the digits typed. 0.333 is 333/1000, and that really is what it says. If the intent was a third, the repeating field is the way to say so. The difference between 333/1000 and 1/3 is one part in three thousand, which matters in some contexts and not in others.

Decimal to Fraction Calculator FAQ

How do I convert a decimal to a fraction?

Count the decimal places, put the digits over 10 to that power, and reduce. 0.375 has three places, so 375/1000, and dividing both by 125 gives 3/8. For whole numbers in front, keep them aside and convert only the decimal part, or use the improper form.

How do I convert a repeating decimal to a fraction?

Put the repeating block over that many nines. 0.(3) is 3/9 = 1/3; 0.(142857) is 142857/999999 = 1/7. If the repeat starts late, as in 0.41(6), subtract the non-repeating head: (416 - 41) / 900 = 375/900 = 5/12.

Why do some fractions repeat and others don't?

A fraction terminates exactly when its reduced denominator has no prime factors other than 2 and 5, because 10 = 2 x 5. So 1/8 and 1/20 terminate, while 1/3, 1/6 and 1/7 repeat. The 3 in 6 is what stops 1/6 terminating, even though the 2 would have been fine.

What is 0.375 as a fraction of an inch?

3/8 of an inch, exactly. 0.375 x 16 = 6, so it is 6/16, which reduces to 3/8, a real mark on a tape measure. Not every decimal lands on one: 0.4 inches is 6.4 sixteenths, so the nearest mark is 3/8 and you are about 0.013 of an inch short.

Related calculators

Embed this calculator
<div id="compoundpage-decimal-to-fraction-calculator"></div>
<script src="https://compoundpage.com/embed/decimal-to-fraction-calculator.js" async></script>

The same calculation as JSON