About the Birthday Paradox Calculator
How many people do you need in a room before two of them probably share a birthday? Most people guess somewhere near 180 — about half the days in a year. The real answer is just 23. With 23 people, the chance of at least one shared birthday is 50.7 percent, and with 70 people it is 99.9 percent. This result is so counter-intuitive that it is known as the birthday paradox, although it is not a true paradox: the mathematics is simple once you see what is being counted.
This birthday paradox calculator works out the chance of a shared birthday for any group size, the chance that all birthdays differ, the number of pairs of people, the chance that someone shares your birthday, and the number of people needed for any target probability. By changing the number of days, it also solves the general matching problem for any number of equally likely values.
How to Use the Birthday Paradox Calculator
Enter the number of people in the group.
Optionally, enter a target probability, such as 50 or 99 percent, to see how many people are needed to reach it.
Leave the days at 365 for birthdays, or change it to apply the same maths to other matching problems.
How the Probability Is Worked Out
It is easiest to calculate the chance that no one shares a birthday, then subtract from 1. The first person can have any birthday; the second must avoid one day; the third must avoid two; and so on.
P(all different) = 365/365 × 364/365 × 363/365 × … × (365 − n + 1)/365
P(shared) = 1 − P(all different)
P(shares yours) = 1 − (364/365)^(n − 1)
pairs = n × (n − 1) ÷ 2
Step-by-Step Example
A group of 23 people.
Pairs: 23 × 22 ÷ 2 = 253
All different: 365/365 × 364/365 × … × 343/365 = 0.493
Shared: 1 − 0.493 = 50.7%
Shares yours: 1 − (364/365)^22 = 5.9%
Probabilities by Group Size
| People | Chance of a shared birthday |
|---|---|
| 10 | 11.7% |
| 23 | 50.7% |
| 30 | 70.6% |
| 50 | 97.0% |
| 57 | 99.0% |
| 70 | 99.9% |
With 366 people, a shared birthday is certain, because there are only 366 possible birthdays including 29 February — an example of the pigeonhole principle.
Why the Answer Is So Small
Our intuition focuses on our own birthday: how likely is it that someone shares my birthday? That chance really is small — only 5.9 percent in a group of 23. But the birthday paradox asks whether any two people share a birthday, and the number of possible pairs grows much faster than the number of people. Twenty-three people make 253 pairs. Each pair has only a 1 in 365 chance of matching, but with 253 chances, a match becomes more likely than not. Double the group to 46 and the pairs more than quadruple, to 1,035.
Real Birthdays Are Not Quite Even
The calculation assumes every day is equally likely and ignores 29 February. In reality, births are slightly more common in some months and less common on public holidays and weekends, when fewer planned births are scheduled. Uneven birthdays actually make a shared birthday a little more likely than the calculation says, so the numbers here are a slight underestimate — the paradox is even stronger in practice.
The Birthday Problem Beyond Birthdays
The same mathematics appears wherever we look for matching pairs among many items. In computing, it explains why hash collisions happen sooner than expected, which is called a birthday attack in cryptography: for a hash with N possible values, a collision becomes likely after about the square root of N items. It explains why random codes and identifiers need to be longer than you might think, why duplicate lottery ticket combinations are common, and why coincidences that seem astonishing are often quite likely somewhere in a large population. Change the number of days to the number of possible values to apply the calculator to any of these.
A Classroom Experiment
The birthday paradox makes a memorable classroom experiment. In a class of 30 students, there is about a 70 percent chance of a shared birthday. Ask everyone to call out their birthday in order through the year, and a match usually appears. Across several classes, the proportion that find a match comes close to the calculated probability.
A Quick Rule of Thumb
For a rough estimate without a calculator, the chance of at least one match among n items with d equally likely values is close to 1 − e^(−n² ÷ 2d). With 23 people and 365 days, n² ÷ 2d is 529 ÷ 730, about 0.72, and 1 − e^(−0.72) is about 0.51 — very close to the exact 50.7 percent. The same shortcut shows why an even chance of a match needs about 1.18 × √d items: for birthdays, 1.18 × √365 is about 22.5.
Understanding Your Result
Shared birthday gives the chance that at least two people share a birthday.
All different gives the chance that every birthday is different.
Pairs shows how many pairs of people could match.
Your birthday gives the chance that someone shares your birthday.
People needed shows the group size for your target probability.
Worth knowing explains where the surprise comes from.
When Should You Use This Calculator?
Teaching probability in a classroom.
Settling a bet at a party or in the office.
Estimating collision risks in computing.
Understanding coincidences.
Exploring matching problems with any number of values.
Common Mistakes
Thinking about your own birthday instead of any pair.
Dividing the group size by 365.
Forgetting that the number of pairs grows quickly.
Assuming 183 people are needed for an even chance.
Ignoring uneven birthdays, which make matches more likely.