What This Calculator Does
Despite the "rounding" name, this tool is really a Decimal to Fraction Calculator. You enter a single decimal number and it converts that value into the closest fraction, then reduces that fraction to its simplest form. It is a fast way to turn awkward decimals like 0.625 or 0.4 into clean fractions you can use in recipes, measurements, woodworking, or math homework.
The Only Input You Need
- Decimal Number – type any decimal value (for example 0.75, 0.333, or 2.5). Text that is not a valid number is read as 0.
How the Formula Works
The calculator searches for the best matching fraction by testing every denominator from 1 up to 1000. For each denominator it rounds decimal × denominator to the nearest whole number to get a candidate numerator, then measures the error against your original value.
$$\text{Fraction} = \frac{n}{d} = \frac{\text{Decimal} \times d}{d}, \quad \text{simplified by } \gcd(n, d)$$
$$\begin{gathered} \text{Fraction} = \frac{n}{d} = \frac{n / \gcd(n,d)}{\,d / \gcd(n,d)\,} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} d &= \text{denominator}, \; 1 \le d \le 1000 \\ n &= \operatorname{round}\!\left(\text{Decimal} \times d\right) \\ &\quad \text{first } d \text{ with } \left|\text{Decimal} - \tfrac{n}{d}\right| < 10^{-6} \end{aligned} \right. \end{gathered}$$
- If the error drops below 0.000001, that fraction is accepted immediately as an exact match.
- Otherwise it keeps the fraction with the smallest error found across all denominators.
Once it has a numerator and denominator, it finds the greatest common divisor (GCD) using Euclid's algorithm and divides both numbers by it. The result is the simplified fraction. It also flags whether the answer is a whole number (denominator of 1) and whether any simplification actually took place.
Worked Example
Enter 0.625. Testing denominators, the calculator finds that \(0.625 \times 8 = 5\) exactly, giving the fraction \(\tfrac{5}{8}\) with essentially zero error. The GCD of 5 and 8 is 1, so the fraction is already in lowest terms. The result is 5/8.
Try 0.5 instead. The first match is \(\tfrac{1}{2}\), the GCD is 1, and the answer is the clean fraction 1/2. Enter 0.4 and you get \(\tfrac{2}{5}\), since \(\tfrac{2}{5} = 0.4\) exactly after simplifying \(\tfrac{4}{10}\).
Frequently Asked Questions
Why does the denominator stop at 1000? The search is capped at 1000 to keep results clean and fast. For non-terminating decimals like 0.333, this returns the very close fraction 1/3 rather than an unwieldy number.
What happens with a number greater than 1? It still works. Entering 2.5 produces 5/2, an improper fraction. The tool does not split it into a mixed number automatically.
Are my results always simplified? Yes. Every result is divided by its greatest common divisor, so you always get the fraction in its lowest terms.