Fraction to Decimal Calculator
Convert any fraction n/d to its decimal form, including detection of repeating decimals.
Result
- Decimal (truncated)0.3
- Repeats?Yes โ repeats from position 1
- Whole part0
Step-by-step
- Long-divide 1 by 3: whole part = 0, remainder = 1.
- Continue dividing the remainder ร 10 by the denominator until remainder repeats or reaches 0.
- 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
- Inputs:
- 3/8
- Output:
- 3 รท 8 = 0.375 (denominator 8 = 2ยณ โ terminates)
- Inputs:
- 1/7
- Output:
- 0.ฬ 142857ฬ โ period of 6 digits (ฯ(7) = 6)
- 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.