Free calculator

Decimal to Fraction Calculator (and Back Again)

Decimals to fractions — repeating ones too — fractions to decimals by long division, and any fraction simplified.

To turn a decimal into a fraction, write the digits over a power of ten with one zero per decimal place, then divide top and bottom by their greatest common divisor: 0.375 = 375/1000 = 3/8. Repeating decimals use a different trick, subtracting a shifted copy of themselves so the repeating tail cancels.

Try it now

Put repeating digits in brackets: 0.(3) is 0.333…, 0.1(6) is 0.1666…

Updates as you type
Fraction 38

Step by step

  1. Write the digits over 1000 — one zero for each decimal place
    0.375 = 3751000
  2. Divide top and bottom by their greatest common divisor, 125
    375 ÷ 1251000 ÷ 125 = 38

Also worth knowing

As a decimal
0.375

Terminating decimals

0.375 has three decimal places, so it is 375/1000. The GCD of 375 and 1000 is 125, and dividing both by 125 gives 3/8. Always reduce at the end; the fraction is correct before reducing, only not in lowest terms.

Repeating decimals

Put the repeating digits in brackets: 0.1(6) means 0.1666…. Call it x. Multiplying by 100 gives 16.666… and by 10 gives 1.666…. Subtract, and the infinite tails cancel: 100x − 10x = 15, so x = 15/90 = 1/6.

The same idea gives 0.(3) = 1/3 and 0.(142857) = 1/7. It also settles the old argument: 0.(9) comes out as exactly 1.

Fractions to decimals by long division

Divide the numerator by the denominator, bringing down a zero each time. If a remainder ever repeats, the digits repeat from there. That is the whole reason some fractions end and others do not: 3/8 stops because 8 = 2³, while 1/6 repeats because 6 has a factor of 3.

The rule to remember: after reducing, a fraction ends as a decimal exactly when its denominator has no prime factors other than 2 and 5. To reduce the fraction first, use the GCD calculator or the simplifying fractions guide.

Worked examples

Worked examples

Each one is computed by the calculator above, so the answers are the real output.

0.375 as a fraction

Three decimal places, so over 1000, then reduced.

Fraction 38

Step by step

  1. Write the digits over 1000 — one zero for each decimal place
    0.375 = 3751000
  2. Divide top and bottom by their greatest common divisor, 125
    375 ÷ 1251000 ÷ 125 = 38

Also worth knowing

As a decimal
0.375

0.1(6) as a fraction

A repeating decimal with one non-repeating digit before the repeat.

Fraction 16

Step by step

  1. Call the repeating decimal x
    x = 0.166…
  2. Multiply by 100 and by 10, so the repeating tails line up
    100x = 16.66…
    10x = 1.66…
  3. Subtract: the infinite tails cancel exactly
    90x = 15
  4. Solve for x
    x = 1590
  5. Divide top and bottom by their greatest common divisor, 15
    15 ÷ 1590 ÷ 15 = 16

Also worth knowing

As a decimal
0.1666666667

1/7 as a decimal

The remainders cycle through six values before returning, so the block has six digits.

Decimal 0.(142857) = 0.142857… It repeats because 7 has a prime factor other than 2 and 5. The repeating block has 6 digits.

Step by step

  1. Divide 1 by 7, bringing down a zero each time
    Remainder × 10÷ denDigitNew remainder
    10÷ 713
    30÷ 742
    20÷ 726
    60÷ 784
    40÷ 755
    50÷ 771
  2. Remainder 1 has appeared before, so the digits from there on repeat for ever
    0.(142857)

Also worth knowing

As a percentage
14.285714%

Simplify 18/24

The GCD of 18 and 24 is 6.

Simplified 34

Step by step

  1. Break both numbers into prime factors
    18 = 2 × 32
    24 = 23 × 3
  2. Divide top and bottom by their greatest common divisor, 6
    18 ÷ 624 ÷ 6 = 34

Also worth knowing

As a decimal
0.75

FAQ

Questions people ask

How do you convert a decimal to a fraction?

Write the digits over 10, 100, 1000 and so on, one zero per decimal place, then reduce by the greatest common divisor.

How do you convert a repeating decimal to a fraction?

Multiply by a power of ten to line up the repeating part, subtract the original so the tail cancels, and solve for x.

Why do some fractions give repeating decimals?

A reduced fraction terminates only if its denominator has no prime factors other than 2 and 5. Any other factor forces the digits to repeat.

How do I type a repeating decimal?

Put the repeating digits in brackets, for example 0.(3) or 1.2(34).

Related app: Fraction Calculator

This one lives on the website. The related app below covers the surrounding topic.

Free to download. AI explanations and dark mode are part of the optional PRO subscription.