Continued Fraction Calculator

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

Input

10

Examples

Enter a number above and click Compute.

Copied!

Summary

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

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-13 · Reviewed by Nham Vu