Fraction to Decimal Calculator

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

Inputs

Result

1/3
0.(3)
Repeating block has 1 digit.
  • Decimal (truncated)0.3
  • Repeats?Yes โ€” repeats from position 1
  • Whole part0
Note โ€” Decimal terminates iff reduced denominator has no prime factors other than 2 and 5; otherwise period length divides ฯ†(denominator).

Step-by-step

  1. Long-divide 1 by 3: whole part = 0, remainder = 1.
  2. Continue dividing the remainder ร— 10 by the denominator until remainder repeats or reaches 0.
  3. A remainder repeated โ†’ repeating decimal: 0.(3).

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

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.

Related calculators

More tools you might like