Continued Fraction Calculator

Enter a decimal number to see its continued fraction [a0; a1, a2, ...] and the best rational approximations at each convergent.

Use the Continued Fraction Calculator

Input

10

Examples

Enter a number above and click Compute.

Copied!

Summary

A continued fraction expresses a number as a0 + 1/(a1 + 1/(a2 + ...)), where each ai is a non-negative integer called a partial quotient. This calculator computes the partial quotients for any decimal input and lists the convergents — the sequence of rational numbers that get progressively closer to the original value. Convergents are the best rational approximations for a given denominator size, making them useful in gear ratio design, music theory, and approximating irrational numbers like π and φ.

How it works

  1. Enter a decimal number (e.g. 3.14159 or 1.41421).
  2. Choose how many terms (partial quotients) to compute, up to 20.
  3. The calculator repeatedly takes the integer part as the next partial quotient, then inverts the remainder.
  4. Each row in the convergents table shows the running rational approximation p/q.
  5. Copy the notation or any convergent with the copy buttons.

Use cases

  • Approximate π, φ (golden ratio), √2, or any irrational constant as a simple fraction.
  • Find the closest gear ratio from a limited set of tooth counts.
  • Music theory: derive just-intonation intervals from frequency ratios.
  • Cryptography: continued fractions underlie the Wiener attack on RSA.
  • Calendar design: understand why a solar year is approximated as 365 + 1/4 − 1/100 + 1/400.
  • Classroom demonstrations of number theory and Euclidean algorithm connections.

Frequently Asked Questions

Last updated: 2026-06-11 · Reviewed by Nham Vu