Counting & Number Theory
Decimal to Best Bounded-Denominator Fraction Calculator
Approximate an exact entered decimal by a rational number with a chosen denominator limit.
How the calculation works
Convert decimal digits to an exact integer fraction, then form continued-fraction convergents. At the denominator limit compare the last convergent with the boundary semiconvergent using exact cross-products. Choose the smaller absolute error, with the convergent selected on a tie.
Worked example
Example inputs — Ordinary decimal, no exponent notation: 3.141592653589793; Largest allowed positive denominator: 1000. Expected results — Approximation numerator: 355; Approximation denominator: 113; Approximation decimal value: 3.14159292; Exact-decimal absolute approximation error: 2.667641893e-07.
Assumptions and limits
Exact integer arithmetic is used for counts and integer results. Computation limits keep this browser tool responsive. Specify whether objects/groups are distinguishable and whether order matters; different conventions count different outcomes. Ordinary decimal syntax, at most 90 characters and 30 fractional digits. The decimal text is treated exactly, rather than as a binary floating-point value. Numerator/denominator are exact strings; displayed decimal value/error use floating-point presentation. Denominator is bounded, not required to equal the limit.
Reference and further reading
Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.
Related calculators
- Modular Power, Inverse & Bezout Calculator
- Chinese Remainder & Compatible Congruences Calculator
- Prime Factorization, Divisors & Totient Calculator
- Exact Integer Base 2–36 Converter
- Selections, Permutations & Repetition Count Calculator
Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.