How Many People
Does It Take?
Enough that two of them share a birthday. It takes far fewer people than most guess. Drag the slider below and find out for yourself.
Room size
Don't trust one room? Run five hundred of them.
Simulates 500 independent rooms of 23 people and counts how many contain a shared birthday. The dashed line marks the theoretical answer.
Act two
It was never really about 365
Swap the calendar for any space of possible values and the same math holds. Pick a different space below and watch how few "people" it takes before a coin-flip's chance of a match appears.
With 365 possible birthdays, just 23 people give you better-than-even odds of a match: close to the square root of 365, times a small constant.
Security engineers call this the birthday attack. It's why a hash function or a short code needs an output space far bigger than it looks like it needs: collisions become likely once you've tried roughly the square root of the total space, not anywhere near the full size of it.
It isn't about your birthday. It's about everyone's.
It feels like each new person is being compared to one fixed date, so surely you'd need close to 365 of them. That's not what's happening. Every person is being compared to every other person.
With 23 people there aren't 23 comparisons. There are 253: every possible pair in the room. Each pair only has a 1 in 365 chance of matching, but with 253 pairs running at once, the odds pile up far faster than intuition expects.