Math · Probability
Birthday paradox calculator.
Find the chance that at least two people in a group share a birthday, or any matching value from d equally likely options, and the group size needed for 50%, 90% and 99%.
Inputs
Probability
Enter people and days.
Why 23 people is enough
With d equally likely birthdays, the chance that at least two of n people share one is P = 1 - d! / ((d - n)! d^n) (Wolfram MathWorld). For d = 365 and n = 23 that is 0.5073, so a group of 23 is the smallest where a shared birthday is more likely than not. It feels too low because you are comparing 23 x 22 / 2 = 253 pairs, not 23 people against your own birthday.
Worked examples. 41 people give just over 90%, 57 give just over 99%, and 70 give 99.916%. With 366 or more people (or more people than days) a match is certain by the pigeonhole principle.
Assumptions. Every day is equally likely, birthdays are independent, and 29 February is ignored (use 366 days to include it). Real birthdays are not perfectly uniform, which nudges the real probability slightly upward. The same formula applies to any collision problem with d equally likely values, such as random IDs or hash values.
Frequently asked questions
What is the birthday paradox?
It is the surprising result that in a group of just 23 people the chance that two share a birthday is about 50.7%.
How many people for a 50% chance of a shared birthday?
23, assuming 365 equally likely birthdays. For 90% you need 41 and for 99% you need 57.
How is the probability calculated?
Multiply (365/365) x (364/365) x (363/365) and so on for each person to get the chance of no match, then subtract from 1.
Does this include leap days?
Not by default. Enter 366 as the number of possible values to include 29 February as an equally likely day.
Can I use it for hash collisions?
Yes, under the same equal-likelihood assumption. Enter the number of possible hash values as d. For very large d the group size for 50% grows roughly with the square root of d.
Sources
Checked
The formula and the 0.5073 figure for 23 people are from Wolfram MathWorld. The calculation sums logarithms in double precision, accurate to about 12 digits. It assumes equally likely, independent values. Runs entirely in your browser. Nothing you type is sent or stored.
For learning
Assumes uniformly distributed independent birthdays. Real-world distributions are not perfectly uniform.