Can you write pi as a fraction? Not a close one like 22/7. An exact one, some whole number divided by another whole number, that lands on pi dead on.
You can't. Nobody can. And that's not just "nobody's found it yet." It's been proven impossible.
That's a strange kind of claim. Most things we can't do, we can't do because we haven't tried hard enough, or we don't have a big enough computer. This is different. No computer, no amount of searching, no cleverness will ever find two whole numbers whose ratio is exactly pi. We know that for certain, the same way we know 2 + 2 isn't 5.
So how do you prove a negative like that? You can't check every fraction, there are infinitely many. Instead, mathematicians built a trap. Assume pi IS a fraction, follow that assumption through some clever machinery, and watch it collapse into a flat contradiction. That's the proof we're building today, piece by piece, until you can see exactly why it has to work.
What does "not a fraction" even mean?
Before we prove pi isn't a fraction, let's get concrete about what a fraction's decimal expansion actually looks like, because that's where the whole idea starts.
Take 1/7. Long divide it out and you get 0.142857142857142857... The block "142857" just repeats forever. Try 1/3: 0.333333..., repeating "3". Try 1/4: 0.25, and then it just stops, zeros forever after.
Here's why that always happens. Long division works by tracking a remainder at each step, and for 1/b, that remainder can only ever be one of a fixed handful of values: 0, 1, 2, all the way up to b-1. That's it. There's no other option. So if you divide for more than b steps, you're guaranteed to see some remainder twice. And once a remainder repeats, every digit after it repeats too, because the whole process is deterministic: same remainder in, same digit and same next remainder out.
Every fraction's decimal expansion either stops, or falls into a repeating loop, and it's forced to because there's only a finite number of remainders to cycle through.
Now play with it below. Slide the denominator and watch the loop close.
Every fraction's remainders eventually revisit a state they've already been in, forcing the digits to loop. Slide b and watch the loop close. Pi never closes one.
Notice something about pi's digits underneath. No cycle. Not after 10 digits, not after 26, not after the over 100 trillion digits anyone has ever bothered computing. If pi were secretly a/b for some whole numbers a and b, its decimal expansion would have to fall into a loop, guaranteed, for the exact same remainder reason as 1/7 or 1/3. It never does. That's the entire content of "pi is irrational": no fraction of whole numbers can produce it, ever.
That's the claim. Now let's actually prove it.
Assume the impossible, and see what breaks
Here's the strategy, and it's an old one: proof by contradiction. Assume the exact opposite of what you want to prove, then follow the logic wherever it leads. If it leads somewhere absurd, like 1 = 2, or a number that's both even and odd, then your assumption must have been false to begin with.
So let's assume pi is a fraction. Say for some positive whole numbers and .
We don't get to pick a and b. We don't know what they are. The whole point is that if pi really were rational, some pair of whole numbers a and b would have to exist, whatever they turn out to be. Our job is to build something out of that assumption that breaks no matter what a and b are.
To do that, we need a function. A weird one, built for exactly one purpose: to force a contradiction out of .
A function built to be trapped
Here's the function mathematicians use, and yes, it looks strange the first time you see it:
Where is a number we get to choose, any positive whole number we like. Why this particular shape? Two reasons, and they're both about control.
First, notice is a polynomial in , and every one of its coefficients comes from expanding with the binomial theorem, then dividing by . That in the denominator looks like it should wreck things, chopping the coefficients into messy fractions. It doesn't, and we'll see exactly why in a moment.
Second, and this is the part you can actually watch happen: because of that same sitting in the denominator, we can make the peak height of as small as we like, just by cranking up. A factorial in the denominator eventually demolishes any fixed number raised to the -th power on top, no matter how big that number is. It just needs enough steps.
f(x) = x^n(a-bx)^n/n!, using a stand-in a/b = 3/1 just to draw a picture. Watch the peak rise, then get crushed as n grows: factorial eventually beats any fixed power.
Watch the peak first climb, then get crushed. Early on, raising the numerator to a bigger power still wins. But keeps multiplying by bigger and bigger numbers every step, , while the base on top stays fixed. Eventually the factorial wins every single race like this, no matter how big a and b turn out to be. We can shrink this function to be as tiny as we want, just by choosing n large enough.
That's the first demand we're going to put on this function: make it small. Now for the second demand, and this is where it gets interesting.
The coefficients refuse to be fractions
Look again at that formula: . There's a factorial dividing everything. You'd expect that to leave fractions everywhere once you start taking derivatives. It doesn't, and here's the short version of why.
Expand with the binomial theorem, and becomes a sum of terms shaped like , for ranging from up to . Take the -th derivative of at , and only the term survives, contributing exactly times its coefficient. Since is always at least as big as in every surviving term, that is just a product of whole numbers, , with nothing left over. No matter how many times you differentiate this specific function, the result at x=0 always lands exactly on a whole number.
Every derivative of f at x=0, divided by n!, still lands exactly on a whole number. The pale dots show where a generic function's derivatives would scatter instead.
Every dot sits exactly on the integer line, not close to it, on it. Compare that to the pale scattered dots, which show where a generic, unremarkable function's derivatives would land instead: anywhere. This function isn't generic. It was built, on purpose, so that this specific set of numbers can never be fractional.
There's one more piece worth mentioning without getting lost in it: a specific combination of and its derivatives (call it ) turns out to satisfy exactly equals a certain integral we're about to look at. Since 's derivatives are whole numbers at both and (using , the same trick applies at both ends), that sum has to be a whole number too.
Now we have both halves of the trap.
One number, two impossible demands
Here's the number that's about to get squeezed:
Two facts about , and they're both locked in tight.
Fact one: has to be a positive whole number. It's positive because and are both strictly positive everywhere between 0 and , so the area under the curve can't be zero or negative. And by that integration trick from a moment ago, equals , a sum of whole numbers. A positive whole number can't be anything smaller than 1.
Fact two: can be made smaller than 1, just by picking big enough. We already saw 's peak height shrinks toward zero as grows. Since never exceeds 1, the whole area under shrinks right along with it. Crank up far enough, and drops below 1, guaranteed.
Watch it happen for real, with actual computed numbers:
If pi were a/b, this curve would have to be a positive whole number every step, so it can never dip under the floor at 1. Watch what actually happens.
There's the floor at 1, drawn in as the line the curve is never legally allowed to cross. And there's the curve, crossing it anyway, the moment gets big enough. A number can't be a positive whole number and also be less than 1. Those two facts flatly contradict each other.
That contradiction didn't come from nowhere. It came from assuming in the first place. Since every other step was airtight, that assumption is the only thing that could be wrong.
So pi isn't a fraction
Follow the chain back. We assumed . That assumption forced a specific function into existence, one whose integral had to be both a whole number and smaller than 1 at the same time. That's impossible. So the assumption breaks.
There is no pair of whole numbers a and b with . Pi is irrational.
This is essentially Niven's proof, published in 1947, and it's remarkable for how little machinery it needs: derivatives, one integral, and the binomial theorem. No advanced number theory required, just a function engineered to be squeezed until it snaps.
The short version
Assume pi is a fraction . Build the function from that fraction. Its derivatives at 0 and at are always whole numbers, no matter how big gets, which forces the integral to be a positive whole number too. But that same integral shrinks toward zero as grows, since factorial growth always eventually beats any fixed exponential. A positive whole number can't shrink below 1. Contradiction. So no such a and b can exist, and pi is irrational.
All visualizations are interactive React components running entirely in your browser, built with plain SVG. No libraries beyond React.