Decimal to Fraction Calculator
Exact fractions, recovered by continued fractions.
Work out Decimal to Fraction. Exact fractions, recovered by continued fractions. Handles the cases the shortcuts get wrong.
Lower this to find a simpler near-equivalent.
As a fraction
3/4
This uses the continued fraction expansion rather than the schoolbook method of multiplying by a power of ten. The difference matters for recurring decimals: 0.333333 becomes 1/3 rather than 333333/1000000, and 3.142857 recovers 22/7. A fraction's decimal terminates exactly when its reduced denominator has no prime factors besides 2 and 5 — the primes that divide ten.
How the Decimal to Fraction Calculator works
This uses the continued fraction expansion rather than multiplying by a power of ten, and the difference matters for recurring decimals: 0.333333 becomes 1/3 rather than 333333/1000000, and 3.142857 recovers 22/7.
Also known as: convert decimal to fraction · decimal as a fraction · repeating decimal to fraction · fraction converter
Why not just use a power of ten
The schoolbook method puts the digits over a power of ten and reduces: 0.75 becomes 75/100, then 3/4. That works perfectly for decimals that terminate.
It fails on recurring ones. 0.333333 becomes 333333/1000000, which is close to a third but is not it, and no amount of reducing will get there.
Continued fractions
This page uses the continued fraction expansion instead, which finds the simplest fraction within a tolerance rather than the most literal one.
It recovers 1/3 from 0.333333 and 1/7 from 0.142857. Lowering the maximum denominator finds deliberately simpler approximations — which is how 3.14159 yields 22/7, the classic approximation of π.
A fraction's decimal terminates exactly when its reduced denominator has no prime factors besides 2 and 5, the primes that divide ten. Halves, quarters, fifths and eighths terminate; thirds, sevenths and ninths do not.
Frequently asked questions
How do I convert a decimal to a fraction?
The schoolbook method puts the digits over a power of ten and reduces. That fails on recurring decimals, so this uses continued fractions, which recover 1/3 from 0.333333.
Why does 0.333333 become 1/3 and not 333333/1000000?
Because the continued fraction expansion finds the simplest fraction within a tolerance, and 1/3 is far simpler while being closer to the intended value.
Which decimals terminate?
Those whose reduced denominator has no prime factors besides 2 and 5 — the primes that divide ten. A third recurs; a quarter does not.
What is the largest denominator setting for?
Capping how complex the fraction may get. Lowering it finds a simpler near-equivalent, which is how 3.14159 yields 22/7.
Put this calculator on your own site
Free to use, on any site, commercial or not. Paste this where you want it to appear. It is a plain iframe, so it works in WordPress, Squarespace, Wix, Webflow, Ghost and anything else that accepts HTML.
<iframe src="https://www.thecalclibrary.com/embed/decimal-to-fraction-calculator" width="100%" height="640" style="border:1px solid #e2e8f0;border-radius:12px" loading="lazy" title="Decimal to Fraction Calculator"></iframe>The only condition is that the credit line stays visible. It sits inside the frame, so you do not have to do anything to keep it.