Continued Fraction Calculator

Turn a decimal or a fraction into its continued fraction, list the convergents that approximate it, and see whether the expansion ends.

1 Fill in the boxes

2 Your answer

Your answer shows here as you type.

How to use the Continued Fraction Calculator

  1. Type a decimal such as 3.14159 or a fraction such as 355/113. Negative values are allowed.
  2. Set the maximum number of terms to show, up to 30.
  3. Read the continued fraction, the convergents and the decimal value. A terminating expansion means the number is rational.

Frequently asked questions

What is a continued fraction?

A continued fraction writes a number as a0 + 1/(a1 + 1/(a2 + ...)), usually shown as [a0; a1, a2, ...]. Every rational number has a finite expansion, and irrational numbers such as pi or the square root of 2 have endless ones.

How is a continued fraction calculated?

Take the integer part of the number, subtract it, invert the remainder, and repeat. For a fraction p/q this is the Euclidean algorithm on p and q, and it stops when the remainder is zero.

What are convergents?

Convergents are the fractions made by cutting a continued fraction after each term. They are the best rational approximations for their denominator size, and they alternate between sitting above and below the true value.

Why does pi have an endless continued fraction?

Pi is irrational, so its expansion never terminates. It begins [3; 7, 15, 1, 292, ...], and the terms show no repeating pattern.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.