Skip to content

Decimal to Fraction Calculator

Convert a decimal to a fraction in simplest form, with steps: repeating decimals, mixed numbers, nearest 1/16 inch and the closest fraction with a small denominator.

Calculator Details

As a fraction:19/8See results ↓

A decimal (0.625, −2.375), a repeating decimal (0.1(6), 0.(3) or 0.1666…) or a fraction to turn into a decimal (5/8, 1 3/8)

Tape-measure fractions: halves to 64ths of an inch

The closest fraction whose denominator is no bigger than this, e.g. 22/7 for π with 10

Your Results

As a fraction: 19/8

As a fraction

19/8

Mixed number 2 3/8

Decimal

2.375

Percent

237.5%

Nearest 1/16 inch

2 3/8

Exact

Closest fraction, denominator ≤ 100

19/8

Exact

2.375 = 19/8, or 2 3/8 as a mixed number. To the nearest 1/16 it is 2 3/8, and the closest fraction with a denominator up to 100 is 19/8.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Detailed Breakdown

Step by step
StepResult
Write the digits over 10^3 (3 decimal places)2375/1000
Greatest common divisor of top and bottom125
Divide both by 12519/8
Continued fraction [2; 2, 1, 2] and its convergents
aₖConvergentDecimalError
222-0.375
25/22.50.125
17/32.3333333-0.0417
219/8 (best)2.3750

Each convergent is the best fraction for its denominator size; the best fraction under your limit is the last convergent within it or a fraction between it and the next (a semiconvergent).

How This Calculator Works

How it's calculated

Terminating decimal: digits ÷ 10ⁿ (n = decimal places), then divide top and bottom by their GCD

Repeating decimal 0.a(b): x = (ab − a) ÷ (10^(|a|+|b|) − 10^|a|)

Nearest 1/n inch: round(x × n) ÷ n

Your numbers: 2.375 = 2375/1000. The GCD of 2375 and 1000 is 125, so the fraction is 19/8 = 2 3/8. For the tape measure, 2.375 × 16 is rounded to a whole number of 1/16ths: 2 3/8 inch.

Frequently Asked Questions

How do you convert a decimal to a fraction?

Write the digits after the point over 10, 100, 1,000… (one zero per decimal place), then divide top and bottom by their greatest common divisor. 0.625 = 625/1000; the GCD of 625 and 1000 is 125, so 0.625 = 5/8.

How do you convert a repeating decimal to a fraction?

Call the number x, multiply it by a power of 10 that shifts one full repeating block left of the point, and subtract a copy that lines the repeats up. For 0.1666…: 100x = 16.666… and 10x = 1.666…, so 90x = 15 and x = 15/90 = 1/6. For 0.(3) the result is 1/3, and for 0.(142857) it is 1/7.

How do I type a repeating decimal?

Put the repeating digits in brackets, 0.1(6) for 0.1666… or 0.(27) for 0.272727…, or type the digits followed by an ellipsis (0.1666... or 0.2727…). With an ellipsis the calculator takes the block that repeats at least twice at the end, or the last digit when nothing repeats.

What is 0.375 as a fraction?

3/8. 375/1000 divided by the GCD 125 gives 3/8. Other common ones: 0.125 = 1/8, 0.25 = 1/4, 0.5 = 1/2, 0.625 = 5/8, 0.75 = 3/4 and 0.875 = 7/8.

How do I turn a decimal into a mixed number?

Keep the whole part and convert only the decimal part: 2.375 = 2 + 0.375 = 2 + 3/8 = 2 3/8. As an improper fraction it is 19/8 (2 × 8 + 3 = 19).

How do I convert a decimal to the nearest 1/16 inch?

Multiply the decimal by 16, round to the nearest whole number, and put it over 16, then simplify. 0.3 inch × 16 = 4.8, which rounds to 5, so it is 5/16 inch (0.3125, 0.0125 inch over). The calculator also rounds to halves, quarters, eighths, 32nds and 64ths.

What is the closest simple fraction to a decimal?

