Why only 23 people?
The question
Picture an empty room. People walk in one at a time. How many have to be inside before it's more likely than not that two of them share a birthday?
A common guess is around 183. That's about half of the 365 days in a year, so it feels right: fill half the calendar and a match should be likely. The real answer is 23. With 23 people in the room, the chance that at least two share a birthday is 50.7%, a little better than a coin flip.
The setup
To keep the math clean, assume every birthday falls on one of 365 days, each equally likely, and leave out February 29. Each person's birthday is random and has nothing to do with anyone else's. Real birthdays aren't spread perfectly evenly. Some months have more than others, and fewer people are born on holidays. That unevenness makes a match slightly more likely, so the even calendar gives the hardest version of the problem.
You're not looking for your own birthday
The guess of 183 answers a different question. If you walk in and ask whether anyone shares your birthday, you really do need a crowd. But the birthday problem asks about any two people. Every person in the room can match every other person, not just you.
The number of pairs grows much faster than the number of people. With 23 people, only 22 pairs include you. Count every pair in the room and there are 23 × 22 ÷ 2 = 253. That's 253 chances for a match, which is why the answer is so much smaller than half a year.
Count the rooms where nobody matches
Working out the chance of a match directly is messy, because a match can come from any of those 253 pairs, and several can happen at once. It's easier to find the chance that nobody matches, then subtract it from 1.
The first person can have any birthday. The second person has to miss the first person's birthday, which leaves 364 of 365 days. The third has to miss both birthdays already taken, so 363 of 365. Each new person has one fewer open day than the one before. The 23rd person has to miss 22 birthdays, leaving 343 of 365.
Because the birthdays are independent, you multiply those chances together:
364/365 × 363/365 × … × 343/365 ≈ 49.3%
That's the chance that all 23 birthdays are different. The chance that at least two match is everything else:
1 − 49.3% = 50.7%
Each fraction on its own is close to 1, so no single person changes much. But 22 of them multiplied together drag the total below half.
How fast it climbs
Past 23, the chance keeps rising quickly, because every new person brings a whole row of new pairs with them.
- 30 people: 70.6%
- 57 people: 99.0%
- 70 people: 99.9%
In a room of 70, finding no shared birthday would be the surprise. To make a match certain you'd need 366 people, since there are only 365 days to go around. But you get to near certainty with a small fraction of that, which is the part that catches people off guard. Our sense of "how likely" tracks the number of people, while the math tracks the number of pairs.
Try it yourself
The game at the top of this page fills a room the same way. Make your guess first, then add people one at a time and watch their birthdays light up on the calendar until two land on the same day. Some rooms match within a handful of people, and some run well past 23. The number 23 is where a match becomes more likely than not, not the number every room hits. To see the spread, press "Fill 1,000 rooms" above. It runs a thousand rooms at once and shows how many people each one took.