How to use this calculator
Convert a finite decimal into a reduced fraction, with a maximum denominator you choose.
- Enter Decimal value, Maximum denominator. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
How this calculation works
Find a reduced fraction whose denominator does not exceed your chosen limit. Terminating decimals may be exact; other values are approximations within the available denominator range.
Inputs and meanings
value— Decimal value- Enter a finite decimal number.
maxDenominator— Maximum denominator- Set the largest allowed denominator.
Formula and method
Find integers p and q such that |x − p/q| is within tolerance and q ≤ qₘₐₓ; reduce p/q by their greatest common divisor.
A continued-fraction approximation searches simple rational representations first. The denominator limit controls how complex the result can become.
Worked example
Convert a finite decimal into a reduced fraction, with a maximum denominator you choose.
For 0.375, the reduced fraction is 375/1000 = 3/8. Its decimal value is exactly 0.375, so the approximation error is zero.
Assumptions and limits
The result is an approximation for repeating or non-terminating decimals. Increase the denominator limit for a closer fit; exact binary floating-point input is not guaranteed.
Frequently asked questions
Will every decimal convert to an exact fraction?
Terminating decimals have an exact fraction with a power-of-ten denominator. Repeating or rounded decimals may require an approximation.
What does the maximum denominator do?
It limits the size of the denominator and favors simpler fractions; a larger limit can fit the decimal more closely.
Why might 0.1 not be shown as an exact binary value?
Computers store many decimal fractions approximately in binary floating point. The page reports a rational approximation within the chosen denominator limit.
How do I use the Decimal to fraction calculator?
Enter Decimal value, Maximum denominator. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Decimal to fraction?
Convert a finite decimal into a reduced fraction, with a maximum denominator you choose. For 0.375, the reduced fraction is 375/1000 = 3/8. Its decimal value is exactly 0.375, so the approximation error is zero.
Read our calculation methodology.