Decimal to fraction converter

0.375 is 375/1000, which simplifies to 3/8. Type a decimal to get its simplest fraction, or a fraction to see its decimal with any repeating block in parentheses. The decimal side also rounds to the nearest half, quarter, 8th, 16th or 32nd and shows how far off that is.

Decimal to fraction

Put a repeating block in parentheses: 0.(3) is 0.333…, 1.2(54) is 1.25454…

Exact fraction—
Fraction to decimal

Examples: 7/8, 2 1/3, 22/7

Decimal—

Calculated in your browser. Nothing you enter is sent or stored.

From decimal places to a fraction

Each digit after the decimal point counts a power of ten: tenths, hundredths, thousandths and so on. That makes any decimal that stops a fraction over 10, 100, 1,000 or a larger power of ten, which you then simplify.

  1. Count the digits after the point. 0.375 has three, so the denominator is 1,000.
  2. Write the digits, without the point, as the numerator: 375/1000.
  3. Divide top and bottom by their greatest common factor. For 375 and 1,000 that is 125, leaving 3/8.

A number with a whole part works the same way. 2.0625 is 20625/10000, which reduces to 33/16, or 2 1/16 as a mixed number.

3/86/16
0.375 drawn as 3/8 and as the equivalent 6/16, the same length of the bar

Repeating decimals and the algebra trick

Some fractions never stop when written as decimals: 1/3 is 0.3333… and 1/7 is 0.142857142857…. Textbooks usually mark the repeating block with a bar over the digits. This converter uses parentheses instead because they are easy to type: write 0.(3) for 0.333…, 0.1(6) for 0.1666… and 1.2(54) for 1.25454….

To turn a repeating decimal back into a fraction, call the number x, then shift the decimal point so the repeating parts line up and cancel:

  • For x = 0.(3), multiply by 10: 10x = 3.(3). Subtract x and the endless tail disappears: 9x = 3, so x = 3/9 = 1/3.
  • For x = 1.2(54), the non-repeating part has one digit and the block has two. Multiply by 10 to get 12.(54), and by 1,000 to get 1254.(54). Subtracting gives 990x = 1242, so x = 1242/990, which simplifies to 69/55.
terminating: 0.d₁d₂…dₖ = d₁d₂…dₖ / 10ᵏrepeating: 0.(r) with an n-digit block = r / (10ⁿ − 1)mixed: 0.f(r) = (f r − f) / ((10ⁿ − 1) × 10ᵏ)

Here k is the number of digits before the block and n the length of the block; “f r” means the digits of f followed by the digits of r. The converter does this with whole numbers only, so the fraction it returns is exact rather than a close guess.

A side effect of the method: 0.(9) works out to 9/9, so the converter shows 1. The two are different spellings of the same number.

Why some fractions terminate and others repeat

Going the other way, the converter divides the numerator by the denominator by long division. At each step the remainder is smaller than the denominator, so there are only so many remainders possible. Either one of them is 0, and the decimal stops, or a remainder comes back that was seen before, and from that point the digits repeat. The parentheses start where the first repeated remainder began.

Which case you get depends only on the denominator once the fraction is in lowest terms. A decimal that stops is a fraction over a power of ten, and the only prime factors of 10 are 2 and 5. So a simplified fraction terminates exactly when its denominator has no prime factors other than 2 and 5: 3/8, 7/20 and 1/40 stop, while anything with a 3, 7, 11 or other prime in the denominator repeats.

Fraction Decimal Terminates?
1/4 0.25 Yes (4 = 2 × 2)
1/6 0.1(6) No (6 has a factor 3)
1/7 0.(142857) No
1/8 0.125 Yes
1/11 0.(09) No
1/12 0.08(3) No
3/32 0.09375 Yes
7/22 0.3(18) No

Rounding to sixteenths and other workshop fractions

Tape measures and rulers marked in inches are usually divided into halves, quarters, eighths and sixteenths, sometimes thirty-seconds, and US-style measuring cups and spoons come mostly in halves, quarters and eighths. A decimal such as 1.3 in does not land on any mark, so the converter can round it to the nearest fraction with a denominator of 2, 4, 8, 16 or 32 (chosen in the “Nearest fraction with denominator” menu) and show the error after “off by”: the rounded fraction minus the value you typed.

To do it by hand, multiply the decimal by the denominator, round to a whole number and put that over the denominator. 1.3 × 16 = 20.8, which rounds to 21, so 21/16 = 1 5/16 in, about 0.0125 in too long.

Worked examples

Convert 1.2(54) to a fraction
  1. Let x = 1.2545454….
  2. 10x = 12.545454… and 1000x = 1254.545454….
  3. Subtract: 1000x − 10x = 990x = 1254 − 12 = 1242.
  4. x = 1242/990. The GCF is 18, so x = 69/55.
  5. 69 ÷ 55 is 1 remainder 14, giving 1 14/55.
1.2(54) = 69/55 = 1 14/55
Write 5/12 as a decimal
  1. 12 = 2 × 2 × 3. The factor 3 means the decimal will repeat.
  2. Long division: 50 ÷ 12 = 4 r 2, 20 ÷ 12 = 1 r 8, 80 ÷ 12 = 6 r 8.
  3. Remainder 8 has come back, so the 6 repeats forever: 0.41(6).
5/12 = 0.41(6) = 0.41666…
A recipe asks for 0.33 cup, but you only have power-of-two measures
  1. Quarter: 0.33 × 4 = 1.32, rounds to 1, so 1/4. Error 0.25 − 0.33 = −0.08.
  2. Eighth: 0.33 × 8 = 2.64, rounds to 3, so 3/8. Error +0.045.
  3. Thirty-second: 0.33 × 32 = 10.56, rounds to 11, so 11/32. Error +0.01375.
  4. A third of a cup has no exact power-of-two equivalent, which is why many cup sets include a separate 1/3 cup.
Nearest 1/32 cup: 11/32 (0.01375 cup too much); nearest 1/4 cup: 1/4 (0.08 cup short)

Slip-ups when converting

  • Typing a rounded decimal and expecting a neat fraction. 0.333 converts to 333/1000, not 1/3. Only 0.(3) means one third; the parentheses matter.
  • Putting the parentheses in the wrong place. 0.1(6) is 1/6, but 0.(16) is 16/99. Mark only the digits that actually repeat.
  • Forgetting to simplify. 0.75 as 75/100 is correct but not in lowest terms; the GCF 25 brings it to 3/4.
  • Reading the error sign backwards. A positive error means the rounded fraction is larger than your decimal. When cutting material, that is the side where a part comes out long.

A fraction from this converter is exact for the digits you typed. If a decimal came from a measurement, its last digit is already rounded, so a fraction with a smaller denominator may describe it just as well.

Sources

  1. Repeating Decimal, Wolfram MathWorld.
  2. Rational Number, Wolfram MathWorld.
  3. Regular Number, Wolfram MathWorld.