Decimal to Fraction Converter

Convert decimal numbers to exact fractions.

Runs locally in your browser

Your inputs are processed locally in your browser and are not uploaded or stored by us.

Convert decimal numbers into exact, simplified fractions without losing precision.

How to convert a decimal to a fraction

  1. Enter your exact decimal value into the text field.
  2. The calculator will interpret your exact keystrokes as a raw fraction using powers of 10.
  3. The raw fraction is then mathematically simplified to its lowest terms.

Decimal to Fraction Conversion Method

Scale = number of digits after the decimal point Denominator = 10^Scale Numerator = integer formed by removing the decimal point

When converting a decimal representation to a fraction, the exact digits entered by the user are the mathematical input. Parsing those digits directly as text avoids introducing binary floating-point approximation before the fraction is constructed.

Converting 0.125

Decimal value0.125
1. Three decimal places means the denominator is 1000 2. The raw fraction is 125 / 1000 3. Divide both by GCD(125, 1000) = 125
Result: 1 / 8

Notes

  • The calculator preserves exact integer relationships within JavaScript’s safe-integer range.
  • The exact numerator and denominator must fit within JavaScript’s safe-integer range. Inputs that would exceed that range are rejected instead of silently rounded.
  • Supported decimal syntax includes standard decimals (123.45), leading dots (.5), explicit signs (+1.25, -0.5), and integers (123). Scientific notation (e.g., 1e3) is intentionally rejected by this exactness tool.
  • Negative zero (-0.0) is mathematically normalized to 0 / 1.
  • Your inputs are processed locally in your browser and are not uploaded or stored by us.