Pi is a ratio you can compute by dividing a circle's circumference by its diameter
Pi (π) is the number you get when you divide the distance around any circle by the distance across it. That ratio is always the same — roughly 3.14159 — no matter how big or small the circle is. You can compute pi yourself using geometry, series formulas, or algorithms that computers run. Each method trades off between how much work you do and how many decimal places you get.
The methods fall into two groups: geometric approaches that measure or construct circles, and mathematical series that converge on pi through repeated calculation. A geometric method might take you an hour and give you three correct digits. A series formula on a computer can produce thousands of digits in seconds.
Key Takeaways
- The simplest geometric method is to measure a circle's circumference and diameter with a ruler, then divide one by the other.
- Archimedes used inscribed and circumscribed polygons to trap pi between two numbers, a method that works but requires many polygon sides for accuracy.
- The Leibniz series and Machin's formula are mathematical approaches that converge on pi through repeated addition and subtraction, though slowly or quickly depending on the formula.
- Modern computers use algorithms like the Bailey–Borwein–Plouffe formula or Chudnovsky algorithm to calculate trillions of digits, but you do not need a computer to understand how pi works.
Measuring a circle directly with a ruler
The most direct way to compute pi is to measure a real circle. Take a piece of string, wrap it around a circular object (a cup, a plate, a coin), and measure the length. That is the circumference. Then measure straight across the circle through the center — that is the diameter. Divide the circumference by the diameter.
Your answer will be close to 3.14, but probably not exact. A ruler has limits: you cannot measure to infinite precision, the string stretches slightly, and the object may not be a perfect circle. This method gives you pi to one or two decimal places, which is enough to see that the ratio is always the same, but not enough for calculations that need accuracy.
Archimedes' polygon method: trapping pi between two bounds
Around 250 BCE, Archimedes used a clever geometric trick. He drew a regular polygon (a shape with equal sides) inside a circle and another polygon outside it. The perimeter of the inside polygon is shorter than the circumference, and the perimeter of the outside polygon is longer. So pi must fall somewhere between those two values.
He started with hexagons (six sides) and kept doubling the number of sides: 12, 24, 48, 96. With each step, the inside and outside perimeters squeezed closer to the true circumference. After working through a 96-sided polygon, Archimedes concluded that pi was between 3.1408 and 3.1429 — accurate to two decimal places.
You can try this yourself with a compass and ruler. Draw a circle, inscribe a square inside it, then calculate the square's perimeter. Draw another square around the outside. Divide each perimeter by the diameter. The true value of pi lies between them. If you repeat with octagons (eight sides) or 16-sided polygons, your bounds get tighter. The downside: the geometry gets tedious fast, and you need to know how to calculate the side lengths of regular polygons.
The Leibniz series: a formula that adds and subtracts forever
In the 1600s, mathematicians discovered that pi could be expressed as an infinite series — a sum that never ends but gets closer and closer to pi with each new term. The Leibniz series is the simplest:
π/4 = 1 − 1/3 + 1/5 − 1/7 + 1/9 − 1/11 + ...
To use it, you calculate each fraction, alternate between adding and subtracting, and keep going. After the first term, you have 1, which is too high. After two terms, 1 − 1/3 = 0.667, which is too low. After three terms, 0.667 + 1/5 = 0.867. After many terms, you approach π/4 ≈ 0.7854. Multiply your result by 4 to get pi.
The catch: this series converges slowly. You need about 300 terms to get three correct decimal places, and 30,000 terms to get five. A computer can do this in milliseconds, but by hand it is tedious. The Leibniz series is useful for understanding how series work, not for computing pi in practice.
Machin's formula: faster convergence with a clever rearrangement
In 1706, John Machin discovered a formula that converges much faster than Leibniz:
π/4 = 4 × arctan(1/5) − arctan(1/239)
This uses the arctangent function, which can itself be expressed as a series. The key insight is that arctan(1/5) and arctan(1/239) converge quickly because the fractions are small. Machin used this formula to calculate pi to 100 decimal places by hand — a remarkable feat.
You can compute this with a calculator that has an arctangent button, or you can expand the arctangent series yourself. Either way, Machin's formula needs far fewer terms than Leibniz to reach the same accuracy. It remained the standard method for hand calculation until computers arrived.
The Chudnovsky algorithm: what modern computers use
Today's record-breaking pi calculations use the Chudnovsky algorithm, discovered in 1988. It converges so fast that each term gives about 14 new correct digits. The formula is complex and involves factorials and large integers, but it is perfect for computers because it requires no trigonometric functions — just arithmetic.
In 2024, researchers calculated over 100 trillion digits of pi using this algorithm and similar methods. The computation took weeks on specialized hardware. For most purposes, you do not need more than 15 or 20 digits of pi; the Chudnovsky algorithm is overkill. But it shows how far the mathematics has come since Archimedes drew polygons by hand.
Why different methods exist: speed versus simplicity
Each method reflects a trade-off. Measuring a circle is straightforward but imprecise. Archimedes' polygons are exact but labor-intensive. Series formulas are elegant and work on paper or computer, but some converge slowly. Modern algorithms are fast but require computational power and complex mathematics.
For a student learning what pi is, measuring a circle or drawing polygons teaches the concept. For an engineer building a bridge, 10 digits of pi is more than enough. For a mathematician testing a new algorithm or a computer scientist benchmarking hardware, computing millions of digits makes sense. The method you choose depends on what you need and what tools you have.
Frequently Asked Questions
Can I compute pi on a regular calculator?
Yes. If your calculator has an arctangent (arctan or tan⁻¹) button, you can use Machin's formula: multiply 4 × arctan(1/5), then subtract arctan(1/239), then multiply by 4. You will get pi to the precision your calculator displays. Without an arctan button, you can use the Leibniz series, but it converges slowly and you will need patience.
Why does pi have infinitely many digits?
Pi is irrational, which means it cannot be written as a straightforward fraction. Irrational numbers have decimal expansions that never repeat and never end. Mathematicians proved this in the 1700s. You can compute as many digits as you want, but you will never reach an end or find a repeating pattern.
How many digits of pi do I actually need?
For most real-world calculations, 15 digits is more than enough. NASA uses about 15 digits of pi to calculate spacecraft trajectories. For geometry, engineering, and physics problems, 3 to 10 digits is typical. Computing trillions of digits is a mathematical curiosity and a way to test computer hardware, not a practical necessity.
What is the fastest way to compute pi by hand?
Machin's formula is faster than the Leibniz series if you have a calculator with an arctangent function. If you are working purely with pencil and paper, Archimedes' polygon method gives you a bounded answer (you know pi falls between two numbers) without needing infinite series. Both beat the Leibniz series for hand calculation.
Do computers ever stop calculating pi?
No. Mathematicians and computer scientists keep calculating more digits as a challenge and to test new algorithms and hardware. There is no practical limit — you can always compute more. The current record is over 100 trillion digits, but that record will be broken. The calculation itself never finishes because pi's digits never end.