Decimal to Fraction Converter
Type a decimal such as 0.375 or 1.25 and get its exact fraction in lowest terms and, when it is above 1, the mixed number: 0.375 is 3/8 and 1.25 is 5/4, or 1 1/4. The decimal is read as written, digit by digit, with whole-number arithmetic, so there is no floating-point error. A second mode finds the closest fraction whose denominator does not exceed a limit you choose, which is how 3.14159 becomes 22/7, 311/99 or 355/113. Repeating decimals are not guessed: 0.333 is exactly 333/1000, not 1/3.
Fraction in lowest terms
3/8
The decimal is read digit by digit: 0.333 is exactly 333/1000, not 1/3. If you meant a repeating decimal, use the closest-fraction mode with a small limit.
How it works
- Choose Exact fraction or Closest fraction.
- Type the decimal with a dot, such as 0.375 or -2.5. In the closest mode, also set the largest denominator you allow.
- Read the reduced fraction, the mixed number and, in the closest mode, how far the fraction is from your decimal.
- Copy the result or try another limit to trade accuracy against a simpler fraction.
What people use it for
Reading a measurement as a fraction
Turn 0.625 inch into 5/8 to pick the right socket, drill bit or board thickness.
Finding a simple fraction for a long decimal
Find the best fraction with a denominator of at most 16 or 64 for a woodworking or sewing size.
Checking homework
See each step: the unreduced fraction, the common factor removed and the reduced result.
Questions
- How does the exact mode work?
- A decimal with k digits after the dot is that number written without the dot, divided by 10 to the power k: 0.375 is 375 ÷ 1000. The page then divides the top and the bottom by their greatest common divisor, here 125, and gets 3/8. For a value above 1 the whole part and the remainder give the mixed number: 1.25 is 125/100 = 5/4 = 1 1/4. All of this is done on the typed digits with whole numbers, so even 30 digits after the dot are exact.
- Why is 0.333 not 1/3?
- Because 0.333 means exactly 333 thousandths, and 1/3 is 0.3333… with the 3 repeating for ever. A page that only sees the digits you typed cannot know whether you meant a repeating decimal, so it does not assume one. If you did, use the closest mode with a small limit: 0.333 with a denominator of at most 10 gives 1/3, and the page shows the small difference.
- How does the closest-fraction mode find its answer?
- It runs the continued-fraction expansion of the decimal, which produces the best fractions step by step, and keeps the last one whose denominator is within your limit. It then compares it with the best in-between fraction (a semiconvergent) that still fits and keeps the one closer to your number, and the last convergent on a tie. For 3.14159 and a limit of 100 the result is 311/99, not 22/7, because 311/99 is closer; the list of steps shows the fractions it passed through.
- What does the page refuse?
- Commas (1,250 could be one thousand or one and a quarter, so use a dot), text, fractions typed as a/b, more than 40 digits, more than 30 digits after the dot, and a limit outside 1 to 1,000,000. An integer such as 7 gives 7/1, and 0 gives 0. A minus sign is kept: -0.375 is -3/8.