;colony/science  / Mathematics, Made Visual  / The birthday paradox
Mathematics, Made Visual

The birthday paradox

In a room of just 23 people, it is more likely than not that two of them share a birthday. It feels wrong, and it is dead right.

Plate 130 — The party paradox 253 pairs at 23 people · P > 50%
Add guests and watch a shared birthday pass even odds.
Predict firstAs you add guests one at a time, at what headcount does a shared birthday pass even odds?
50%23 peoplechance of a shared birthday →add people to fill the room
PLATE 130 · THE PARTY PARADOX
Add people 0 in the room
each new guest gets a random birthday
Chance of a match
0.0%
Pairs of people
-0
It feels impossible: in a class of just 23, it's more likely than not that two kids share a birthday. The trick is you're not matching your birthday to everyone — you're matching every pair. With 23 people there are 253 pairs, and that many chances to collide tips the odds past half. Add guests and watch the chance shoot up.
Try with the plate
  • Add guests one at a time and watch the chance climb
  • Reach 23 guests and confirm the odds tip past half

In a room of just 23 people, it is more likely than not that two of them share a birthday, with the probability at about 50.7%. It feels impossible because you picture comparing your own birthday with everyone else's. The real question compares everyone with everyone, giving 253 pairs and far more chances for a match.

The short answer

Guess how many people you would need in a room before two of them probably share a birthday. Most people say a big number — there are 365 days, so surely you need a hundred or more? The real answer is just 23. It feels impossible, but there is a clever reason. You are not checking your birthday against everyone else's; you are checking every person against every other person. In a room of 23, that is 253 different pairs, and with that many chances for a match, the odds tip past half. Add guests in the simulator one at a time and watch the chance of a shared birthday climb faster than you would ever expect.

The common mix-up

Most people think you need hundreds of people before two share a birthday. In fact 23 is enough to pass even odds, because you compare everyone with everyone, giving 253 pairs rather than 22 comparisons.

What's actually happening

Here is a bet that wins money at parties. Ask everyone how many people they think you would need in a room before two of them probably share a birthday. The instinct is overwhelming: with 365 days in a year, you must surely need hundreds. People will happily wager that a room of 30 has no shared birthday. They are wrong about half the time, and at 30 people they are wrong far more often than that. The honest number is 23.

The mistake is a natural one. When you imagine the problem, you picture yourself walking in and comparing your birthday against each other person — and against 22 others, your personal chance of a hit really is small. But that is not the question. The question is whether any two of the people match, and that means comparing everyone with everyone. In a room of 23 there are not 22 comparisons but 253, because each new person can pair with every person already there. The number of pairs grows roughly with the square of the crowd, so it balloons while the headcount only strolls upward. By 23 people, 253 chances to collide are enough to push the odds of at least one match just past fifty-fifty — 50.7%, to be exact.

Once you see it through pairs, the rest follows fast and gets genuinely spooky. With 50 people in the room the chance of a shared birthday is about 97%; with 70 it is 99.9%. You do not need anywhere near 365 people to make a match a near-certainty — you reach it at around 70, a fifth of the way. The same counting quietly underpins serious things: it is why hash collisions in computing turn up sooner than engineers expect, and why some code-breaking attacks are called "birthday attacks." A puzzle that looks like a parlour trick is really a lesson about how explosively pairs multiply.

Remember this

Pairs multiply explosively, so a room of 23 holds 253 chances to collide, which is why shared birthdays, hash collisions and birthday attacks all arrive sooner than intuition expects.

Try it at home Test it on any big group
  1. 1Get a group of about 30 people — a class, a team, a party. Have everyone write their birthday (day and month, not year) on a slip of paper.
  2. 2Collect the slips and sort them by date, looking for any two that match.
  3. 3With 30 people the chance of at least one shared birthday is about 70%, so most of the time you will find a pair. Try it a few times across different groups and watch how often it works.

Common questions

Why does the number of pairs matter more than the number of people?

The pairs grow as n(n−1)/2, far faster than the headcount. A room of 23 holds 253 pairs, not 22 comparisons, because each new person can pair with everyone already there.

How many people make a shared birthday almost certain?

By 50 people the chance is around 97%, and by 70 it is about 99.9%. You reach near-certainty at roughly 70, a fifth of the way to 365, nowhere near the full year.

Does this maths matter outside parties?

Yes. The same counting explains why hash collisions in computing turn up sooner than engineers expect, and why some code-breaking attacks are called birthday attacks and force longer hashes.

Built & checked by Nilesh Singh · how this is made · last updated June 2026