Skip to content
thecalculatorstudio

Decimal to Fraction Calculator: Exact and Repeating Decimals

Enter a decimal such as 0.375, or a repeating one with its repeating digits in brackets. You get the fraction in lowest terms, as a mixed number if it is over one.

Last reviewed

Fraction

3 / 8

a proper fraction

Value of the fraction
0.375
Difference from your decimal
none, it is exact

A terminating decimal always has an exact fraction, and so does a repeating one. A long decimal that never repeats, such as π, has no exact fraction, so choose the largest denominator you will accept.

Terminating decimals

A decimal that ends is a fraction with a power of ten underneath. Read the digits after the point as a whole number and put it over 1 followed by that many zeros:

  • 0.375 has three places, so it is 375/1000.
  • Divide the top and bottom by their greatest common divisor, 125, to get 3/8.

A number above 1 keeps its whole part. 2.125 is 2125/1000, which simplifies to 17/8, written as a mixed number 2 1/8.

Repeating decimals

Wolfram MathWorld notes that all rational numbers have either finite decimal expansions or repeating ones, such as 1/3 = 0.3333…. To convert a repeating decimal, enter the repeating digits in brackets. For a number with a non-repeating part of a digits and a repeating block of b digits:

fraction = (all the digits − the non-repeating digits) ÷ (10^a × (10^b − 1))

where the digits are read as whole numbers, the integer part included.

  • 0.(3) has no non-repeating digits, so a = 0 and b = 1: (3 − 0) ÷ 9 = 3/9 = 1/3.
  • 0.1(6) has non-repeating digit 1 (a = 1) and repeating 6 (b = 1): (16 − 1) ÷ (10 × 9) = 15/90 = 1/6.
  • 0.(142857) has b = 6: 142857 ÷ 999999 = 1/7.
  • 0.0(9) is (9 − 0) ÷ 90 = 1/10, so 0.0999… is 1/10.
  • 1.2(34) has integer part 1, non-repeating 2 and repeating 34: (1234 − 12) ÷ (10 × 99) = 1222/990 = 611/495.

Worked examples

Decimal Fraction Mixed number
0.5 1/2
0.75 3/4
0.375 3/8
0.125 1/8
2.125 17/8 2 1/8
0.(3) 1/3
0.1(6) 1/6
0.(142857) 1/7
1.2(34) 611/495 1 116/495
0.(9) 1

Decimals that never repeat

Some decimals, such as π = 3.14159265358979… or √2, never end and never repeat. No fraction equals them. The calculator then offers the closest fraction with a limited denominator, found by the continued fraction method, and shows how far it is from your decimal. For 3.14159265358979:

  • With a largest denominator of 10 (or up to 50), the closest fraction is 22/7 = 3.142857…, off by 0.00126.
  • With 100, it is 311/99 = 3.141414…, off by 0.00018.
  • With 1,000 (or up to 10,000), it is 355/113 = 3.14159292…, off by only 0.00000027.

Common mistakes

  • Forgetting to simplify. 375/1000 is right but 3/8 is the answer.
  • Putting the whole part into the numerator. Keep it, or write the improper fraction 17/8.
  • Treating 0.333 as 1/3. It is 333/1000. For one third, enter 0.(3).
  • Rounding a long decimal and expecting an exact fraction. Use the closest fraction instead.

For arithmetic with fractions, use the fraction calculator. To compare parts of a whole as a percentage, use the percentage calculator, and for a ratio the ratio calculator.

How it is calculated

Everything is exact whole-number arithmetic, so no rounding happens in an exact conversion. The closest-fraction search uses the continued fraction algorithm and picks the nearer of the two best candidates. Digits are limited to 40 in all.

Frequently asked questions

How do you convert a decimal to a fraction?

Write the digits after the point over 10 to the number of decimal places, then divide top and bottom by their greatest common divisor. 0.375 is 375/1000, which simplifies to 3/8.

How do you convert a repeating decimal to a fraction?

With a non-repeating part of a digits and a repeating block of b digits, the fraction is (all digits − non-repeating digits) ÷ (10^a × (10^b − 1)). So 0.(3) is 3/9 = 1/3, and 0.1(6) is (16 − 1)/90 = 1/6.

How do I enter a repeating decimal?

Put the repeating digits in brackets after the point and any non-repeating digits. 0.(3) is 0.333…, 0.1(6) is 0.1666…, and 0.(142857) is 0.142857142857…, which is 1/7.

How do I write a decimal over 1 as a mixed number?

The calculator gives the improper fraction and the mixed number. 2.125 is 17/8, which is 2 and 1/8: the whole part is 2 and the leftover fraction is 0.125 = 1/8.

Why does pi have no exact fraction?

Every fraction of whole numbers has a terminating or repeating decimal. The decimal for π never ends and never repeats, so no fraction equals it. Choosing a largest denominator gives the closest fraction, such as 22/7 for a limit of 10, 311/99 for 100 and 355/113 for 1,000.

Is 0.999… equal to 1?

Yes. Entered as 0.(9) the calculator returns 1, since (9 − 0) ÷ 9 = 1. A repeating 9 is another way of writing the number one.

Related calculators

Sources