Why Is Pi Irrational? A Proof You Can Actually Understand

Pi has never once repeated in over 100 trillion computed digits, and it never will. Here's the actual proof why, built from a function designed to trap a number between two demands it can't both satisfy.

By Petrus Sheya

August 3, 2026 · 8 min read

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.

1/7 =0.142857repeats every 6 digitsπ =3.14159265358979323846264338no cycle ever forms, no matter how far you look
Possible remainders6
Period length6

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 π=ab\pi = \dfrac{a}{b} for some positive whole numbers aa and bb.

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/ba/b.


A function built to be trapped

Here's the function mathematicians use, and yes, it looks strange the first time you see it:

f(x)=xn(abx)nn!f(x) = \frac{x^n (a - bx)^n}{n!}

Where nn 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 f(x)f(x) is a polynomial in xx, and every one of its coefficients comes from expanding (abx)n(a-bx)^n with the binomial theorem, then dividing by n!n!. That n!n! 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 n!n! sitting in the denominator, we can make the peak height of f(x)f(x) as small as we like, just by cranking nn up. A factorial in the denominator eventually demolishes any fixed number raised to the nn-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.

a/b = 3
Peak height1.8984
n!6.00e+0

Watch the peak first climb, then get crushed. Early on, raising the numerator to a bigger power still wins. But n!n! keeps multiplying by bigger and bigger numbers every step, 1,2,3,4,5...1, 2, 3, 4, 5..., 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: xn(abx)nn!\dfrac{x^n(a-bx)^n}{n!}. 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 (abx)n(a - bx)^n with the binomial theorem, and f(x)f(x) becomes a sum of terms shaped like k!n!×(some whole number)×xk\dfrac{k!}{n!} \times (\text{some whole number}) \times x^k, for kk ranging from nn up to 2n2n. Take the kk-th derivative of ff at x=0x=0, and only the xkx^k term survives, contributing exactly k!k! times its coefficient. Since kk is always at least as big as nn in every surviving term, that k!n!\dfrac{k!}{n!} is just a product of whole numbers, (n+1)(n+2)k(n+1)(n+2)\cdots k, 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.

integerk=0k=1k=2k=3k=4k=5k=6k=7k=8fractional part
Derivatives checked9
Landed on a whole number9 / 9

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 ff and its derivatives (call it FF) turns out to satisfy F(0)+F(π)F(0) + F(\pi) exactly equals a certain integral we're about to look at. Since ff's derivatives are whole numbers at both x=0x=0 and x=πx=\pi (using π=a/b\pi = a/b, the same trick applies at both ends), that sum F(0)+F(π)F(0)+F(\pi) 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:

I=0πf(x)sin(x)dxI = \int_0^{\pi} f(x)\sin(x)\, dx

Two facts about II, and they're both locked in tight.

Fact one: II has to be a positive whole number. It's positive because sin(x)\sin(x) and f(x)f(x) are both strictly positive everywhere between 0 and π\pi, so the area under the curve can't be zero or negative. And by that integration trick from a moment ago, II equals F(0)+F(π)F(0)+F(\pi), a sum of whole numbers. A positive whole number can't be anything smaller than 1.

Fact two: II can be made smaller than 1, just by picking nn big enough. We already saw f(x)f(x)'s peak height shrinks toward zero as nn grows. Since sin(x)\sin(x) never exceeds 1, the whole area under f(x)sin(x)f(x)\sin(x) shrinks right along with it. Crank nn up far enough, and II 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.

must stay at or above 1 (positive integer)
Integral value3.5566
Statusstill legal

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 nn 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 π=a/b\pi = a/b 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 π=a/b\pi = a/b. 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 π=a/b\pi = a/b. 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 a/ba/b. Build the function f(x)=xn(abx)n/n!f(x) = x^n(a-bx)^n/n! from that fraction. Its derivatives at 0 and at π\pi are always whole numbers, no matter how big nn gets, which forces the integral 0πf(x)sin(x)dx\int_0^\pi f(x)\sin(x)\,dx to be a positive whole number too. But that same integral shrinks toward zero as nn 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.