Set the largest denominator you accept. With 10, π (3.14159…) becomes 22/7, off by about 0.00126; with 1,000 it becomes 355/113, off by less than 0.0000003. These come from the continued fraction of the number, which gives the best approximations for their size.

Does 0.999… really equal 1?

Yes. With x = 0.999…, 10x = 9.999…, and subtracting gives 9x = 9, so x = 1 exactly. Typing 0.(9) shows the fraction 1.

How do I convert a fraction to a decimal?

Divide the numerator by the denominator. Type the fraction (5/8, or 1 3/8 for a mixed number) and the calculator does the long division: 5/8 = 0.625, and 1/7 = 0.(142857), where the six digits repeat forever. A fraction in simplest form terminates only when its denominator has no prime factors other than 2 and 5.

Fractions are exact: the decimal you type is read digit by digit (never through floating point) and reduced by the greatest common divisor, following OpenStax Prealgebra 2e §5.1 and §5.3. Repeating decimals use the algebra method; with an ellipsis (0.1666…) the block that repeats at least twice at the end is taken as the repeating part, otherwise the last digit. The closest fraction under a denominator limit comes from continued fractions (Khinchin). Tape-measure rounding is to the nearest 1/2 to 1/64 inch, halves rounded away from zero. Not included: fractions with letters, operations on several fractions (use the fraction calculator), binary or other bases, and periods longer than 1,000 digits (shown cut short).

Decimal to Fraction Calculator: Exact, Repeating and Inch Fractions

By FindMySum · Last reviewed

This decimal to fraction calculator turns a decimal into a fraction in lowest terms and shows every step. It also handles repeating decimals such as 0.1666…, writes the answer as a mixed number, rounds to the nearest sixteenth (or any binary fraction) of an inch for builders, and finds the closest fraction with a small denominator. Type a fraction instead and it works the other way, giving the decimal with its repeating block marked.

Worked example: 2.375

The calculator opens with 2.375.

  1. Place value. There are three digits after the point, so 2.375 is 2375 thousandths: 2375/1000.
  2. Greatest common divisor. Both numbers divide by 125 (2375 = 125 × 19 and 1000 = 125 × 8), and 19 and 8 share no other factor.
  3. Simplify. 2375 ÷ 125 = 19 and 1000 ÷ 125 = 8, so 2.375 = 19/8.
  4. Mixed number. 19 ÷ 8 = 2 remainder 3, so 19/8 = 2 3/8.

As a percentage it is 237.5%. Since 8 is a power of 2, 2 3/8 inch is already a mark on a tape measure, so rounding to the nearest 1/16 inch changes nothing. The continued fraction of 19/8 is [2; 2, 1, 2], whose convergents 2, 5/2, 7/3 and 19/8 approach the value from alternate sides.

Terminating decimals

A decimal that stops is a fraction with a power of 10 underneath. One decimal place means tenths, two means hundredths, three thousandths, and so on: 0.7 = 7/10, 0.45 = 45/100, 0.125 = 125/1000. The only work is reducing the fraction, and the fastest way is to divide by the greatest common divisor in one step rather than cancelling 5s and 2s one at a time. Because 10 = 2 × 5, the denominator of a terminating decimal in lowest terms is always a product of 2s and 5s, such as 8, 20, 40 or 125.

Negative decimals keep their sign: −0.75 = −3/4. A decimal greater than 1 can be shown as an improper fraction (19/8) or a mixed number (2 3/8); both are correct, and which one you need depends on the context. Recipes and measurements use mixed numbers; algebra usually prefers improper fractions because they are easier to multiply.

Repeating decimals

When a decimal repeats forever, place value alone can't finish the job, because there is no last digit. The algebra method, taught in OpenStax Prealgebra, removes the endless part by subtraction. For 0.1(6), the brackets marking the 6 that repeats:

  • Let x = 0.1666…
  • Multiply by 100 to move one repeat past the point: 100x = 16.666…
  • Multiply by 10 so only the repeating part is after the point: 10x = 1.666…
  • Subtract: 90x = 15, so x = 15/90 = 1/6.

