Decimal to Fraction Calculator
Type a decimal. For a repeating decimal, put the repeating digits in brackets, like 0.1(6), or choose how many digits at the end repeat.
Decimal
Write a repeating block in brackets, like 0.(3) for 0.333…, or type 0.1666… and the repeat is detected. Negative numbers work too.
Step by step
How to use the decimal to fraction calculator
Type the decimal. If it ends (like 0.375), that's all. If digits repeat forever, mark them: put the repeating block in brackets, as in 0.1(6) for 0.1666…, or type the digits and pick how many at the end repeat. Typing a few repeats followed by “...” (0.142857142857...) also works. You get the fraction in lowest terms, the mixed number for values above 1, and the full working.
How to convert a decimal to a fraction
Terminating decimals: write the digits over 10, 100, 1000… (one zero per decimal place), then divide the top and bottom by their greatest common divisor (GCD). 0.375 = 375/1000, and GCD(375, 1000) = 125, so 0.375 = 3/8.
Repeating decimals: call the number x. Multiply x by a power of 10 that moves one full repeating block to the left of the decimal point, multiply it again by the power of 10 that moves only the non-repeating digits, then subtract. The repeating tails cancel, leaving a whole-number equation to solve for x.
Worked example
Convert 0.1666… (0.1(6)) to a fraction. Let x = 0.1666…. The 6 repeats after one non-repeating digit. Multiply by 100: 100x = 16.666…. Multiply by 10: 10x = 1.666…. Subtract: 100x − 10x = 16 − 1, so 90x = 15 and x = 15/90. GCD(15, 90) = 15, so 0.1666… = 1/6.
FAQ
Why is 0.999… equal to 1?
Let x = 0.999…. Then 10x = 9.999…, and 10x − x = 9, so 9x = 9 and x = 1. There is no gap between 0.999… and 1: they are two ways of writing the same number.
Can every decimal be written as a fraction?
Every decimal that ends or repeats can. Decimals that go on forever without repeating, like π = 3.14159… or √2 = 1.41421…, are irrational and have no exact fraction. Entering a rounded value such as 3.14 gives the fraction of that rounded number (157/50).
How do I write a negative decimal as a fraction?
Convert the number without its sign, then put the minus sign in front: −2.375 = −19/8, or −2 3/8 as a mixed number.
Is my input stored or sent anywhere?
No. CalculatorFly does the conversion in your browser with WebAssembly, using exact whole-number arithmetic. Nothing leaves your device.