Continued Fractions Calculator โ€” Expand, Convergents & Visualisation

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

15
1e-10

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

6

Convergents

Convergents are the best rational approximations derived from the continued fraction. They appear in the “Convergents” tab.

Continued Fraction Results

Summary
Convergents
Details

Continued fraction expansion

[3; 7, 15, 1]
โ‰ˆ 3.14159
Input number
3.14159
Length (terms)
4
As fraction (last convergent)
355/113
Error
2.7e-7

Convergents (best rational approximations)

kTerm akConvergent pk/qkDecimalError

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