Safekipedia

Approximations of pi

Adapted from Wikipedia · Adventurer experience

Animation showing how random points can help estimate the value of Pi using the Monte Carlo method.

Approximations for the mathematical constant pi (π) have been made for a very long time, and some early guesses were already quite close to the real value. Before the start of the Common Era, people were within 0.04% of the correct value. In Chinese mathematics, this improved to about seven correct decimal places by the 5th century.

Progress was slow until the 14th century, when Madhava of Sangamagrama made approximations correct to eleven and then thirteen digits. Later, Jamshīd al-Kāshī reached sixteen digits. By the early 17th century, mathematicians such as Ludolph van Ceulen reached 35 digits, and by the 19th century, Jurij Vega achieved 126 digits.

The record for hand calculation was set by William Shanks, who correctly calculated 527 decimals in 1853. Since the mid-20th century, electronic digital computers have taken over this work. On December 11, 2025, the current record was set using Alexander Yee's y-cruncher, achieving an amazing 314 trillion (3.14×1014) digits. For more details, see chronology of computation of pi and history of pi.

Early history

The ancient world had many ways to guess the value of pi (π), the ratio of a circle’s circumference to its diameter. Some of the earliest guesses were very close. For example, people in ancient Egypt used the fraction 22⁄7 (about 3.14), which is a little too high. In Babylonian mathematics, pi was often rounded to 3, but one tablet showed a better guess of 25⁄8 (about 3.125).

Later, in Chinese mathematics, mathematicians made even better guesses. By around 263 CE, Liu Hui used shapes with many sides to get pi to about seven decimal places. A few centuries later, around the 5th century, another Chinese mathematician named Zu Chongzhi calculated pi to seven decimal places, which was an amazing achievement for its time.

Middle Ages

Many years passed before new discoveries were made about pi (π). In the 14th century, an Indian mathematician and astronomer named Madhava of Sangamagrama, from the Kerala school of astronomy and mathematics, found special number patterns. These patterns helped calculate pi very accurately.

Madhava used these patterns to find pi to 11 decimal places: 3.14159265359. He even improved his methods to find pi to 13 decimal places.

Later, another Indian mathematician named Bhaskara II used shapes with many sides to approximate pi as 3.141666. After that, a Persian astronomer and mathematician named Jamshīd al-Kāshī calculated pi to 16 decimal places: 3.1415926535897932, by using a shape with a very large number of sides.

16th to 19th centuries

In the late 1500s, a French mathematician named François Viète found a clever way to get closer to the value of pi using something called an infinite product, known as Viète's formula.

Later, a German-Dutch mathematician named Ludolph van Ceulen used a very complex shape with many sides to find the first 35 digits of pi. He was so proud of his work that he had these digits put on his tombstone. Other mathematicians kept finding more digits of pi using clever tricks and formulas. By the mid-1800s, an English mathematician named William Shanks calculated pi to over 500 digits. Some of his later digits were not quite right because of small mistakes in his work.

20th and 21st centuries

Main article: Chronology of computation of pi § The age of electronic computers (from 1949 onwards)

In 1910, the Indian mathematician Srinivasa Ramanujan found special math patterns that help us find many digits of pi quickly. These patterns are still used today to calculate pi faster. Using just the first part of his pattern, we can find pi correct to seven decimal places.

Since the middle of the last century, all the improvements in calculating pi have used calculators or computers. In the early days of computers, a team led by Daniel Shanks calculated pi to 100,000 decimal places. Later, teams used bigger and faster computers to find even more digits of pi. Today, people have calculated pi to hundreds of trillions of digits using special computer programs.

Practical approximations

You can use simple fractions to stand in for the number π, depending on what you need to calculate. Two common examples are 22⁄7, which is a little off, and 355⁄113, which is even closer. In Chinese math, these fractions are called Yuelü (约率; yuēlǜ; 'approximate ratio') and Milü (密率; mìlǜ; 'close ratio'). These make calculations simpler while still being quite accurate.

