Decimal to Fraction Converter

How to Use This Tool

  1. Enter any decimal number in the input field (positive or negative)
  2. Click "Convert to Fraction" to see the result
  3. The tool will automatically simplify the fraction to its lowest terms
  4. For repeating decimals, enter as many decimal places as needed for accuracy

Examples

  • 0.5 = 1/2
  • 0.75 = 3/4
  • 0.333 ≈ 1/3
  • 1.25 = 5/4
  • 2.6 = 13/5

Related Fraction Tools

  • Fraction to Decimal Converter
  • Fraction Simplifier
  • Mixed Number to Improper Fraction Converter
  • Fraction Calculator (Add, Subtract, Multiply, Divide)
  • Percentage to Fraction Converter

How the conversion actually works

This converter doesn't just read off decimal places and slap a power of 10 underneath — it runs a continued-fraction algorithm, which finds the smallest denominator that reproduces your decimal to within 1e-10. That matters because a naive "count the digits" approach on something like 0.142857142857 would produce an ugly fraction with a huge denominator, while the continued-fraction method correctly lands on 1/7.

Worked example

Enter 0.625:

For an improper case, entering 1.25 gives numerator 5, denominator 4 (5/4), and because 5 > 4 the tool also displays the mixed number 1 1/4.

Where approximation kicks in

If your input has more than 10 digits after the decimal point, the tool flags the result as an approximation rather than an exact match — this catches long repeating decimals like 0.3333333333333 that a computer can never represent exactly as a JavaScript floating-point number in the first place.