Safekipedia

Approximations of pi

Adapted from Wikipedia · Discoverer 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 pursued throughout history, with early estimates already quite close to the true value. Before the beginning of the Common Era, approximations reached an accuracy within 0.04% of the actual value. In Chinese mathematics, this improved to about seven correct decimal digits by the 5th century.

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

The record for manual 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 task. On December 11, 2025, the current record was set using Alexander Yee's y-cruncher, achieving an astonishing 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 estimate the value of pi (π), the ratio of a circle’s circumference to its diameter. Some of the earliest estimates were quite close. For example, people in ancient Egypt used the fraction 22⁄7 (about 3.14), which is only 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

Further progress was not made for nearly a thousand years until the 14th century. An Indian mathematician and astronomer named Madhava of Sangamagrama, founder of the Kerala school of astronomy and mathematics, discovered special number patterns called series that helped calculate pi (π) very accurately. He used these patterns to find pi to 11 decimal places, which is 3.14159265359.

Madhava also improved his methods and found pi to 13 decimal places by using a clever correction to his formulas. Later, another Indian mathematician named Bhaskara II used shapes with many sides to approximate pi as 3.141666. Even later, a Persian astronomer and mathematician named Jamshīd al-Kāshī calculated pi to 16 decimal places, which is 3.1415926535897932, by using a shape with an enormous number of sides.

16th to 19th centuries

In the late 1500s, the French mathematician François Viète found a special way to get closer and closer to the value of pi using 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 happy with his work that he had these digits put on his tombstone. Other mathematicians kept finding more and 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, though 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 discovered special math patterns that help find many digits of pi very quickly. These patterns are still used today to calculate pi faster than ever before. Just using the first part of his pattern, we can find pi correct to seven decimal places.

Starting in the middle of the last century, all the improvements in calculating pi were made using 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 even bigger and faster computers to find more and more digits of pi. Today, people have calculated pi to hundreds of trillions of digits using special computer programs.

Practical approximations

Depending on what you need to calculate, the number π can be approximated using simple fractions. Two well-known examples are 22⁄7, which has a small error, and 355⁄113, which is even closer. In Chinese mathematics, these fractions are called Yuelü (约率; yuēlǜ; 'approximate ratio') and Milü (密率; mìlǜ; 'close ratio'). These approximations make calculations easier while still being quite accurate.

Non-mathematical "definitions" of π

Some old texts and laws tried to give a simple number for π, which is the ratio of a circle’s circumference to its diameter. One famous example is the Indiana Pi Bill from 1897. This bill, which almost became law in the United States, suggested a way to solve a geometry problem called “squaring the circle”. It mentioned that 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 before it became law.

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 created the first method to calculate pi by comparing the perimeters of polygons inside and outside a circle. Starting with hexagons, he showed how to double the number of sides repeatedly to get better approximations.

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, mathematicians found faster ways to calculate pi using special formulas. One famous method uses the arctangent function, like Machin’s formula: π/4 = 4·arctan(1/5) − arctan(1/239). These formulas let computers calculate pi to trillions of digits. Even today, new formulas help us understand pi’s patterns and test supercomputers.

Simple approximations like 22/7 or 355/113 work for everyday use, but modern methods give us pi to more than a billion digits!

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 (the hexadecimal system) without needing to calculate all the digits before it.

Later, in 1996, Plouffe created a way to find any specific decimal digit of π (using the more common base 10 system) much faster. This method doesn’t need to store all the digits up to that point, meaning, in theory, you could even find the one-millionth digit of π using just a basic calculator — though it would take a very long time!

Another mathematician, Fabrice Bellard, improved the speed of these calculations even more with a new formula, though it works only with base 2 math.

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 several new methods.

Today, we can find pi to many decimal places using special formulas. One method, created 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 methods 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 aimed to find three special binary digits of π using many computers working together. In 2000, after two years of work, the project successfully 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 have been created to calculate the number π to many digits on personal computers. Most computer algebra systems and general libraries for arbitrary-precision arithmetic can calculate π 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, which set records in 2009, and y-cruncher by Alexander Yee, used by record holders since 2010. 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.