Decimal to Fraction Calculator
Convert a finite decimal string exactly to a simplified fraction without binary floating-point rounding.
Convert a decimal to a fraction
Enter a finite decimal with up to 12 decimal places. Decimal point and decimal comma are supported.
Result
How to convert a decimal to a fraction
A finite decimal can be written exactly as an integer divided by a power of ten, then simplified.
Place-value method
For 0.125, remove the decimal point to get 125 and use 1000 as the denominator because there are three decimal places: 125/1000.
Simplifying with gcd
Divide numerator and denominator by their greatest common divisor. For 125/1000, the GCD is 125, giving the simplified fraction 1/8.
Worked examples
0.5 becomes 5/10 and simplifies to 1/2. 1.25 becomes 125/100 and simplifies to 5/4, or 1 1/4 as a mixed number.
Negative decimals
The sign is preserved. For example, -2.75 becomes -275/100 and simplifies to -11/4.
Trailing zeros
Trailing zeros do not change the mathematical value. 0.500 and 0.5 both simplify to 1/2.
Finite vs repeating decimals
This calculator accepts finite decimal notation. A repeating decimal describes infinitely many digits and cannot be represented by typing only a finite truncated string.
Limitation: repeating decimals are not entered as finite strings
If you type 0.333, the calculator converts exactly 333/1000. It does not infer that you intended the repeating value one third.
Common mistakes
- Using 10 as the denominator regardless of the number of decimal places.
- Converting through binary floating point before constructing the fraction.
- Assuming a truncated repeating decimal is the exact repeating value.
Frequently asked questions
Is the conversion exact?
Yes. The input digits are processed as text and converted using integer arithmetic before reduction.
Can I use a decimal comma?
Yes, provided the input uses one consistent decimal separator.