Continued Fractions Calculator
Convert decimals and fractions to continued fractions. View terms, convergents, and a visual bar chart of the expansion. Perfect for number theory, approximations, and mathematical exploration.
Step 1: Number & precision
How continued fractions work
Every real number can be expressed as a0 + 1/(a1 + 1/(a2 + …)). The terms ai are integers. The expansion stops early for rational numbers.
Step 2: Display options
Convergents
Convergents are the best rational approximations derived from the continued fraction. They appear in the “Convergents” tab.
Continued Fraction Results
Continued fraction expansion
Convergents (best rational approximations)
| k | Term ak | Convergent pk/qk | Decimal | Error |
|---|
Recurrence & method
Continued fraction expansion algorithm
Starting with x, set a0 = floor(x), r = x – a0. If r is near zero, stop. Otherwise set x = 1/r and repeat. Terms are integers.
Convergents pk/qk satisfy:
p-2=0, p-1=1; q-2=1, q-1=0;
pk = ak pk-1 + pk-2, qk = ak qk-1 + qk-2.
Explore deeper with our math resources
From number theory to series expansions, our calculators help you learn and solve. Need a custom tool? Get in touch.
Suggest a calculator