Pi Digits Generator: Digits of π, e and Golden Ratio
Generate up to 10,000 decimal places of π, e or the golden ratio φ, calculated exactly in your browser, grouped in blocks of 5 or 10, and look up the digit at any place. Nothing is uploaded.
Calculating…
About the Pi Digits Generator
The Pi Digits Generator prints up to 10,000 decimal places of π, e or φ (the golden ratio) and looks up the digit at any place. The digits are not copied from a stored table: they are calculated in your browser with exact whole-number arithmetic each time you ask, and the first thousand digits of each constant are checked against the published OEIS sequences. You can group the digits in blocks of 5 or 10 for easier reading, copy them, or download them as a text file. Nothing is uploaded.
How to use it
Steps
- Choose a Constant: π, e or φ. π is selected to start.
- Enter the number of Decimal places, from 1 to 10,000. The digits update as you type; large requests are calculated in a background thread so the page stays responsive.
- Pick No grouping, Groups of 5 or Groups of 10. Groups are separated by a space after the decimal point.
- To find one digit, enter its place under Look up the digit at decimal place. Place 1 is the first digit after the point, so place 1 of π is 1 and place 762 is the first of the six nines known as the Feynman point.
- Use Copy digits or Download to keep the result.
Privacy
Every digit is computed on your device. Nothing is sent to our servers, and nothing is stored once you leave the page.
How the digits are calculated
Fixed-point arithmetic
Each constant is computed as a very large whole number: the constant multiplied by 10 to the power of the requested places plus ten guard digits. The guard digits absorb rounding in the last terms of the series, and the result is then cut back to the requested places, so every digit shown is a true digit, not a rounded one.
π by Machin's formula
John Machin found this formula in 1706 and used it to compute the first 100 digits:
Each arctangent is summed with the Gregory series, which converges quickly for such small arguments.
e and φ
Euler's number is the sum of the reciprocals of the factorials, e = 1 + 1/1! + 1/2! + 1/3! + …, and the terms shrink so fast that 10,000 places need only about 3,250 of them. The golden ratio is φ = (1 + √5) / 2; its square root is taken exactly with Newton's method on whole numbers.
Limits
Up to 10,000 decimal places are available for each constant. All three constants are irrational, so their digits never end or repeat.
Related tools
For other famous sequences, try the Fibonacci Generator, whose ratios of consecutive terms approach φ, and the Prime Number Generator. To pick random digits instead, use the Random Number Generator.
Open-source credits
- The generator is implemented in-house and uses no third-party library. Arithmetic uses the browser's built-in
BigIntfrom ECMA-262. - π follows Machin's arctangent formula (1706) with the Gregory series; e follows the factorial series; φ uses Newton's integer square root.
- The tests compare the first 1,000 digits of each constant with the OEIS b-files of A000796 (π), A001113 (e) and A001622 (φ).
Frequently asked questions
Are the digits stored or calculated?
They are calculated in your browser every time, using whole-number arithmetic on numbers with thousands of digits. Automated tests compare the first 1,000 digits of π, e and φ with the published OEIS sequences A000796, A001113 and A001622.
Does the count include the 3 before the decimal point?
No. The number you enter is the count of decimal places, the digits after the point. Asking for 5 places of π gives 3.14159, and the lookup field uses the same numbering, so place 1 is the first digit after the point.
What is the Feynman point in π?
It is the run of six consecutive nines that starts at decimal place 762 of π. Look up place 762 to see the first of them. Richard Feynman reportedly joked that he would like to recite π up to that point and end with "nine nine nine nine nine nine and so on".
Why does the page calculate in the background for large requests?
Ten thousand places of π take tens of milliseconds on a desktop computer but can take much longer on an older phone. Requests above 2,000 places run in a Web Worker so that typing and scrolling stay smooth while the digits are computed.
What is the golden ratio φ?
The golden ratio is (1 + √5) / 2, about 1.6180339887. It is the positive number that is one more than its reciprocal, and it is the limit of the ratio of consecutive Fibonacci numbers, which is why it appears in so many growth patterns.