Skip to content

Decimal to Fraction Calculator

Exact fraction from a decimal, repeating ones included.

Inputs

Loading calculator…
Calculating…

Use this calculator on your own site

Free embed

  • Two lines of HTML, unlimited views
  • Shows a small CalculateEveryday bar, with a credit link under the calculator

Formula

Write the digits over the place value of the last one (0.375 = 375/1000), then divide top and bottom by their greatest common factor

A terminating decimal is its digits over a power of ten: three decimal places means a denominator of 1000. Dividing numerator and denominator by their greatest common factor gives lowest terms. For digits that repeat forever, a block of m repeating digits equals that block over m nines — 0.333… is 3/9 — shifted right by however many non-repeating places come first.

Worked example

0.375 ends in the thousandths place, so it is 375/1000. The greatest common factor of 375 and 1000 is 125, and dividing both gives 3/8 — which is 37.5%.

Where this can give the wrong answer

  • Only digits you mark as repeating are treated as repeating. 0.333 typed on its own is exactly 333/1000, not 1/3; put 3 in the repeating box to get 1/3.
  • 0.999… repeating is exactly 1, not slightly less. The calculator returns 1, because 9/9 is 1.
  • The arithmetic is done in whole numbers, so it is exact. A calculator working in floating point would see 0.1 + 0.2 as 0.30000000000000004 and return a fraction with a seventeen-digit denominator.
  • A rounded measurement is not a fraction in disguise: 0.67 is 67/100. If you meant two-thirds, enter 0. with 6 repeating.

FAQ

Type 0.1 in the first box and 6 in the repeating box. The non-repeating part stays in the first box; only the block that goes on forever goes in the second. The answer is 1/6.

Need this calculator, but different?

MakeACalc turns a plain-English description into an embeddable calculator — formula and worked example included. Launching soon.