How to use the birthday paradox calculator
- Enter the number of people in the group. The headline gives the chance that at least two of them share a birthday. The starting value is 23, the group size where the chance first passes one half.
- Leave possible birthdays at 365 for an ordinary year, or change it to model a different number of equally likely dates, such as 366.
- Read the other results: the chance that everyone has a different birthday, the number of pairs, the chance that someone shares one particular person's birthday, and the group size needed to reach 50, 90 and 99 percent.
- The table lists the chance for common group sizes, with your size in its place. Use Copy, Print or CSV to keep it.
Formula
P(everyone differs) = (d / d) x ((d - 1) / d) x ... x ((d - n + 1) / d)
P(at least two share) = 1 - P(everyone differs)
P(someone shares a chosen person's birthday) = 1 - ((d - 1) / d)^(n - 1)
Here n is the number of people and d is the number of possible birthdays. When n is larger than d, a match is certain.
Twenty-three people
The chance that 23 people all have different birthdays is (365 / 365) x (364 / 365) x ... x (343 / 365), which is about 0.4927. So the chance that at least two share a birthday is 1 - 0.4927 = 0.5073, or 50.7297%.
The group has 23 x 22 / 2 = 253 pairs, and each pair is a chance for a match. In contrast, the chance that someone shares one particular person's birthday is only 1 - (364 / 365)^22, about 5.86%. With 41 people the chance of some match passes 90%, and with 57 it passes 99%.
Why it is called a paradox
Nothing about the result is contradictory, but it surprises most people. We tend to compare a group with our own birthday, which needs a match with one chosen date, instead of any match among all pairs. The number of pairs grows with the square of the group size, so matches become likely long before the group gets near 365. Doubling a group from 23 to 46 takes the chance from about 51% to about 95%.
The reasoning applies far beyond birthdays. Any time you ask whether two of many items collide in a fairly small set of possibilities, such as random codes, short identifiers or hash values, the same arithmetic tells you how soon a repeat appears.
What the calculator assumes
The model treats every birthday as equally likely, every person as independent, and ignores the leap day. Real birth dates are not perfectly even, and any uneven pattern makes a shared birthday slightly more likely than the figures shown. Twins, planned births and other links between birthdays would raise it further.
The chance is computed by adding logarithms of the factors and converting back, which stays accurate for groups of many thousands. For related counting questions, see the combinations and permutations calculator and the probability calculator. When the group is drawn from a fixed pool without replacement, the hypergeometric distribution calculator applies.
Assumptions and limits
- Every possible birthday is equally likely, and people's birthdays are independent.
- The leap day is not counted unless you set the number of possible birthdays to 366.
- The group size is limited to 100,000 and the number of possible birthdays to 100,000.
- Results are shown as percentages to six decimal places.
Frequently asked questions
Why do only 23 people give about a 50% chance?
Because 23 people form 253 pairs, and any pair can match. The chance builds up across all of those pairs, not just one person against the rest.
What group size makes a match certain?
With 365 possible birthdays, 366 people always include a match. Below that the chance is high, but never exactly 100%.
Does it matter that birthdays are not evenly spread?
Uneven birthdays make a match slightly more likely than the equal-chance figures shown, so the real chance is a little higher.
Can I use this for something other than birthdays?
Yes. Set the possible birthdays to the number of equally likely values, such as 1,000 codes, and the group size to the number of items drawn.