Computers calculate pi by running infinite-series formulas (mathematical expressions whose terms, summed forever, would equal pi exactly). Simple ones like the Gregory–Leibniz series converge painfully slowly; modern record-breaking runs use the Chudnovsky brothers' formula, which adds about 14 correct digits per term and produced the November 2025 record of 314 trillion digits.
The movie ‘Life of Pi’ was released in 2012. Back then, there was a scene in the film that puzzled me every time. It’s the part where Piscine Patel tries and succeeds, to establish the short form of his name to ‘Pi’. I remember thinking every time I saw it, “So he wrote hundreds of digits of π on the board, that’s easy. You just keep dividing 22 by 7 in your head. I could have done that!”
But as I grew older, I realized how wrong I was. He wasn’t just dividing 22 by 7 in his head. He had memorized the value of π up to hundreds of digits (see, now that is impressive). 22/7 is simply an approximation for π, and will only give an accurate value till two decimal places (π = 3.14159265……. whereas, 22/7 = 3.1428571……).
How Do We Calculate The Value Of Pi?
Let’s say you have a circle (if not, just construct one). Measure its diameter using a scale and its circumference using a string. Now, if you divide the value of circumference by the diameter, you will probably get the quotient as 3.1415… (approx.). You will also observe that the division is never-ending. This is a value called Pi (π). If we represent this mathematically,
Circumference of circle = 2 π r
Diameter of circle = 2 r
So, Circumference/Diameter = (2 π r) / (2 r) = π

The method of measurements used above is how Babylonians and Greeks discovered it thousands of years ago. Since then, many approximations have been made about the value of this number.
However, even today, when we have calculated more than 300 trillion digits of π, we are nowhere close to the precise value. A number of books use the fraction 22/7 as the value of π, yet even that is simply an approximation (in fact, 22/7 is closer to the actual value of π than 3.14 is).
Why Don’t We Have The Precise Value Of Pi?
The truth is, we don’t know the precise value of π because it is an irrational number.
An irrational number is a number that can not be represented in the form of a fraction. The digits after the decimal are never-ending and non- recurring, i.e., they don’t appear in a particular sequence. That is also the reason why 22/7 is only an approximation for π and not its real value.

Now, if we don’t even know all the digits of π, how are computers able to calculate them for us? After all, computers are programmed by humans themselves, right?
The answer to that is yes, computers are programmed by humans. But we need to understand exactly how computers work, in order to figure out this answer.
How Do Computers Work?
Computers basically work on algorithms. A computer is simply a machine. And a machine doesn’t make decisions on its own as we do. It works according to a set of instructions or steps that we feed into it. And it follows these sets of instructions until we tell it to stop. Of course, it wouldn’t be able to stop on its own, since it does not have the ability to make that decision.
Also, remember that π is a number with infinite decimal places. This means that if we are to calculate the value of π using a computer, it will have to follow a set of instructions an infinite number of times, since the digits of π go on forever.
So, this means, if somehow, we are able to figure out this set of instructions that generate the precise value of π if it is computed an infinite number of times, then the computer can do the entire calculation by itself. And it will keep calculating until we give the instruction to stop.
What Is The Algorithm For Our Calculation?
In our case, this set of operations is called an infinite series. An infinite series is an infinite sequence of values that follow a particular rule throughout.
For example, we have the series-
1/2, 1/4, 1/8…….
Each term here is multiplied by half of the previous term.
If we add them,
This is termed as an infinite series. It can be written in short using the symbol ‘sigma’: –
In this case, the addition of all terms S amounts to 1. In case you are confused as to how it can be 1, here is an illustration of the proof:

Now, if we are able to find an infinite series such that the value of ‘S’ in the above equation equals pi, we will have found an algorithm to generate the value of pi. After that, all we would need to do is feed this algorithm into the computer.
There are numerous series today that are used to generate the value of pi. One of the most well- known and simplest series to calculate π is the Gregory- Leibniz Series :
With this series, you will be able to calculate π/4 exactly. Then if you multiply that by 4, you will have the value of π. The only problem with this series is that it is not very efficient. You will have to add a lot of terms if you wish to get an accurate value (Around 300 terms in order to compute till 2 decimal places). That is a lot of time- consuming work, even for a computer.
Another series that is more efficient than the one given above is Nilakantha Series:-
These are only some of the simplest of formulas that can be used to calculate π. There are other, more efficient, series developed by mathematicians that can be used to calculate this value using computers- like the algorithm of Brent and Salamin.
Imagine an extremely efficient infinite series and a super-fast computer. That’s how the value of π has been calculated to trillions of digits today. The world record for calculating the most digits of π has climbed steeply: in January 2020 Timothy Mullican computed 50 trillion digits on a personal-grade machine, but the bar has since rocketed past the 300 trillion mark. In November 2025 the StorageReview team reclaimed the record with 314 trillion digits, computed on a single Dell PowerEdge server running the y-cruncher software for roughly 110 days, just ahead of the 300 trillion digits a Linus Media Group and KIOXIA collaboration had reached earlier. Most modern record runs use the rapidly-converging Chudnovsky brothers' formula, which adds roughly 14 correct digits per term.
We have certainly made plenty of progress, from calculating this value by hand to using super- slow computers in the 1950s (which were, actually, the most efficient computers of the time), to this day, where computers can calculate π in mere seconds.
Can You Write Pi As A Fraction Or A “Four Fours” Expression?
Here’s a question that pops up a lot: if 22/7 already gets you close, can you pin π down exactly with some clever little expression, maybe even one built from just four 4s? The famous four fours puzzle challenges you to write whole numbers using exactly four 4s and a handful of operations, and people naturally wonder whether π can join the party.

The short answer is no, and the reason is baked into what π is. Pi isn’t just irrational (it can’t be written as a fraction of two whole numbers); it is also transcendental, a property proven by Ferdinand von Lindemann in 1882. A transcendental number is never the solution to any ordinary polynomial equation with whole-number coefficients, so no finite recipe of additions, roots, powers and factorials, whether it uses four 4s or four hundred of them, can ever land on π exactly. The best any such expression can do is approximate it.
And approximate it does, surprisingly well. The school-book favorite 22/7 is accurate to about two decimal places. A far better one is 355/113, known in Chinese mathematics as Milü, which the 5th-century mathematician Zu Chongzhi worked out by hand. It matches π to six decimal places and is the best rational approximation you can build using fewer than five digits on the top and bottom. So you can get astonishingly close with a tidy fraction, but landing on π exactly is off the table, which is precisely why computers have to chase its digits with infinite series instead.
References (click to expand)
- (2015) Computing the Digits in π. The University of Massachusetts Boston
- A Brief History of Pi (π) - Exploratorium. The Exploratorium
- The Sum of the Geometric Series 1 + 1/2 + 1/4 +. The University of Toronto Department of Mathematics
- Pi. Wolfram MathWorld
- Pi Approximations. Wolfram MathWorld
- Approximations of π. Wikipedia
- StorageReview Sets New Pi Record: 314 Trillion Digits. StorageReview