Non-mathematical "definitions" of π

Some old texts and laws tried to give a simple number for π, the ratio of a circle’s circumference to its diameter. One famous example is the Indiana Pi Bill from 1897. This bill almost became a law in the United States. It suggested a way to solve a geometry problem called “squaring the circle”. It said the ratio of a circle’s diameter to its circumference could be stated as “five-fourths to four”, which would make π equal to 3.2. Luckily, a math teacher helped stop the bill.

The Hebrew Bible is sometimes said to use π = 3. This comes from a description of a round bowl that is 10 cubits wide and 30 cubits around. Some thinkers, like Rabbi Nehemiah, explained this by saying the measurements were taken from different parts of the bowl’s edge. Others, like Maimonides, noted that π can only be known roughly, and the value 3 was close enough for religious use.

Development of efficient formulae

Archimedes made the first way to find pi. He used shapes called polygons inside and outside a circle. He started with six-sided shapes and then kept adding more sides to get closer to pi.

Numerical approximation of π: as points are randomly scattered inside the unit square, some fall within the unit circle. The fraction of points inside the circle approaches π/4 as points are added.

Later, smart people found quicker ways to find pi using special math rules. One famous way uses something called the arctangent, like Machin’s rule: π/4 = 4·arctan(1/5) − arctan(1/239). These rules help computers find pi to trillions of places. Today, we still find new rules to learn more about pi and test very fast computers.

Easy guesses like 22/7 or 355/113 work for most things, but the new ways can find pi to more than a billion places!

rareaapproximation of π
2133.25
3293.22222
4493.0625
5813.24
103173.17
2012573.1425
100314173.1417
100031415493.141549

Digit extraction methods

The Bailey–Borwein–Plouffe formula (BBP) for calculating π was discovered in 1995 by Simon Plouffe. This special way of calculating π lets you find any single digit in base 16 without needing to calculate all the digits before it.

Later, in 1996, Plouffe created a way to find any specific decimal digit of π much faster. This method doesn’t need to store all the digits up to that point.

Another mathematician, Fabrice Bellard, improved the speed of these calculations even more with a new formula.

Efficient methods

Many smart ways to calculate pi were found by mathematicians. The Indian mathematician Srinivasa Ramanujan worked with Godfrey Harold Hardy in England and created new methods.

Today, we can find pi to many decimal places using special formulas. One method, made in 1976, helps us find each digit of pi without needing all the digits before it. Later, other mathematicians found even faster ways to calculate pi, and these are the ways we use today to find pi to billions of digits.

AlgorithmYearTime complexity or Speed
Gauss–Legendre algorithm1975O ( M ( n ) log ⁡ ( n ) ) {\displaystyle O(M(n)\log(n))}
Chudnovsky algorithm1988O ( n log ⁡ ( n ) 3 ) {\displaystyle O(n\log(n)^{3})}
Binary splitting of the arctan series in Machin's formulaO ( M ( n ) ( log ⁡ n ) 2 ) {\displaystyle O(M(n)(\log n)^{2})}
Leibniz formula for π1300sSublinear convergence. Five billion terms for 10 correct decimal places

Projects

Pi Hex

Pi Hex was a project that used many computers together to find special binary digits of π. In 2000, after two years of work, the project found the five trillionth (5*1012), the forty trillionth (40*1012), and the quadrillionth (1015) digits. All three of these digits were 0.

Software for calculating π

Many programs can calculate the number π to many digits on personal computers. Most computer algebra systems and general libraries for arbitrary-precision arithmetic can find π to any level of detail you want.

Some programs are made just for calculating π and can work faster than general tools. These programs help with very long and detailed calculations. Examples include TachusPi by Fabrice Bellard and y-cruncher by Alexander Yee. Other tools like PiFast by Xavier Gourdon and Super PI](/w/18) by the Kanada Laboratory can also calculate π quickly and efficiently.

Related articles

This article is a child-friendly adaptation of the Wikipedia article on Approximations of pi, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.