What Is the Birthday Paradox and Why Is the Answer So Surprising?

How many people do you need in a room before two of them probably share a birthday? Your gut says way more than the real answer. Here's the counting trick that explains why.

By Petrus Sheya

July 27, 2026 · 5 min read

How many people need to be in a room before it's more likely than not that two of them share a birthday?

Take a guess. Most people say somewhere around 180, half of 365. That feels right. There are 365 days, so you'd need about half the days "used up" before a repeat becomes likely.

The real answer is 23.

Twenty-three people. A classroom. A basketball team plus the bench. That's it. Feels wrong, doesn't it? It's wrong enough that this has a name: the birthday paradox. It isn't a paradox in the logical sense, nothing contradicts itself. It's a paradox in the "our intuition is broken" sense. Let's fix that intuition.


Why your gut says a much bigger number

Here's what your brain is probably doing: it's picturing you, checking every other person's birthday against your birthday. With 22 other people and 365 days, the odds of any one of them matching you specifically are low. That part of your intuition is correct.

But that's not the question. The question isn't "does anyone share my birthday." It's "does any pair in the room share a birthday." Nobody said which day. Nobody said which two people. That single shift, from one fixed comparison to all possible comparisons, is where the whole paradox lives.


It's not about people, it's about pairs

With 23 people, you're not making 23 comparisons. You're comparing every person to every other person. That's a completely different number.

Each person is a dot. Each line is a pair that could share a birthday. Watch how fast the lines multiply as people join.

People6
Possible pairs15
Formulan(n-1)/2

Drag the slider and watch the lines. With 6 people there are 15 pairs. With 23 people, there are 253. With 30, there are 435. The number of pairs grows roughly with the square of the number of people, not with the number of people itself.

We write the count of pairs among nn people as:

(n2)=n(n1)2\binom{n}{2} = \frac{n(n-1)}{2}

That's just "pick 2 people out of nn, order doesn't matter." For n=23n = 23, that's 23×222=253\frac{23 \times 22}{2} = 253 separate chances for a match. Your intuition was tracking 1 chance. The real number was 253.


Watching a match happen

Numbers are one thing. Let's actually watch it happen. Below is a 365-day calendar ring. Add people one at a time, each one lands on a random day.

Click “add person” one at a time. Each dot lands on a random day around this 365-day calendar ring, its angle set by birthday.

0in the room
People so far0
Statusno match yet

Click "add person" a few times and notice something: matches tend to show up well before the ring feels crowded. That's not luck rigged into the demo, it's the same pairs effect from above playing out live. Hit "new room" to reshuffle and try again, the match usually shows up again by the low-to-mid twenties.


The exact math

Now for the interesting part: let's actually compute the probability, instead of just feeling it.

It's easier to compute the probability of no match first, then subtract from 1. Line the people up one at a time. The first person can have any birthday, no conflict possible yet, so that's a free choice. The second person has to avoid the first person's day, that's 364 valid days out of 365. The third has to avoid the first two, 363 out of 365. And so on.

P(no match)=1×364365×363365××365n+1365P(\text{no match}) = 1 \times \frac{364}{365} \times \frac{363}{365} \times \cdots \times \frac{365-n+1}{365}

Each new person shaves a little more probability off, and because you're multiplying a long chain of numbers slightly less than 1, the product shrinks faster than it looks like it should. Then:

P(match)=1P(no match)P(\text{match}) = 1 - P(\text{no match})

Plug in n=23n = 23 and this comes out to about 0.5070.507, just over 50%. That's the whole trick. No hidden assumptions, no special pleading, just multiplying a chain of shrinking fractions until the complement crosses one half.


The full curve

Let's see how this probability behaves across every group size, not just 23.

Drag n and watch how quickly the curve climbs. It crosses 50% far sooner than most people expect.

n = 80n = 0n=23: 50%
P(shared birthday)50.7%
50% crossed atn = 23
99% crossed atn = 57

Drag nn from small to large. Notice the curve doesn't rise in a straight line, it rockets upward early and then flattens out near the top. By n=23n = 23 you're already past 50%. By n=57n = 57, you're past 99%. Compare that to your original guess of "around 180," and you can see exactly how far off linear thinking gets you on a problem that's secretly quadratic.


Don't take the formula's word for it

A formula is convincing. Watching it happen thousands of times is more convincing.

Fixing 23 people, we simulate the room over and over. The observed match rate should settle near the formula's prediction.

theoretical: 50.7%
Trials run0
Observed match rate0.0%
Theoretical50.7%

Hit "run simulation." Each tick simulates a fresh room of 23 random birthdays and checks for a match, over and over, thousands of times. Watch the green line, the observed match rate, wobble around at first and then settle in right on top of the dashed theoretical line. That convergence is the law of large numbers doing its job: run enough random trials, and the observed frequency finds the true probability. The 50.7% wasn't a trick of algebra. It's just what actually happens, on average, in a room of 23 strangers.


The short version

We compare every person to every other person, not just to ourselves, and the number of those pairwise comparisons grows roughly with the square of the group size. With 23 people that's already 253 chances for a match, and multiplying 253 nearly-independent "no match" probabilities together shrinks the total faster than intuition expects. The result: 50% by 23 people, 99% by 57, using nothing but a chain of fractions and a subtraction from 1.

The next time someone in a room of 25 or more insists nobody shares a birthday, you now know the math says otherwise, and you know exactly why.


All visualizations are interactive React components running entirely in your browser. The probability curve and simulation use the exact closed-form formula and a seeded random number generator, no external libraries beyond React.