What this calculator does
This tool computes the mathematical constant pi by summing one of three famous rapidly-converging infinite series term by term: Ramanujan's first 1914 series, Ramanujan's second 1914 series, or the Chudnovsky brothers' 1987 series. These series are remarkable because each added term contributes many correct decimal digits at once, so just a handful of terms reproduce pi to full double-precision accuracy. This is pure mathematics and applies universally with no regional rules.
How to use it
Pick a formula from the dropdown, set the maximum number of terms to add, and choose how many decimal digits to display. The calculator adds terms n = 0, 1, 2, ... and stops early once the running value of pi no longer changes, which usually happens within a few terms. Because the engine uses IEEE-754 double arithmetic, about 15-16 significant digits are reliably accurate regardless of the display setting.
The formula explained
Ramanujan 1 builds the reciprocal of pi: a constant prefactor \(\frac{\sqrt{8}}{9801}\) multiplies an infinite sum whose nth term combines the factorial ratio \(\frac{(4n)!}{(4^n n!)^4}\) with the linear factor \((1103 + 26390n)\) divided by \(99^{4n}\). The full series is $$\frac{1}{\pi} = \frac{\sqrt{8}}{9801} \sum_{n=0}^{\infty} \frac{(4n)!}{(4^n n!)^4} \cdot \frac{1103 + 26390n}{99^{4n}}$$ Once the sum \(S\) is known, pi is recovered as \(\frac{1}{\text{prefactor} \times S}\). Chudnovsky works similarly but converges even faster, adding roughly 14 digits per term: $$\frac{1}{\pi} = 12 \sum_{n=0}^{\infty} \frac{(-1)^n (6n)!\,(13591409 + 545140134n)}{(3n)!\,(n!)^3\,(640320^3)^{n+1/2}}$$
Worked example
Using Ramanujan 1 with only the n=0 term: the prefactor is \(\frac{\sqrt{8}}{9801} = 0.000288583\ldots\), and the n=0 term is \(1 \times 1103 = 1103\). So $$\frac{1}{\pi} = 0.000288583 \times 1103 = 0.31831\ldots,$$ giving \(\pi = 3.14159273\), already correct to about six decimals. Adding the n=1 term brings pi to \(\pi = 3.14159265358979\), correct to roughly 16 digits.
FAQ
Why does increasing the digits dropdown not show more accuracy? Double-precision floating point only carries about 15-16 significant digits; reaching more requires arbitrary-precision arithmetic.
How many terms do I really need? For full double precision, Ramanujan 1 needs about 2 terms and Chudnovsky just 1-2 terms.
Which series is fastest? Chudnovsky converges fastest and is the algorithm used for modern record pi computations.