Continued Fraction Expansion Calculator

Enter a number and term count to see its continued fraction expansion.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

A continued fraction represents a real number as a nested sequence a₀ + 1/(a₁ + 1/(a₂ + 1/(a₃ + ...))), written compactly as [a₀; a₁, a₂, a₃, ...]. It's computed by repeatedly taking the integer part of the number, then continuing the expansion on the reciprocal of the remaining fractional part — a process closely related to the Euclidean algorithm for finding a greatest common divisor.

Continued fractions are prized in number theory, cryptography, and numerical analysis because truncating the expansion early produces the best possible rational approximation of a number for a given denominator size — this is how ancient and modern mathematicians derived accurate fractions for π (like 355/113) and how continued fractions play a role in Diophantine equation solving and certain integer-factorization and lattice-based cryptographic attacks.

This calculator expands a real number you enter into its continued fraction terms up to a chosen count, and also shows the resulting rational convergent — useful for math students, number theory enthusiasts, and programmers implementing rational approximation algorithms.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators