We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Free online continued fraction calculator. Expand any real number or fraction into a continued fraction, or convert a sequence back into a rational number. Instantly calculate convergents and best rational approximations.
Limit: 30. Decimal inputs have limited precision, so too many terms might not be accurate.
Continued Fraction Representation
x = a₀ + 1 / (a₁ + 1 / (a₂ + 1 / (a₃ + ...)))
Standard notation: [a₀; a₁, a₂, a₃, ...], representing the integer quotients at each step.
Tip: A common approximation for π is [3; 7, 15, 1, 292], which corresponds to the fraction 355/113.
* Max terms reached, continued fraction truncated. Increase max terms for higher precision.
| n | p / q | Decimal |
|---|---|---|
| 0 | 3 / 1 | 3 |
| 1 | 22 / 7 | 3.1428571429 |
| 2 | 333 / 106 | 3.141509434 |
| 3 | 355 / 113 | 3.1415929204 |
| 4 | 103993 / 33102 | 3.141592653 |
| 5 | 104348 / 33215 | 3.1415926539 |
| 6 | 208341 / 66317 | 3.1415926535 |
| 7 | 312689 / 99532 | 3.1415926536 |
| 8 | 833719 / 265381 | 3.1415926536 |
| 9 | 1146408 / 364913 | 3.1415926536 |
| 10 | 4272943 / 1360120 | 3.1415926536 |
| 11 | 5419351 / 1725033 | 3.1415926536 |
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
A simple continued fraction writes a value as a whole-number part followed by repeated reciprocals: [a₀; a₁, a₂, …] means a₀ + 1/(a₁ + 1/(a₂ + …)). Each finite truncation gives a rational approximation called a convergent. The calculator can expand a decimal or an integer fraction, or rebuild a rational number from a coefficient list, and displays the intermediate convergents.
pₙ = aₙpₙ₋₁ + pₙ₋₂
qₙ = aₙqₙ₋₁ + qₙ₋₂
The nth convergent is pₙ/qₙ.
For example, 355/113 has the finite expansion [3; 7, 16]. Its convergents are 3/1, 22/7, and 355/113. This example can be checked by applying the recurrence one coefficient at a time. NIST’s Digital Library of Mathematical Functions describes finite continued fractions and their convergents.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Select number-to-continued-fraction mode and enter a finite decimal such as 3.1415926. The decimal field is parsed as a JavaScript number, so it represents a finite floating-point value rather than an exact symbolic constant.
Choose a positive maximum number of terms. The default is 12 and the allowed calculation is capped at 30. If the expansion reaches the cap, the result is truncated; inspect the last convergent and reported absolute error.
Switch to fraction input and provide integer numerator and nonzero integer denominator, for example 355 and 113. This follows the integer remainder process and ends in a finite expansion.
In the reverse mode enter a sequence such as 3; 7, 16. The first coefficient may be any integer; later coefficients must be positive integers. The result shows the reduced final fraction, decimal display, and convergents.
When the goal is to preserve an exact rational value, use numerator and denominator rather than typing a rounded decimal approximation of it.
Use cases
See how the tool fits into real work and everyday tasks.
Use 355/113 to see how each added coefficient changes the convergent, then reverse the coefficient list to confirm the final fraction.
For a measured ratio, compare successive convergents and their denominators. Select one that fits the required tolerance and acceptable denominator size.
Q&A
Find concise answers to common questions and confusing cases.
A decimal is processed as a finite floating-point value, and the number of coefficients is capped at the chosen limit (up to 30). A capped expansion is a finite approximation; use the error and last convergent to judge it.
Enter integer numerator and nonzero denominator in fraction mode. A decimal rounded from that fraction may encode a slightly different value.
Use integers separated by spaces, commas, or semicolons. Every coefficient after the first must be greater than zero; remove brackets or other text if they are not parsed as separators.
Notes
Review scope, result limitations, and important precautions before use.
Decimal mode does not accept radicals or symbolic expressions; it parses a decimal number and performs a finite expansion. Increasing the number of terms cannot restore precision that was absent from the entered decimal. For exact arithmetic, use integer fraction mode. Decimal displays are rounded for readability, so use the fraction and coefficient list when checking exact results.
Related
Discover related tools, collections, and available API capabilities.