Skip to content
Mathematics & StatisticsLocal · Stays on device

Rational Approximation Tool

Turn a decimal or constant such as π into the best fraction for a maximum denominator or tolerance, with its continued fraction.

  • Decimals, Expressions such as pi or sqrt(2)
  • Free to use
  • No sign-up or watermark
rational-approximation-toolOn this device
DecimalsExpressions such as pi or sqrt(2)
Open Rational Approximation Tool

About this tool

Enter a decimal like 0.4142 or an expression like pi, e or sqrt(2) and choose either a maximum denominator or a tolerance. You get the closest fraction with a denominator no larger than your limit (π → 355/113 for 1,000), or the fraction with the smallest denominator inside ± the tolerance (π ± 0.002 → 22/7), with its decimal value and error.

The continued fraction [a₀; a₁, a₂, …] and the table of convergents show how each better approximation arises. Decimal input is treated exactly (0.333 is exactly 333/1000); expressions are evaluated in double precision and the page notes that later convergents then describe the rounded value. All fraction arithmetic is exact. Everything is calculated in your browser; nothing you enter is uploaded.

  1. Input

    Your details

    Decimals, Expressions such as pi or sqrt(2)

  2. Processing

    Processed in this browser

    Instant, in-browser. Nothing is uploaded.

  3. Output

    Your result

    Shown instantly, ready to copy or export

Local processing pipelineExact rational arithmetic (BigInt fractions) + mathjs (Apache-2.0, restricted evaluator)

How to use it

  1. 1

    Type a decimal or an expression such as pi.

  2. 2

    Choose Maximum denominator or Tolerance and set the limit.

  3. 3

    Read the best fraction, its error and the convergents table.

Zero-upload architecture

How to use Rational Approximation Tool for free, with no upload

Free, with no sign-up or watermark · Your details stay on your device

  1. 1

    Open Rational Approximation Tool

    Launch the app. There is nothing to install and no account to create.

  2. 2

    Work through it

    Choose Maximum denominator or Tolerance and set the limit.

  3. 3

    Get your result

    Read the best fraction, its error and the convergents table.

All 31 maths tools
  • Local

    Fraction Calculator

    Add, subtract, multiply and divide fractions and mixed numbers exactly, with step-by-step working and repeating-decimal conversion.

    Open tool
  • Local

    Base Conversion Calculator

    Convert whole numbers and fractions between any bases from 2 to 36, with repeating digits and two’s-complement views.

    Open tool
  • Local

    Ratio Calculator

    Simplify ratios (even with decimals), solve a:b = c:x, scale recipe or plan quantities and split a total by a ratio.

    Open tool
  • Local

    Prime Factorization Tool

    Find the prime factors of a whole number up to 40 digits, plus all divisors, the divisor count and sum, and Euler’s totient.

    Open tool