- Choose digits mode for a fixed output length, or choose time challenge for a bounded run.
- Run a small preset first so you can confirm the display mode, copy flow, and TXT export.
- Open Pi Digit Lab when you want to search for one sequence, jump to an index, or copy only one selected span.
Classroom presets: confirm the flow with a short output first, then choose a worksheet-sized run or a short time challenge.
This page counts digits after the decimal point. The output always starts with 3..
The challenge keeps the largest checkpoint whose calculation finishes completely within the chosen budget.
Auto shows the full block up to 5,000 digits and switches to a head/tail preview above that point.
Digits after the decimal point
Output
No output yet.
How it works
The calculator uses the Chudnovsky series 1/π = 12 Σ(k=0…∞) (-1)^k (6k)! (13591409 + 545140134k) / ((3k)! (k!)^3 640320^(3k+3/2)). It evaluates the series with recursive binary splitting, JavaScript BigInt integer arithmetic, and an integer square root. It calculates 18 guard digits beyond the request and then truncates—rather than rounds—to the requested prefix. It does not read the answer from a stored table of pi digits.
The same calculation core normally runs in a Web Worker to keep the page responsive; if workers are unavailable, it runs on the main thread. The time challenge accepts only checkpoints that finish completely by the deadline.
Worksheet and export prep
- Algebra worksheets
Use the generated prefix as source material for pattern-search questions or short reflection tasks.
- Graph paper generator
Prepare paper when students should annotate a digit block, mark ranges, or organize notes by hand.
- Quick charts
Summarize elapsed time, generated digits, or checkpoint results for a one-page class handout.
FAQ
Which formula does this program use to calculate pi?
It uses the Chudnovsky series, evaluated with recursive binary splitting, BigInt integer arithmetic, and an integer square root. It computes 18 extra guard digits before truncating to the requested length; it does not look up digits in a stored table.
Does this page represent pi exactly?
No. Pi has infinitely many decimal digits, so no finite string represents pi itself exactly. This page performs a high-precision calculation and returns the requested decimal prefix.
What does first n digits mean here?
The input counts digits after the decimal point. If you enter 100, the result is 3. followed by 100 digits.
Why does the page switch to head and tail after 5,000 digits?
Rendering a huge text block is unnecessary for most sessions, so the page previews the beginning and the end by default while keeping the full text for copy and TXT export.
What is the time challenge mode?
The page tries checkpoints in increasing sizes and keeps the largest one whose calculation finishes completely within the selected time. A result that finishes after the deadline is not accepted.
What happens when I press stop?
In digits mode, the calculation is cancelled and no incomplete result is shown. In time challenge mode, the current calculation is cancelled and the most recent completed checkpoint remains available, if there is one.