Fraction to Decimal Converter (and Back)
Convert any fraction to a decimal, including repeating decimals, or convert a decimal back into a simplified fraction, instantly and exactly.
How this converter turns fractions into decimals, and decimals back into exact fractions
A fraction is really an unfinished division problem. 3/4 means 3 divided by 4, and the moment you actually do that division you get 0.75. This tool performs that division digit by digit the way you were taught in school, long division, and it keeps going until either the remainder hits zero or it detects the division has started repeating itself. The reverse direction, decimal to fraction, works by exact integer arithmetic rather than approximation, so the result is always mathematically precise.
Both directions run entirely in your browser with plain JavaScript number handling. Nothing you enter is transmitted anywhere.
Fraction to decimal: long division with cycle detection
The seen object maps each remainder value to the digit position where it first appeared. Since a denominator can only produce a limited number of distinct remainders (fewer than the denominator itself), a repeat is mathematically guaranteed for any fraction that does not terminate, which is why the loop is safe from running forever. A hard cap of 2,000 digits exists purely as a safety net for pathological cases.
| Fraction | Division steps | Decimal result |
|---|---|---|
| 3/4 | 3.0 ÷ 4 = 0.75, remainder 0 | 0.75 (terminates) |
| 1/3 | 10 ÷ 3 = 3 r1, repeats forever | 0.(3) |
| 5/6 | Non-repeating 8, then repeating 3 | 0.8(3) |
| 7/8 | Terminates after 3 digits | 0.875 |
Decimal to fraction: exact integer arithmetic, not rounding
Going the other direction avoids floating point altogether. A terminating decimal like 0.75 is read as a plain fraction over a power of 10, 75/100, and then reduced. The reduction step uses the Euclidean algorithm to find the greatest common divisor of the numerator and denominator, then divides both by it. For 75/100 the GCD is 25, so the fraction collapses to 3/4.
For a repeating decimal, you can check the has a repeating part option and enter the repeating digits directly. The tool then applies the standard algebraic trick for converting a repeating decimal to a fraction: multiply the decimal by a power of 10 to shift the repeating block, subtract the original, and the repeating part cancels out entirely, leaving a clean ratio of two whole numbers.
Euclidean simplification
Every fraction produced by the decimal to fraction mode is passed through a GCD reduction before display, so you never see an answer like 50/100 when 1/2 is correct.
Mixed number display
When the simplified numerator exceeds the denominator, the tool also shows the equivalent mixed number, such as 1 3/4 instead of only 7/4.
Where repeating decimals actually come from
A fraction terminates in base 10 only when its denominator, once fully reduced, has no prime factors other than 2 and 5, the two prime factors of 10 itself. That is why 1/4, 1/5, and 1/8 all terminate cleanly, but 1/3, 1/6, and 1/7 do not. This is not a quirk of the tool, it is a property of base 10 itself, and the same fraction that repeats forever in decimal might terminate cleanly in a different base.
- Repeating decimal covers the math behind why certain fractions never terminate in base 10.
- Euclidean algorithm is the reduction method used to simplify the resulting fraction to lowest terms.
- Long division is the manual arithmetic process this tool automates digit by digit.
Conversions worth doing by hand
Converting a recipe measurement like 2 and 1/3 cups into a decimal for a kitchen scale, checking a woodworking or machining tolerance expressed as a fraction of an inch against a digital caliper reading, verifying a textbook answer when you get a repeating decimal you were not expecting, and turning a stock or currency fraction back into a clean ratio for a spreadsheet formula. Anywhere measurement units switch between fractional and decimal conventions, this kind of exact conversion matters more than a rounded approximation.
FAQ: Fraction to Decimal Converter
A fraction in lowest terms produces a terminating decimal only if its denominator’s prime factors are limited to 2s and 5s (like 4, 8, 20, or 50), since those are the prime factors of 10. Any other denominator, like 3, 6, 7, or 11, will always produce a repeating decimal, which is exactly what this tool detects automatically through its long division simulation.
The digits inside the parentheses repeat forever, so 0.1(6) means 0.1666666…, with the 6 continuing indefinitely. This is a standard mathematical notation (sometimes shown with an overline instead of parentheses) for representing repeating decimals exactly, rather than rounding them to a fixed number of digits.
The standard technique multiplies the repeating decimal by a power of 10 large enough to shift the decimal point past one full repeating cycle, then subtracts the original value to cancel out the infinitely repeating part, leaving a simple equation to solve. This tool automates that algebra for you, just check the repeating box and enter the repeating digits.
This is a genuine mathematical fact, not a rounding approximation: using the same algebraic technique this tool applies, if x = 0.999…, then 10x = 9.999…, and subtracting x from 10x gives 9x = 9, so x = 1. The repeating decimal 0.(9) and the whole number 1 are two different ways of writing the exact same value.
Add the whole number part to the fraction’s decimal equivalent: 2 1/2 means 2 + 1/2, and since 1/2 = 0.5, the result is 2.5. This tool handles mixed numbers directly by combining a whole number field with the numerator and denominator, so you don’t need to convert to an improper fraction first.
An unsimplified fraction like 50/100 is mathematically equal to 1/2, but 1/2 is considered the ‘proper’ or simplest form and is generally expected in math coursework and everyday use. This tool automatically divides both the numerator and denominator by their greatest common divisor so you always get the cleanest possible representation.
From the blog
Number theory, lightly
Base systems, primes and the statistics people get wrong.