Statistics
Birthday paradox calculator
How likely is it that two people in a room share a birthday? Enter the group size to get the probability, and a target to see how many people it takes to reach it.
365 ignores 29 February. Use 12 for birth months, 7 for weekdays.
Decimal or percentage.
| Probability | People needed |
|---|---|
| 10% | 10 |
| 25% | 15 |
| 50% | 23 |
| 75% | 32 |
| 90% | 41 |
| 99% | 57 |
| 99.9% | 70 |
Show the working, step by step
Work out the chance that all 23 birthdays are different. The first person can have any day, the second must avoid one day, the third two days, and so on.
P(no match) = 365/365 × 364/365 × 363/365 × … × 343/365 P(no match) = 0.492703
A shared birthday is the complement:
P(match) = 1 − 0.492703 = 0.507297
The surprise comes from the number of pairs, not people: 23 people form 253 pairs, and each pair matches with probability 1/365.
C(23, 2) = 253
For comparison, the chance that somebody shares your birthday uses only the 22 people other than you:
1 − (364/365)22 = 0.05857
This assumes every day is equally likely and birthdays are independent (no twins). Real birthdays are slightly uneven across the year, which makes a match a little more likely, not less.
The formula
It is easier to work out the chance that everyone has a different birthday and subtract it from 1. With d equally likely days and n people:
P(no match) = (d ÷ d) × ((d − 1) ÷ d) × ((d − 2) ÷ d) × … × ((d − n + 1) ÷ d) P(at least one shared birthday) = 1 − P(no match)
The first person can have any birthday; the second must avoid one day, the third two days, and so on. Once n is larger than d, a match is certain.
A worked example
The default group has 23 people and 365 days. Multiplying the 23 fractions gives
P(no match) = 365/365 × 364/365 × … × 343/365 = 0.4927 P(match) = 1 − 0.4927 = 0.5073
So a group of 23 is slightly more likely than not to contain a shared birthday. Those 23 people make C(23, 2) = 253 pairs. On average 253 ÷ 365 = 0.69 pairs share a birthday, which shows why a match is so common even though any one pair rarely matches.
The probability climbs quickly. A group of 30 has a 70.6% chance, 40 people 89.1% and 50 people 97.0%. The table below the chart lists the group size needed for 10%, 25%, 50%, 75%, 90%, 99% and 99.9%.
Interpreting the result
The calculator gives two different probabilities, and they answer different questions. “At least two people share a birthday” counts any pair; “someone shares your birthday” counts only the 22 pairs that include you, so it is only 5.9% for the default group. Most people's intuition answers the second question when asked the first, which is where the surprise comes from.
A handy approximation for the chance of a match is 1 − e−n(n−1)/(2d), which gives 0.500 for 23 people. It is close for most group sizes, but the calculator uses the exact product.
Changing the number of days
The days box turns the calculator into a general collision calculator. As a rule of thumb, a collision becomes likely once the group size reaches about 1.18 × √d. For d = 365 that is 22.5, matching the 23 above. For 12 birth months it is 4.1, and the exact answer is 5 people. For a 4-digit PIN chosen at random, d = 10,000 and about 119 people are needed before two probably share one.
Common mistakes
- Comparing n with d directly, as in 23 ÷ 365 = 6%. That ignores that any pair can match.
- Adding 1/365 for each pair: 253 ÷ 365 = 0.69 is the expected number of matching pairs, not a probability. For larger groups that sum passes 1.
- Assuming birthdays are the only application. Any collision of random values works the same way.
Common questions
How many people do you need for a 50% chance of a shared birthday?
23. With 23 people the probability that at least two share a birthday is 0.507. With 41 people it passes 90%, with 57 it passes 99%, and with 70 it is 99.9%.
Why is it called a paradox?
It is not a contradiction, only a surprise. People compare 23 with 365 and expect a small chance. But a match can happen between any two people, and 23 people form 253 pairs. Each pair matches with probability 1/365, so there are plenty of chances.
What is the chance that someone shares my birthday?
Much lower, because only the pairs that include you count. With 22 other people it is 1 − (364/365)²² = 0.059. You need 253 other people before the chance that one of them shares your birthday reaches 50%.
Does 29 February or uneven birth rates change the answer?
Barely. Using 366 days still gives 23 people for 50%. Real birthdays are not spread perfectly evenly (births vary by season and dip on public holidays), and any unevenness makes a shared birthday slightly more likely, so the calculator's figure is a lower bound.
Where else is the birthday problem used?
Anywhere random values can collide: two people drawing the same lottery number, hash collisions in computing, or repeated values in random samples. Change the number of days to the number of possible values. With 12 “days” (birth months), 5 people give a better-than-even chance that two share a month.
Related calculators
-
Probability calculator
The complement rule and at-least-one probabilities.
-
Permutations and combinations
Count pairs, arrangements and selections.
-
Random number generator
See repeats turn up in random draws.