How it’s calculated
The birthday problem asks how likely it is that at least two people in a group share a birthday. It is a "paradox" only because the answer feels too big: with just 23 people the chance is already over 50%, because a group of n people contains n(n − 1) ÷ 2 pairs to compare, not just n.
It is easiest to find the opposite event, that everyone's birthday is different, and subtract from 1. The first person can have any day, the second must avoid 1 day, the third must avoid 2 days, and so on:
where d is the number of equally likely days (365 by default). If n is greater than d, a match is certain (the pigeonhole principle).
Worked example: for n = 23 people and d = 365, P(all different) = 0.492703, so P(match) = 1 − 0.492703 = 0.507297, or 50.73%. The smallest group with at least a 50% chance is 23, and for at least 99% it is 57 people. With 70 people the chance is 99.92%.
The model assumes births are equally likely on every day and independent, and ignores 29 February. Real birthdays are slightly uneven, which makes matches a little more likely. The same maths applies to "collisions" such as two items getting the same random ID; set the number of days to the number of possible IDs.
Frequently asked questions
Why is 23 people enough for a 50% chance?
Because the comparison is between all pairs. 23 people form 253 pairs, and each pair has a 1 in 365 chance of matching, so matches build up quickly.
Does this chance mean someone shares MY birthday?
No. That is a different, much smaller probability: 1 − (364 ÷ 365)^(n − 1). To have a 50% chance that someone matches one specific birthday, you need about 253 other people.
How many people guarantee a shared birthday?
With 365 possible days, 366 people guarantee a match (the pigeonhole principle). In practice the chance is already about 99.99997% with 100 people.
Can I use it for other things than birthdays?
Yes. Set "days" to any number of equally likely categories, for example 1,000,000 possible random codes, to see how soon a repeat is likely.
Embed this calculator
Add this free calculator to your own website. Copy the code below into your page’s HTML:
Need this calculator branded, changed or built around your own prices?See custom business solutions →
Sources
- Probability, Mathematical Statistics, and Stochastic Processes (Siegrist), §12.6 The Birthday Problem — LibreTexts
Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.
Added · Last updated · How we check our calculators
Spotted a mistake or missing option? Report a problem· Suggest a calculator