The general rule packs this into one line. If the digits before the repeat are a (f digits long) and the repeating block is b (p digits long), the fraction is (ab − a) ÷ (10^(f + p) − 10^f), where ab means the digits written side by side. For 1.2(34): (234 − 2) ÷ (1000 − 10) = 232/990 = 116/495, plus the whole number 1, which gives 611/495.

You can type repeats in brackets or with an ellipsis. "0.272727…" is read as 0.(27) because the block 27 appears at least twice at the end. "0.12…" has no repeated block, so the last digit is taken to repeat, giving 0.1(2) = 11/90. If that is not what you meant, use brackets to be explicit.

Fractions to decimals

Dividing the numerator by the denominator gives the decimal. The calculator does exact long division and watches the remainders: as soon as a remainder comes back, the digits from that point repeat. That is how it knows 1/7 = 0.(142857) and 5/12 = 0.41(6) without guessing from a rounded number on screen.

Rounding to tape-measure fractions

Drawings and CNC output give decimals, but tape measures, rulers and drill sets use fractions of an inch with denominators 2, 4, 8, 16, 32 or 64. To convert, multiply by the denominator, round to a whole number and reduce: 0.3 × 16 = 4.8, which rounds to 5, so 0.3 inch is about 5/16 inch. The calculator shows how far the rounded mark is from the true value so you can decide whether sixteenths are fine enough or you need 32nds or 64ths. Halfway values round away from zero, the rule most shop references use.

The closest simple fraction

Sometimes you want a fraction that is easy to work with rather than an exact one: a gear ratio, a scale factor or a quick mental estimate. Setting the largest denominator asks for the best fraction under that limit. The calculator uses the continued fraction of the number, a sequence of whole numbers that describes it as nested fractions. Cutting the sequence short gives convergents, and each convergent is closer to the number than any fraction with a smaller denominator. When the next convergent's denominator is too big, the best answer is either the last convergent or a fraction in between called a semiconvergent, and the calculator compares both exactly. This is the same method as walking the Stern–Brocot tree, and it agrees with Python's limit_denominator.

Things to watch

  • Typed digits are exact. 0.1 is exactly 1/10 here. Computer floating point stores 0.1 as a slightly different binary number, which is why some tools return a 16-digit numerator over 2⁵⁵ instead of 1/10.
  • Rounded inputs give rounded fractions. If you copy 0.333333 from a screen, you get 333333/1000000, not 1/3. Mark the repeat or use the denominator limit.
  • Very long periods are cut short. A fraction such as 1/9967 can have a period thousands of digits long; past 1,000 digits the calculator shows the first 1,000 followed by an ellipsis.

More questions

Why do some fractions give repeating decimals?

A fraction in lowest terms has a terminating decimal only when its denominator is built from 2s and 5s, the prime factors of 10. Any other prime in the denominator, such as 3 in 1/6 or 7 in 1/7, means the long division never comes out even. The remainders can only take values below the denominator, so one of them must come back, and from then on the digits repeat.

How long can the repeating part be?

For 1/n the repeating block is at most n − 1 digits long. 1/7 repeats every 6 digits, 1/17 every 16 and 1/97 every 96. The length always divides n − 1 when n is a prime other than 2 or 5, a result that goes back to Gauss.

Is 0.33 the same as 1/3?

No. 0.33 is exactly 33/100, a little less than 1/3. Only the endlessly repeating 0.333… equals 1/3. If you type 0.33, the calculator gives 33/100; set the largest denominator to 10 and it shows 1/3 as the closest simple fraction, off by 1/300.

Can a decimal like 3.14159 be turned into an exact fraction?

Yes. Every decimal you can write down with a finite number of digits is a fraction: 3.14159 = 314159/100000. What it cannot do is represent π exactly, because π is irrational and its digits never end or repeat. That is why the calculator also offers the closest fraction under a denominator limit, such as 22/7 or 355/113.

Why does my tape measure show 5/16 when the drawing says 0.3 inch?

Tape measures are marked in binary fractions of an inch: halves, quarters, eighths and sixteenths, sometimes 32nds. 0.3 inch falls between 4/16 (0.25) and 5/16 (0.3125), and 5/16 is closer. The difference, 0.0125 inch or about a third of a millimetre, is below what a tape can show.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy