The birthday paradox, explained interactively
In a room of just 23 people, there's a better-than-even chance two share a birthday. It sounds wrong. Move the slider, fill a room, and watch it become obvious.
How many people are in the room?
50.7%
chance that at least two of 23 people share a birthday.
Pairs to compare: 253. Chance someone shares your birthday: 5.9%.
Fill a room with random birthdays
Each dot is a person with a random birthday. Matches light up. Try it a few times with 23 people, then with 40.
Why it's true
The trick is that you're not asking "does anyone share my birthday?" (that needs about 253 people to pass 50%). You're asking whether any pair matches, and pairs multiply fast: 23 people form 253 pairs.
It's easiest to compute the chance that nobody matches. The second person avoids the first's birthday with probability 364/365, the third avoids both with 363/365, and so on. Multiply those together for 23 people and you get about 0.493, so the chance of at least one match is 1 − 0.493 = 50.7%.
Real birthdays aren't perfectly uniform (September is busier than January), which pushes the real probability slightly higher still. By 57 people it's over 99%, and with 366 people it's certain: the pigeonhole principle.
Where it matters outside parties
Cryptographers use the same maths in the "birthday attack": finding two inputs with the same hash takes roughly the square root of the number of possible outputs, which is why hash functions need outputs twice as long as you might expect.
More from your birth date
Questions people ask
What is the birthday paradox?
It is the surprising fact that in a group of only 23 people, the probability that at least two share a birthday is about 50.7%. With 70 people it is 99.9%.
Why is it called a paradox?
It is not a true logical paradox, just counter-intuitive. People compare against their own birthday, but the question counts every pair in the group, and the number of pairs grows much faster than the number of people.
How many people do you need for someone to share my birthday?
About 253 people for a 50% chance that at least one of them shares your specific birthday.