Find the chance that two people in a group share a birthday, or that someone shares yours, and the group size needed to reach any probability. Works for any number of equally likely days.
P(shared) = 1 − (365 × 364 × … × (366 − n)) ÷ 365ⁿ
The birthday paradox is the surprising fact that in a group of just 23 people, there's a better than even chance that two of them share a birthday. It isn't a true paradox, just a result that clashes with intuition.
The intuition goes wrong because it pictures one person looking for a match among the others. In fact every pair is a chance for a match, and 23 people form 253 pairs. Each pair has only a 1-in-365 chance, but 253 chances add up quickly.
The same maths matters well beyond parties. It explains why hash codes and random IDs collide sooner than expected. It's also the basis of "birthday attacks" on cryptographic hashes, which need only about the square root of the number of possible values to find a clash.
As given in Feller, An Introduction to Probability Theory and Its Applications, vol. 1, chapter 2. See Sources.
Each new person must avoid every birthday already taken.
This is the question intuition answers, and it needs a far bigger group: 254 people for a 50% chance.
The teacher wins about 7 times in 10. But a pupil looking for someone with their own birthday has only a 7.6% chance: a different, much rarer event.
| People | Pairs | Any two share | Someone shares yours |
|---|---|---|---|
| 10 | 45 | 11.7% | 2.4% |
| 20 | 190 | 41.1% | 5.1% |
| 23 | 253 | 50.7% | 5.9% |
| 30 | 435 | 70.6% | 7.6% |
| 40 | 780 | 89.1% | 10.1% |
| 50 | 1225 | 97% | 12.6% |
| 57 | 1596 | 99% | 14.2% |
| 70 | 2415 | 99.9% | 17.2% |
23 people give 50.7%. 57 people give over 99%.
Because the answer feels impossible, not because it contradicts itself. It’s a veridical paradox: true but counter-intuitive.
Including 29 February barely changes anything; it lowers the 23-person figure by a fraction of a percentage point.
It changes the number of equally likely options: 12 for birth months, 7 for weekdays, or a huge number for random IDs.
Yes. Enter the number of possible hash values as the days, within the limit of 1,000,000, and the number of items as the people.
For small probabilities per pair, the chance of no match among n(n − 1)/2 roughly independent pairs is close to e^(−pairs ÷ d).
That’s much rarer: you need 88 people for an even chance of a triple birthday.
The formula assumes independent birthdays, so twins in the group make a match more likely than calculated.
Related Tools
Geometric probability.
Bayesian paradox.
Conditional gender probability.
Rare event testing.
Losing games winning strategy.
Money switching paradox.