Birthday Paradox Calculator
Find the chance that two people in a group share a birthday. It's higher than almost everyone guesses: just 23 people already give better than even odds. Enter your group size and see the exact chance, the working, and how many people you'd need for any target.
Your group
Type a chance like 90%, 0.9 or 99%. We'll find the smallest group that reaches it.
365 assumes every day is equally likely and ignores leap years.
A small correction for the extra day appearing once every four years. It only changes the answer by a few hundredths of a percentage point.
Results update as you type. Press Calculate or Enter to save one to your recent list.
Your recent calculations
Saved only in this browser, on this device. Nothing is sent to us. Privacy
Practice questions
Five fresh questions each time, with worked answers. Teachers can print them as a worksheet with an answer key, or save it as a PDF from the print window.
Why 23 people is enough
Most people guess you'd need close to 183 people, half of 365, before a shared birthday becomes likely. The real number is 23. The gap comes from a mistake almost everyone makes: thinking about whether someone shares a birthday with you, rather than whether any two people in the room match.
With 23 people there are 253 different pairs, and every single pair is a chance for a match. That's the whole trick: a small group has surprisingly many pairs hiding inside it.
The formula
P(shared) = 1 − (d × (d−1) × ... × (d−n+1)) / dn
n is the number of people and d is the number of possible birthdays. It's easier to work out the chance of no match, then subtract from 1.
Working it out by hand, for 23 people
The first person can have any birthday: 365 out of 365. The second must differ from the first: 364 out of 365. The third must differ from both: 363 out of 365. Keep going down to the 23rd person: 343 out of 365.
Multiply all 23 fractions together and you get about 0.4927, the chance that all 23 birthdays are different. Subtract from 1: about 50.73% chance that at least two match.
How the chance grows with group size
| People | Chance of a shared birthday |
|---|---|
| 10 | 11.69% |
| 20 | 41.14% |
| 23 | 50.73% |
| 30 | 70.63% |
| 40 | 89.12% |
| 50 | 97.04% |
| 57 | 99.01% |
| 70 | 99.92% |
| 100 | 99.99997% |
By 70 people it's essentially certain. The chance climbs fast at first, because the number of pairs grows much faster than the number of people: doubling the group roughly quadruples the number of pairs.
Common mistakes
Thinking it's about matching your own birthday. The chance someone else in a room of 23 shares your specific birthday is only about 6%. The birthday problem asks about any pair matching, which is a much easier target to hit.
Assuming it scales in a straight line. Going from 10 to 20 people doesn't double the chance; it more than triples it, from 11.7% to 41.1%, because pairs grow faster than people.
Forgetting real birthdays aren't perfectly even. September has more births than February in many countries. Uneven birthdays make matches slightly more likely than the even-odds figures above, never less.
How we calculate
For up to 200 people and 1,000 possible birthdays, with leap years switched off, the calculator uses exact whole-number arithmetic (JavaScript BigInt) and shows the exact fraction. Above that, or with leap years switched on, it works with high-precision decimals instead and doesn't show a fraction.
"Account for leap years" treats the year as having 365.25 days on average, rather than the exact day-by-day model of Feb 29 appearing with a different weight to every other day. We checked this approximation against the exact weighted calculation: at 23 people it gives 50.705% against an exact 50.687%, a difference of less than 0.02 percentage points. That gap is too small to matter for any real decision, which is also why most treatments of this problem, including the classic 23-people result, ignore leap years altogether.
The "find the group size" mode searches for the smallest number of people that reaches your target, using the same maths in reverse. Every number on this page was checked against an independent calculation in Python. If you spot a mistake, let us know and we'll correct it and note the change here.
References
- Sheldon Ross, A First Course in Probability, 10th edition, Pearson, 2019. Chapter 2 covers the birthday problem.
- W. Feller, An Introduction to Probability Theory and Its Applications, Volume 1, 3rd edition, Wiley, 1968.
Related calculators
- Combinations and Permutations Calculator, for the full counting toolkit this page is built from, plus lottery odds, letters and round tables
- Lottery Odds Calculator, another famously surprising set of numbers
- Conditional Probability Calculator, including the Monty Hall problem
- Probability Calculator, the full set of tools
Questions people ask
How many people do you need for a 50% chance of a shared birthday?
23. At exactly 23 people the chance passes 50%, reaching about 50.73%.
How many people do you need to be almost certain?
57 people gives a 99.01% chance. By 70 people it's 99.92%, and by 100 it's over 99.9999%.
Why does 23 feel too low?
Because people picture matching their own birthday, which needs about 253 people for a 50% chance. The birthday problem asks whether any two of the group match, and 23 people already contain 253 different pairs to check.
Does this work for things other than birthdays?
Yes. The same maths applies to any "how many do I need before two match" question with equally likely categories, such as random passwords landing on the same value, or two people in a room having the same lucky number out of 100.