Decimal to Fraction Calculator
Convert a decimal into its equivalent fraction in lowest terms — a terminating decimal like 0.75, a repeating decimal like 0.1666..., or go the other direction and turn any fraction into its exact decimal form, complete with the repeating part called out. See the place-value reasoning, the repeating-decimal algebra trick, and the long-division logic behind every answer.
Background
Every decimal is secretly a fraction. A terminating decimal like 0.75 is just a fraction over a power of ten — 75/100 — waiting to be reduced. A repeating decimal like 0.333... isn't "infinite" in a scary way; it's the result of a division that never produces a remainder of zero, so the digits loop forever, and a bit of algebra can undo that loop and recover the exact fraction. Whether a fraction terminates or repeats in the first place comes down to one thing: what prime factors live in its denominator. Only 2s and 5s produce a clean ending — anything else forces a repeat.
How to use this calculator
- Choose Terminating Decimal when your number stops after a fixed number of digits, like 0.75 or 3.125.
- Choose Repeating Decimal when a block of digits repeats forever, like 0.333... or 0.1666... — split the number into its non-repeating lead-in (if any) and its repeating block.
- Choose Fraction → Decimal to go the other way: enter a numerator and denominator and see the exact decimal, with any repeating digits clearly marked.
- Click Calculate to see the visual breakdown, a full step-by-step solution, and a callout explaining what the result actually means.
How decimal ↔ fraction conversion works
A terminating decimal's denominator is always a power of ten — one digit after the point means tenths (denominator 10), two digits means hundredths (100), and so on. Reduce that fraction by dividing out the greatest common factor to get lowest terms.
A repeating decimal can be uncovered with algebra: let x equal the decimal, multiply by powers of ten to shift the repeating block into alignment, then subtract. The infinite repeating tails cancel exactly, leaving a simple whole-number equation to solve for x.
Going from a fraction to a decimal is just long division. Whether it terminates or repeats depends entirely on the reduced denominator's prime factors: only factors of 2 and 5 lead to a terminating decimal, because only they divide evenly into a power of ten.
Any other prime factor in the denominator (3, 7, 11, 13, ...) guarantees a repeating decimal, because the remainders in long division can only take on finitely many values before one repeats — and once a remainder repeats, the digit sequence from that point on repeats too.
The repeating block can never be longer than (denominator − 1) digits, by the pigeonhole principle: there are only that many possible nonzero remainders, so a repeat is forced by then at the latest.
A repeating decimal made entirely of 9s always equals a clean terminating value one step up — 0.999... equals exactly 1, and 0.4999... equals exactly 0.5. This isn't rounding; it's the same number written two different ways.
Formulas & Equations Used
Terminating decimal: a decimal with d digits after the point equals (all digits as one integer) / 10d, then reduced by the greatest common factor.
Repeating decimal: with n non-repeating digits and r repeating digits after the point, the fractional part equals (A − B) / (10n+r − 10n), where A is the non-repeating and repeating digits read together as one integer, and B is just the non-repeating digits.
Fraction to decimal: divide the numerator by the denominator; track each remainder during long division, and stop when a remainder repeats (marking the start of the repeating block) or reaches zero (terminating).
Termination rule: a reduced fraction terminates if and only if its denominator has no prime factors other than 2 and 5.
Example Problems & Step-by-Step Solutions
Example 1 — Terminating decimal
Convert 0.75 to a fraction.
Step: two digits after the point → 75/100. Reduce by the GCF, 25.
Result: 0.75 = 3/4.
Example 2 — Repeating decimal
Convert 0.1666... to a fraction.
Step: let x = 0.1666.... Then 100x − 10x = 16.666... − 1.666... = 15, so 90x = 15.
Result: x = 15/90 = 1/6.
Example 3 — The 9s identity
Convert 0.999... to a fraction.
Step: let x = 0.999.... Then 10x − x = 9.999... − 0.999... = 9, so 9x = 9.
Result: x = 9/9 = 1 — exactly, not approximately.
Example 4 — Fraction to decimal, terminating
Convert 5/8 to a decimal.
Step: 8 = 2³, only factors of 2, so it terminates. Long division: 5.000 ÷ 8.
Result: 5/8 = 0.625.
Example 5 — Fraction to decimal, repeating
Convert 1/7 to a decimal.
Step: 7 is prime and isn't 2 or 5, so it repeats. Long division cycles through 6 remainders before repeating.
Result: 1/7 = 0.142857142857..., repeating every 6 digits.
Frequently Asked Questions
How do I know if a fraction will terminate or repeat?
Reduce the fraction first, then look at the denominator's prime factors. If the only primes present are 2 and 5 (in any combination, like 8 = 2³ or 20 = 2²·5), the decimal terminates. If any other prime shows up — 3, 7, 11, 13, and so on — the decimal repeats forever.
Why does multiplying by powers of ten help with repeating decimals?
Multiplying by 10 shifts every digit one place to the left. If you shift by exactly the right amount, the repeating block in one copy lines up perfectly with the repeating block in another copy. Subtracting then cancels the infinite tail completely, leaving a plain finite equation.
Is 0.999... really exactly equal to 1, or just really close?
Exactly equal — there's no fraction, and no real number, strictly between 0.999... and 1. It looks like two different numbers only because it's two different ways of writing the same one, the same way 1/2 and 2/4 are the same number written differently.
How long can a repeating block get?
At most one digit shorter than the denominator. A fraction with denominator 7 can repeat for up to 6 digits (and 1/7 actually achieves that maximum); a fraction with denominator 17 can repeat for up to 16 digits. Smaller denominators cap the repeat length tightly.
What if there are non-repeating digits before the repeating part?
That happens whenever the denominator mixes 2s or 5s with other primes — like 1/6 = 1/(2·3). The factor of 2 forces a finite lead-in digit, and the factor of 3 forces the repeat that follows. The calculator's Repeating Decimal mode handles that lead-in with its own "non-repeating digits" field.
Can every terminating decimal also be written as a repeating decimal?
Yes — any terminating decimal can be rewritten by dropping the last digit by 1 and appending an infinite string of 9s, e.g. 0.75 = 0.74999.... It's a true equality, just an unusual and rarely useful way to write it.