Decimal to Fraction Calculator
A decimal written as a fraction in lowest terms, including recurring decimals done exactly.
Results
What this tool does
Every decimal that ends is a fraction, and so is every decimal that repeats — those are the only two kinds of fraction there are. Terminating ones are easy: the digits over the right power of ten, cancelled down. Recurring ones need the old algebraic trick of multiplying by a power of ten and subtracting so the endless tail cancels itself, which turns 0.8333… into exactly 5/6 and 0.142857… into exactly 1/7. This page does both, cancels to lowest terms, gives the mixed number where there is one, and converts back so you can check.
Formula
x = n ÷ 10ᵈ · (10^(d+r) − 10^d) x ∈ ℤ · n ÷ GCD(n, m) over m ÷ GCD(n, m)
Variables
| Symbol | Meaning | Unit |
|---|---|---|
value | The decimal | — |
repeating | How many final digits repeat | — |
FR | As a fraction | — |
MX | As a mixed number | — |
NU | Numerator | — |
DE | Denominator | — |
BK | The fraction back as a decimal | — |
ER | Gap to what you typed | — |
SI | Was it cancelled down? | — |
GC | Divided top and bottom by | — |
DC | Decimal places it read | — |
Worked example
- The decimal0.375
- How many final digits repeat0
- As a fraction3 / 8
- As a mixed number3 / 8
- Numerator3
- Denominator8
- The fraction back as a decimal0.375000000000
- Gap to what you typed0.00000000000000
- Was it cancelled down?Yes
- Divided top and bottom by125
- Decimal places it read3
Frequently asked questions
How do I handle a recurring decimal?
Type enough of the digits to make the pattern clear, then say how many of the trailing digits repeat. For 0.8333… type 0.8333333333 and set one repeating digit; the page then does the standard algebraic trick — multiply by ten to the power of the total decimals, multiply again by ten to the power of the non-repeating ones, subtract, and the repeating tail cancels exactly — which gives 5/6 rather than an approximation. For 0.142857142857… set six repeating digits and you get exactly 1/7.
Why is the error not always zero?
For a terminating decimal it is exactly zero, because the fraction and the decimal are the same number. For a recurring one it cannot be: you typed a finite number of digits, so what you typed is not quite the repeating decimal you meant. The fraction the page returns is the exact one your pattern describes, and the tiny error shown is the gap between that exact value and the truncated decimal you actually entered — which is evidence the conversion worked, not that it failed.