Decimal to fraction: the fast, exact way
Core idea
Write the decimal as a fraction over a power of 10, then reduce by the GCD. For repeating parts, use the standard algebra trick to get an exact ratio.
How it works
- Terminating decimal: if x = 2.75 → 275/100 → reduce by GCD(275,100)=25 → 11/4.
- Pure repeating: if x = 0.(3), let y = 0.333…; 10y−y=3 ⇒ y=3/9=1/3.
- Mixed repeating: 0.1(6) → separate non‑repeating (0.1) and repeating (0.0(6)) parts or use powers of 10 to eliminate the repeat, then reduce.
- Keep the sign: apply minus to the numerator only in the final fraction.
Sanity checks
- Back‑convert: numerator ÷ denominator ≡ original decimal (within display rounding).
- Lowest terms: GCD(|num|, den) must be 1.
- Denominator is positive; move any sign to the numerator.
Shortcuts
- Halves/quarters/eighths: 0.5 → 1/2, 0.25 → 1/4, 0.125 → 1/8.
- Tenths/hundredths/thousandths: read place value and reduce (e.g., 0.75 → 75/100 → 3/4).
- Common repeats: 0.(3)=1/3, 0.(6)=2/3, 0.(09)=1/11, 0.(142857)=1/7.
Pitfalls
- Rounding the input before conversion (converts the wrong value).
- Forgetting to reduce; 75/100 is not in simplest form.
- Dropping the sign or putting it on the denominator.
Micro‑examples
- 0.125 → 125/1000 → 1/8
- 2.75 → 275/100 → 11/4 → 2 3/4
- −0.6 → −6/10 → −3/5
- 0.(3) → 1/3
- 0.1(6) → 1/6
Mini‑FAQ
- Are repeating decimals exact fractions? Yes—always rational.
- Which denominator do I use? A power of 10 for terminating; 9/99/999… for repeats.
- Do I need mixed numbers? Optional; value is identical to the improper form.
Action tip
Enter a decimal, choose repeating if needed, then copy the simplified fraction or mixed number. Use the examples list to build intuition fast.