Digits of π
This page can procedurally calculate digits of pi using a nifty thing called the Chudnovsky series. Pi goes on forever so your birthday might be in here somewhere.
Precision
How many digits do you want to compute? Be warned that larger quantities may take a while.
Computation
Ready.
- Digits
- 0
- Elapsed
- -
- Terms summed
- -
- Guard digits
- 20
Digit browser
Compute some digits to browse them.
Skip to a specific digit
The Bailey-Borwein-Plouffe formula computes a single digit of π directly, in O(n log n) time and constant memory, touching none of the digits before it.
These are base-16 digits, not decimal. That distinction is the whole point: BBP-type formulas exist for base 2 and base 16, and no base-10 formula of this kind is known. That is why the decimal browser above has to compute every digit up to the one you want, while this panel can jump straight to digit ten million.
Cross-check against the decimal expansion
Compute at least 61 decimal digits to run the cross-check.
How this works (as explained by Claude)
"Decimal digits come from the Chudnovsky series evaluated by binary splitting over BigInt. Binary splitting collapses the whole partial sum into one rational number, so the work becomes a balanced tree of very large multiplications and exactly one division — which suits V8, whose BigInt multiplication switches to Karatsuba, Toom-Cook and finally FFT as operands grow.
The truncated series and the final integer division both corrupt the last few digits, so every computation runs 20 digits wider than requested and the guard band is discarded. Checked by agreement: 1,000 against 2,000 digits, and 10,000 against 10,500.
Everything runs in a Web Worker, so the interface never freezes. Cancelling terminates the worker outright — a multi-second BigInt multiply cannot be interrupted from the inside.
No digits are fetched from anywhere. There is no API call, no data file, and no dependency beyond the browser's own arithmetic."
- Claude