Pi Number Generator

Enter how many decimal places you want, from 1 to 10,000, and get pi to exactly that length with a copy button.

3.14

Type how many decimal places you want, press Generate, and the page prints pi to exactly that length, from 3.1 up to 3.14159… with ten thousand digits after the point. The result sits in a card with a copy button, so a 1,000-digit string goes straight into a spreadsheet, a memorization app or a program without you selecting it by hand. The page loads showing 3.14, which is what most people came for.

Where the digits come from

Nothing is computed in your browser. The page stores the first 10,000 decimal places of pi as a fixed string and slices it to the length you ask for. We checked that stored string against an independent computation using Machin's formula at high precision, and all 10,000 decimals match. So the output is not an approximation from a floating-point library (which would go wrong after 15 or 16 digits); it is the real expansion, digit for digit, as far as the tool goes.

The limit is 10,000 decimal places. Enter a bigger number and you still get 10,000. Enter 0 or leave the box empty and the form will not submit.

Pi at a few lengths

These are exactly what the tool prints for the given inputs, so you can check your own copy against them.

Decimal placesOutput
23.14
53.14159
103.1415926535
253.1415926535897932384626433
503.14159265358979323846264338327950288419716939937510
1003.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679

Landmarks inside the first 10,000 digits

  • The first 0 appears at the 32nd decimal place.
  • The 1,000th decimal place is a 9.
  • The Feynman point, a run of six 9s in a row, starts at decimal place 762. Ask for 767 places and the string ends in 999999.
  • Common fractions used before calculators: 22/7 agrees with pi to two decimal places (3.142857…), and 355/113 agrees to six (3.14159292…). The Random Fraction Generator is handy if you want to test other ratios against the true value.
  • Double-precision floating point, the format most programming languages use, holds pi to about 15 significant digits. Anything beyond that from a calculator or a spreadsheet is noise; use this page instead.

What people do with a long string of pi

  • Memorization practice. Learners work in blocks of 10 or 50 digits. Generate exactly the block you are on, copy it, and paste it into a flashcard app.
  • Pi Day activities. Print 100 or 314 digits for a classroom chain, a bulletin board, or a recitation contest on March 14.
  • Testing code. If you wrote a program that computes pi, compare its output against the first few hundred digits here. It is faster than tracking down a reference table.
  • Digit games and pseudo-random draws. The digits of pi pass every statistical test for randomness that has been run on them, so a slice like places 500 to 510 works as an arbitrary sequence for a raffle or a puzzle. For a true random draw, though, use a purpose-built tool such as the Random 6 Digit Number Generator.
  • Precision checks in engineering or physics homework. You rarely need more than 10 places, but having 20 or 30 on hand settles arguments about rounding.

Pi is not random and not prime, but if you need actual random numbers of a particular kind, the Random Prime Number Generator, Random Binary Number Generator and Random Hex Generator are in the same family; see all number generators.

Frequently asked questions

Is this a random pi generator?

No. Pi has one fixed decimal expansion, so there is nothing to randomize. The tool shows the genuine digits of pi, cut off at the number of places you ask for. Searches for "random pi" usually mean either this (a chosen number of true digits) or a random number generator, which is a different tool.

Can I get more than 10,000 digits?

Not here. The page stores the first 10,000 decimal places and stops there. Entering a larger number returns the full 10,000.

Are the digits accurate?

Yes. The stored digits were compared against an independent high-precision computation and all 10,000 decimal places agree. There is no rounding on the last digit; the string is simply truncated.

Does the count include the 3?

No. The number you enter is the number of digits after the decimal point. Entering 2 gives 3.14 (two decimal places), entering 100 gives the 3, the point and 100 digits.

Why does my calculator show fewer digits?

Calculators and spreadsheets store pi as a floating-point number with roughly 15 to 17 significant digits. Beyond that they either stop or print garbage. This page uses a stored string of the true digits, so it is not limited in that way.