Fraction to Decimal Calculator

Convert any fraction n/d to its decimal form, including detection of repeating decimals.

Inputs

Result

Loading calculator…

How to use this calculator

  • Enter the numerator and denominator.
  • Read the decimal — terminating or repeating.
  • Hover the steps for the long-division process.

About this calculator

Every fraction has a decimal form that either terminates or repeats. The denominator (in lowest terms) determines which: if its only prime factors are 2 and 5, the decimal terminates; otherwise it repeats. This calculator does long division and tracks remainders to detect the repeat cycle, then displays it with parentheses.

How it works — the formula

decimal = numerator ÷ denominator Terminating when the simplified denominator has only 2 and 5 as prime factors Otherwise periodic with period dividing φ(denominator) (Euler's totient)

Long division gives the decimal expansion of any rational number. The expansion terminates exactly when the reduced denominator has no prime factors other than 2 and 5 (because 10 = 2 × 5). For all other rationals the expansion is eventually periodic, with the period length dividing φ(d), the totient of the reduced denominator. Irrational numbers have non-repeating, non-terminating decimal expansions.

Worked examples

Example 1
Terminating decimal
Inputs:
3/8
Output:
3 ÷ 8 = 0.375 (denominator 8 = 2³ → terminates)
Example 2
Periodic decimal
Inputs:
1/7
Output:
0.̅142857̅ — period of 6 digits (φ(7) = 6)
Example 3
Mixed numerator
Inputs:
7/4
Output:
1.75 (terminates; denominator 4 = 2²)

Limitations

  • Floating-point representation can introduce small artifacts at the 15th–16th significant digit (IEEE 754 double precision); shown decimals here use the exact rational value.
  • Periodic expansions are written with an over-bar over the repeating block; an unmarked decimal of finite display length is an approximation, not a proof of termination.
  • Improper fractions can be presented as either a single decimal or a "whole + fractional" mixed form; both are mathematically equivalent.
  • A denominator of zero is undefined.

Conversion is exact arithmetic for rational inputs; display rounding is cosmetic and does not change downstream computation.

Frequently asked

Why do some fractions repeat?+
Because base 10 only "terminates" for fractions whose simplified denominator has prime factors of just 2 and/or 5. Anything else (3, 7, 11, …) creates a remainder cycle.
How is the repeating block notation read?+
0.1(6) means 0.1666… — the digit (or digits) inside the parentheses repeat indefinitely.
How long can the repeating block be?+
At most one less than the denominator. So 1/7 has at most 6 repeating digits — and indeed 1/7 = 0.(142857), exactly 6.
Does the calculator handle negative fractions?+
Yes — sign is computed from numerator and denominator and applied to the result.
Can I round the answer?+
Use a regular calculator if you want a fixed-decimal-places result. This tool gives the exact mathematical answer.

Related calculators

More tools you might like

Hand-picked tools that pair well with this one — same audience, same intent.