Skip to main content

Continued Fraction Calculator — Expansion + Convergents

Expand a decimal or fraction into a continued fraction [a0;a1,a2,...] with the convergents that best approximate it — browser-only

  • Runs locally
  • Category Calculator
  • Best for Getting a realistic range before a purchase, plan, workout, or schedule decision.

Type a number like 3.245, a fraction like 415/93, or an integer.

Continued fraction
[3;4,12,3,1]

Decimal → iterative, capped at the term limit

Bracket notation: the integer part, then a semicolon, then the rest.

Convergents

Each row is the best rational approximation using the terms so far.

Stepp / qDecimalError vs input
03/13.000000000-2.45e-1
113/43.2500000005.00e-3
2159/493.244897959-1.02e-4
3490/1513.2450331133.31e-5
4649/2003.245000000exact

What this tool does

Turn any decimal or fraction into its continued fraction and read off the convergents, the run of best rational approximations that the expansion produces step by step. A fraction like 415/93 expands exactly through the Euclidean algorithm to [4;2,6,7]; a decimal like 3.14159265 expands by the iterative floor-and-reciprocal method and starts [3;7,15,1,...], which is where the famous 22/7 and 355/113 approximations to pi come from. Each convergent row shows the fraction p/q, its decimal value and the signed error against your input, so you can see the approximation tighten with every term. The convergent recurrence runs on BigInt, so a deep expansion stays exact instead of drifting on float rounding. Type an integer, a decimal, or num/den, set a term limit for decimals, and copy the whole result. Everything runs in your browser with a shareable link. No upload.

Tool details

Input
Numbers
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
Shareable URL state
Key settings are encoded in the URL so another person can reopen the same setup.
Performance budget
Initial JS <= 9 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Calculator · Student
Category and role tags drive related tools, internal links, and quick fit checks.

How to use

  1. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 3. Copy / Download

    Copy the result or download to disk in one click.

How Continued Fraction Calculator fits into your work

Use it for fast estimates, comparisons, and planning numbers before you make the final call.

Calculation jobs

  • Getting a realistic range before a purchase, plan, workout, or schedule decision.
  • Comparing scenarios by changing one input at a time.
  • Turning rough assumptions into a number you can discuss.

Calculation checks

  • Double-check units, dates, rates, and rounding assumptions.
  • Treat health, finance, tax, and legal outputs as planning aids, not professional advice.
  • Save the inputs that produced an important result so you can reproduce it later.

Good next steps

These links move the current task into a more complete workflow.

  1. 1 GCD & LCM Calculator GCD + LCM of any list of integers — Euclidean steps, prime factorization, prime-factor table — exact BigInt math, browser-only Open
  2. 2 Decimal to Fraction Converter Turn 0.75 into 3/4, type 0.(3) to get 1/3, or flip a fraction back to its decimal with the repeating block marked Open
  3. 3 Fraction Calculator Add, subtract, multiply, divide fractions — auto-reduced, with steps, mixed ⇄ improper ⇄ decimal — browser-only Open

Real-world use cases

  • Find the simplest fraction that approximates a decimal

    You measured a ratio as 1.61803 and want a clean fraction for a CAD drawing or a gear train. Expand it and the convergents hand you 13/8, 21/13, 34/21 in rising accuracy. Pick the one whose denominator your shop can cut, and you have the tightest possible fraction for that tooth count, not a denominator you picked at random.

  • Reproduce the classic pi approximations for a lesson

    Teaching where 22/7 and 355/113 come from? Type 3.14159265, watch the expansion start [3;7,15,1], and the convergent table prints 22/7, 333/106 and 355/113 with the error against pi shrinking from 1e-3 to 1e-7 row by row. The signed error column makes the jump from 333/106 to 355/113 land as a concrete number, not hand-waving.

  • Build gear ratios and clock trains

    Horologists and machinists need two gears whose tooth ratio matches a target like the sidereal day factor 1.0027379. The convergents give ratios of small integers you can actually manufacture — 366/365 is right there — so you trade a tiny accuracy loss for a buildable pair instead of chasing a 7-digit ratio no gear can hold.

  • Sanity-check a continued fraction by hand

    You ran the Euclidean algorithm on paper and got [4;2,6,7] for 415/93. Paste 415/93 here, confirm the coefficients match, and read the convergents 4/1, 9/2, 58/13, 415/93 to verify the last one folds back exactly to your starting fraction — the built-in proof that your hand expansion was right.

Common pitfalls

  • Writing the bracket with a comma after the integer part. The convention puts a semicolon there, giving [3;7,15] rather than [3,7,15]. The semicolon flags that 3 is the whole-number part and 7, 15 are the reciprocal layers. Tools and textbooks that use a comma everywhere are still correct in value, but the semicolon form is what you will see in number-theory references.

  • Expecting a finite expansion from a decimal that only approximates an irrational. Feeding 3.14159265 gives a finite continued fraction because you typed a rational truncation of pi, not pi itself. The deep coefficients reflect your digits, not pi, so do not read the tail of a truncated-decimal expansion as the true continued fraction of the irrational.

  • Confusing the convergent with the next coefficient. A coefficient like 15 is one term of the expansion; the convergent 333/106 is the fraction you get by truncating there. Reading the coefficient list as if it were the approximations gives nonsense — the approximations live in the convergent column, built by the recurrence, not in the bracket.

Privacy

Every step — parsing your input, the Euclidean expansion, the iterative decimal method and the BigInt convergent recurrence — is plain JavaScript that runs in your browser tab. The number or fraction you enter never leaves the page and nothing is logged. The one caveat: the shareable URL encodes your input in the query string, so a share link pasted into chat records that value in the recipient server's access log. If the figure is sensitive, use the copy button and paste the text instead of the URL.

FAQ

Tool combos

Folks in your role tend to reach for these alongside this tool.

Made by Toolora · 100% client-side · Updated 2026-05-30