Decimal to Fraction Converter

Turn a decimal into a fraction β€” repeating decimals too β€” and fractions back into decimals.

Put repeating digits in brackets, 0.1(6), or end with dots, 0.1666...

A fraction, 5/8, or a mixed number, 2 1/8.

0.625 as a fraction

58

Type a decimal to get it as an exact fraction in lowest terms, or type a fraction to get its decimal: the two boxes are linked, and whichever you edit fills the other. It opens on 0.625, which is 5/8. Repeating decimals convert exactly, and a decimal that has no neat fraction can be rounded to the nearest sixteenth of an inch or to the closest fraction with a small denominator.

How to use it

Decimal takes a number such as 2.125, -0.75 or 1e-3, of up to 100 digits. Write a repeating part in brackets: 0.(3) is 0.333…, and 0.1(6) is 0.1666…. A decimal that ends in dots, such as 0.1666..., is read the same way when its last digits repeat at least twice in a row, and a checkbox names the reading (β€œTreat as 0.1(6)”); untick it to take the digits as they stand, which gives 833/5000. When nothing repeats before the dots, they are ignored and a note says so.

Fraction takes a fraction such as 22/7 or a mixed number such as 2 1/8, and gives the decimal with any repeating digits in brackets: 3.(142857). A repeating part longer than 100 digits is cut there, with its length stated.

Approximate replaces the exact fraction with a nearby simpler one and says how far above or below it is:

  • Nearest 1/N rounds to the nearest 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, the divisions of an inch ruler, and reduces the result. A value exactly halfway rounds away from zero.
  • Simplest fraction finds the closest fraction whose denominator is at most 10, 100, 1,000 or a number you choose.

Everything runs in your browser.

How it works

A decimal that ends is its digits over a power of ten: three decimal places go over 1,000. Dividing the top and bottom by their greatest common divisor gives lowest terms.

A repeating decimal is multiplied by two powers of ten chosen so that the repeating digits line up after the point. Subtracting one from the other cancels them and leaves a whole number, which is then divided out. Nines that repeat for ever equal the next digit up, so 0.(9) as a fraction gives 1.

The simplest fraction within a denominator comes from the continued fraction of the value, which yields the fractions that are closer than any other with a denominator as small. The conversion itself is exact at any length, on whole numbers rather than floating point.

Examples

0.625 as a fraction

A Decimal of 0.625 gives 5/8.

  1. There are 3 decimal places, so write the digits over 1,000. 0.625 = 625/1000
  2. Divide the top and bottom by their greatest common divisor, 125. 625/1000 = 5/8

The repeating decimal 0.1666…

A Decimal of 0.1(6) gives 1/6.

  1. Call the number x. x = 0.1666…
  2. Multiply by 10, so the repeating digits start right after the point. 10x = 1.666…
  3. Multiply x by 100, which moves one full repeat past the point. 100x = 16.666…
  4. Subtract one from the other. The repeating digits cancel. 100x βˆ’ 10x = 16 βˆ’ 1, so 90x = 15
  5. Divide, and simplify. x = 15/90 = 1/6

0.3 inches on a ruler

A Decimal of 0.3 with Approximate on, Nearest 1/N and the nearest 1/16: 5/16, which is 0.0125 above 0.3.

  1. Multiply by 16 to count in parts of 1/16. 0.3 Γ— 16 = 4.8
  2. Round to the nearest whole number; a half rounds away from zero. 4.8 rounds to 5
  3. Put it over 16 and simplify. 5/16

Ο€ as a simple fraction

A Decimal of 3.14159265358979 with Approximate on and Simplest fraction: a largest denominator of 10 gives 22/7 (about 0.001264489267 above 3.14159265358979), and 1,000 gives 355/113 (about 2.667641923 Γ— 10⁻⁷ above 3.14159265358979).

Common fractions and their decimals

Sixteenths and thirds as decimals
FractionDecimal
1/160.0625
1/80.125
3/160.1875
1/40.25
5/160.3125
1/30.(3)
3/80.375
7/160.4375
1/20.5
9/160.5625
5/80.625
2/30.(6)
11/160.6875
3/40.75
13/160.8125
7/80.875
15/160.9375

Frequently asked questions

A fraction in lowest terms has a decimal that ends only when its denominator has no prime factors other than 2 and 5. So 3/8 as a decimal is 0.375, while 1/12 as a decimal is 0.08(3).
Every decimal that ends or repeats can. Numbers such as Ο€ and √2 neither end nor repeat, so any digits typed for them are a rounded value; the tool converts those digits exactly, and Approximate finds a short fraction close to them.

See also