The Birthday Paradox

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.

Try it below

Room size

23 people
22350100
Theoretical chance of a match 50.7%

Don't trust one room? Run five hundred of them.

Rooms with a match0 / 0 rooms

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.

People needed for a 50% chance of a match 23

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.

Why so few people

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.

23 people means 253 pairs, and a 50.7% chance two of them share a birthday.
70 people means 2,415 pairs, and a 99.9% chance. Practically a certainty.