Math
Decimal to Fraction Converter
Convert any decimal to a fraction. Exact for terminating decimals, best rational approximation for repeating or irrational values. Mixed form included.
Convert a decimal to a fraction
Try 0.5, 1.25, 0.333333, or 3.14159265358979.
Caps the search. Default 10,000.
How many trailing digits repeat.
Fraction
5/8
Pretty: 5/8
Decimal in
0.625
Match
Exact
Error
0
Frequently Asked Questions about the Decimal to Fraction Converter
How does the converter turn a decimal into a fraction?
For terminating decimals, the converter reads the digits you typed, scales by the matching power of 10, then divides out the greatest common divisor. So 0.625 becomes 625/1000 and reduces to 5/8 exactly. If the resulting denominator would exceed your cap, the converter falls back to a continued-fraction algorithm that walks the best rational approximations and stops at the one whose denominator stays within your limit.
What does the max denominator setting control?
It caps how large the bottom number of the fraction can be. The default is 10,000. A low cap like 10 gives you a simple approximation, so pi becomes 22/7. Raise the cap and the converter can reach tighter fits like 355/113, which matches pi to six decimal places. Lower the cap when you want a fraction that is easy to work with by hand.
Why is the result marked as an approximation?
Not every decimal has an exact match within your denominator cap. Irrational numbers like pi and square roots, and repeating decimals you entered as truncated values (like 0.33333 without using the repeating-digits option), cannot be written as a small exact fraction. The converter picks the closest rational within your cap and shows the absolute rounding error so you can judge whether it is close enough for your purpose.
When should I use the repeating digits option?
Use it when you typed a truncated repeating decimal and want the exact underlying fraction. Set the repeating digits count to the length of the block that repeats at the end, so 0.166666 with 1 repeating digit gives 1/6 instead of treating those digits as the terminating value 83333/500000. The converter applies the standard repeating-decimal identity, (all digits minus the non-repeating digits) divided by a string of 9s followed by 0s, and treats the result as exact.
How are mixed numbers and negative values handled?
When a reduced fraction has a whole part and a leftover remainder, the converter also shows it as a mixed number. For example, 1.25 becomes 5/4 with mixed form 1 1/4, while a whole-number result like 4/2 stays 2. Negative inputs keep their sign throughout: -0.5 gives -1/2, and -1.75 gives -7/4 with mixed form -1 3/4. Zero always returns 0/1.