Decimal to Fraction Calculator: How to Convert
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator converts a decimal number into its exact fraction form, showing the numerator and denominator in simplest terms. You enter any decimal value, and it returns the equivalent fraction, along with the steps used to find it. The tool handles terminating decimals, repeating decimals, and negative values, giving you a clear result you can use in math homework, carpentry, or recipe scaling.
Formula
The conversion relies on place value. For a terminating decimal, write the digits after the decimal point as the numerator and a power of 10 as the denominator, then simplify. For a repeating decimal, use the fact that 0.999… equals 1 and that a repeating block of length n can be expressed as the block divided by 10n − 1.
Let d be the decimal input. If d has k digits after the decimal point and does not repeat, then:
Fraction = (d × 10k) / 10k
Then divide both numerator and denominator by their greatest common divisor (GCD). For a repeating decimal like 0.333…, let x = 0.333…, multiply by 10 to get 10x = 3.333…, subtract to get 9x = 3, so x = 1/3.
Worked Example
Using the default value 0.75:
- Count decimal places: 0.75 has 2 digits after the decimal.
- Write as 75/100.
- Find GCD of 75 and 100, which is 25.
- Divide both by 25: 75 ÷ 25 = 3, 100 ÷ 25 = 4.
- Result: 3/4.
The calculator shows 3/4 as the simplified fraction. The steps display the intermediate fraction 75/100 and the simplification.
How the Calculator Works
The calculator first checks if the decimal is terminating or repeating. For terminating decimals, it multiplies by the appropriate power of 10 to remove the decimal point, then simplifies using the GCD. For repeating decimals, it applies the algebraic method described above. Negative decimals are handled by converting the absolute value and then attaching the negative sign to the numerator. The result is always shown as a proper or improper fraction, never as a mixed number unless you request it separately.
The tool also detects common repeating patterns like 0.333…, 0.666…, and 0.142857…, but it works for any repeating sequence. If you enter a decimal that has both a non-repeating and repeating part, such as 0.1666…, the calculator separates the parts and applies the formula correctly.
How to Choose the Right Input
For most everyday conversions, you enter the decimal as you see it. But there are a few choices to make:
- Terminating vs. repeating: If the decimal ends, like 0.5 or 2.75, the calculator treats it as a terminating decimal. If it repeats, like 0.333…, you can type the repeating part with an ellipsis or use the repeating bar notation if your keyboard allows it. The calculator recognizes common repeating patterns.
- Negative values: Enter a minus sign before the number. The calculator outputs a negative fraction.
- Zero: Entering 0 returns 0/1, which is the standard representation.
- Large decimals: The calculator handles up to 12 decimal places without losing accuracy. Beyond that, rounding may occur.
If you have a fraction and want a decimal, this calculator does not do that directly—you would use the inverse operation, but this page focuses on decimal-to-fraction.
Common Mistakes and How to Avoid Them
One frequent error is forgetting to simplify. For example, 0.5 can be written as 5/10, but the simplest form is 1/2. Always divide by the GCD. Another mistake is misidentifying a repeating decimal. A decimal like 0.125 is terminating (1/8), but 0.125125… is repeating (125/999). The calculator distinguishes these if you enter the repeating part clearly.
Unit mix-ups matter in real applications. If you are converting a measurement like 0.75 inches to a fraction for woodworking, the fraction 3/4 inch is correct. But if the original number is in centimeters, the fraction is still 3/4 cm—the units do not change the numeric conversion. Be careful with time: 0.5 hours is 1/2 hour, not 30 minutes as a fraction of an hour (which is 1/2 anyway, but the units are different).
Rounding errors can occur if you enter a rounded decimal. For instance, 0.333 is not exactly 1/3; it is 333/1000. The calculator gives the exact fraction for the number you type, so if you need the fraction for a repeating decimal, type the repeating pattern explicitly.
Limits of the Formula
The conversion is exact for terminating decimals and for repeating decimals with a finite repeating block. It cannot handle irrational numbers like π or √2, because they have infinite non-repeating decimal expansions. If you enter a decimal approximation of an irrational number, the calculator returns a fraction that is close but not mathematically equal. For example, 3.14159 is a terminating decimal and converts to 314159/100000, which is not π.
The calculator also assumes the decimal is in base 10. If you are working with binary or hexadecimal fractions, you need a different conversion process. The formula only works for standard decimal notation.
Practical Applications
Decimal-to-fraction conversion is common in construction and woodworking, where measurements are often given in fractions of an inch. A decimal like 0.375 inches becomes 3/8 inch, which is easier to read on a tape measure. In cooking, recipes may list 0.25 cups, which is 1/4 cup. In mathematics education, students convert decimals to fractions to understand rational numbers and to perform operations that require a common denominator.
Engineers and machinists frequently convert decimals to fractions when working with imperial units. For example, a drill bit size of 0.25 inches is 1/4 inch. The fraction form is often more intuitive for physical measurements.
Frequently Asked Questions
How do you convert 0.75 to a fraction?
Write 0.75 as 75/100, then simplify by dividing both numbers by 25 to get 3/4. The calculator does this automatically.
What is 0.333… as a fraction?
0.333… with the 3 repeating is exactly 1/3. The algebraic method: let x = 0.333…, multiply by 10 to get 10x = 3.333…, subtract x to get 9x = 3, so x = 1/3.
Can the calculator convert mixed numbers like 1.5?
Yes, 1.5 converts to 3/2 as an improper fraction. If you want a mixed number, you can write it as 1 1/2, but the calculator outputs the improper fraction by default.
Why is 0.999… equal to 1?
Because 0.999… is a repeating decimal that equals 1. Using the same method: let x = 0.999…, multiply by 10 to get 10x = 9.999…, subtract to get 9x = 9, so x = 1. The calculator will show 1/1 for 0.999… if you enter it as repeating.
What if I enter a decimal with many digits?
The calculator handles up to 12 decimal places. For more digits, it rounds the input to 12 places, which may introduce a tiny error. For exact conversion of long decimals, you would need to know if they terminate or repeat.
Does the calculator work for negative decimals?
Yes, it converts the absolute value and then adds a negative sign to the numerator. For example, -0.25 becomes -1/4.
Related
Formula used
in d | Decimal number | - | 0.75 | 0 out frac | Fraction | - | decimal_to_fraction(d) | 0 out steps | Steps | - | decimal_steps(d) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.