Birthday Paradox Calculator

Calculate the birthday paradox: the chance two people share a birthday in a group, how many people you need for a 50, 90, or 99 percent chance, and the odds someone shares your exact date.

https://hexacalculator.com/calculators/daily/general/birthday-paradox-calculator

Daily

General

Birthday Paradox Calculator

Calculate the birthday paradox: the chance two people share a birthday in a group, how many people you need for a 50, 90, or 99 percent chance, and the odds someone shares your exact date.

Birthday Paradox Calculator

Your question

You are finding the chance that at least two people share any birthday. Set the group size below.

Chance nobody shares
%
As a decimal
Roughly 1 in
Possible pairs
Expected matching pairs
Quick approximation
%

About a 50.73% chance at least two people match. With only 23 people the odds already pass a coin flip.

How the odds grow

Show how the odds grow with group size

Plot the probability against group size and list the milestone group sizes.

Chance of a shared birthday at milestone group sizes

People

At least two share

Nobody shares

20.27%99.73%
52.71%97.29%
1011.69%88.31%
1525.29%74.71%
2041.14%58.86%
2350.73%49.27%
2556.87%43.13%
3070.63%29.37%
4089.12%10.88%
5097.04%2.96%
5799.01%0.99%
7099.92%0.08%
100100.00%0.00%
Loading calculator…

The Birthday Paradox Calculator calculates the probability that two people in a group have the same birthday. By entering the number of people you will be shown the exact probability, odds, possible combinations and quick estimate.

It also answers the reverse question: how many people are required to achieve a given probability? And as a harder question: what is the probability that any particular date will match your birthday?

What is the birthday paradox?

If there are 23 people in a room, the probability that at least two of them have the same birthday is already higher than the probability of getting heads when flipping a coin, and it's about 50.7 percent.

This may seem counter-intuitive. With only 365 days in a year, it seems unlikely that with just 23 people the probability would be so high. Although the result is surprising, the mathematical calculations are unequivocally correct which is why this is referred to as a paradox.

It is not a true contradiction but rather a paradox that occurs in reality. The result may seem unreasonable, but upon careful consideration one can prove it to be true.

Why is it that high?

It's not about looking for matches with a particular person, it's about looking for matching combinations between any two people within that group.

A group of 23 people has 253 possible combinations, and in each one of those combinations there can be a match. And because the number of combinations grows with the square of the size of the population, the probability goes up much faster than people intuitively expect.

pairs=(n2)=n(n1)2\text{pairs} = \binom{n}{2} = \frac{n(n-1)}{2}

Calculation process:

One simple method of calculation is to first determine the probability that no one has a birthday on any particular day and then subtract it from 1.

P(match)=1P(no match)P(\text{match}) = 1 - P(\text{no match})

We arrange the people in a line. The birthday of the first person can be any day. The second person must have a different birthday than the first one, and the probability for that is the value obtained by dividing 364 by 365. The third person must avoid birthdays already taken by the previous two persons, so the probability for that is the value obtained by dividing 363 by 365. This goes on for all subsequent people.

P(no match)=365365×364365××365n+1365P(\text{no match}) = \frac{365}{365}\times\frac{364}{365}\times\cdots\times\frac{365-n+1}{365}

If you multiply these factors together and subtract the result from 1, you get the probability that at least one birthday matches. This can be simplified: Suppose a year has d days and the probability for each day is equal.

P(match)=1365!365n(365n)!=1k=0n1dkdP(\text{match}) = 1 - \frac{365!}{365^{n}\,(365-n)!} = 1 - \prod_{k=0}^{n-1}\frac{d-k}{d}

Example calculation:

So for five people, the probability that they all have different birthdays is 365/365 times 364/365, times 363/365, times 362/365, and then 361/365, which is about 0.973.

Subtracting this result from one gives a probability of about 2.7 percent that two people will have the same birthday. As the number of people increases, this value rises quickly as shown in the table.

People

Chance of a shared birthday

5

2.7%

10

11.7%

23

50.7%

30

70.6%

50

97.0%

57

99.0%

70

99.9%

If the number of people reaches 70, it is almost inevitable that at least two will have the same birthday. On the other hand, if the number of people exceeds 365, there are more people than days in a year, which means that at least two must necessarily share a birthday.

A quick approach.

An exponential approximation based on the fact that the probability of a match for each combination is equal to the value obtained by dividing 1 by d allows a quick estimate without having to multiply out every single element.

P(match)1en(n1)/(2d)P(\text{match}) \approx 1 - e^{-n(n-1)/(2d)}

For 23 people the result of this trick is about 50 percent. This is why it's the classic answer to the question: "How many people are needed to get a probability of 50 percent?"

Another question: Is there anyone who was born on the same day as me?

This is a potential stumbling block. The probability that someone has your exact birthday is much lower than the probability of any two people having the same birthday.

The probability that any one person avoids your birthday is 364 divided by 365. So if there are m more people, the probability that at least one of them shares a birthday with you is:

P(shares your date)=1(364365)mP(\text{shares your date}) = 1 - \left(\frac{364}{365}\right)^{m}

To get a 50% chance that someone has your exact birthday, you need another 253 people, not 23. The question of a typical group is easier because it considers all possible combinations of two people. In contrast, there's only one possible match for your specific date.

Assumptions and real situations:

The standard calculation assumes that a year has 365 days with each day being equally likely and there are no leap years or twins. The actual distribution of birthdays is not perfectly uniform but the inequality is very small.

The result that there is a chance of a match in a group of 23 people holds true in reality as well, since any type of concentration only increases the chances for a match. If you set the "Number of Days" field to 366, leap years can be taken into account, or you can enter any other value to simulate different periods.

The birthday attack, a cryptographic method, also uses the same mathematical principle. Instead of looking for a match with a fixed target, it looks for cases where the hash values of two arbitrary inputs happen to be the same.

To use this calculator, follow these steps:

Select the question you want to answer from above. The classic version lets you enter the number of people first, then check the probability that two will have a birthday in common.

If you switch to the reverse mode, it will calculate how many people in a group are needed to achieve a certain probability. Also, you can switch to "Birthday" mode and check how big of a group is required for at least one person to have your specific birthday. Charts and tables give an overview of the overall situation.

This calculator is for educational and curious purposes only. It simulates an idealized situation where the probability of two people having the same birthday is equal. Please note that it does not describe any specific group of people but rather a mathematical tool.

Frequently asked questions

How many people are needed to have a 50 percent chance that at least two of them share the same birthday?

It only takes 23 people. In a room of 23 people there is about a 50.7 percent chance that at least two people have the same birthday, which is just over 50 percent. This is possible because there are 253 possible combinations, and each combination can be made by any two people in the group of 23.

Why does the "birthday paradox" work, even though there are only 365 days in a year?

Because you're not looking for one specific person but any two people. The number of possible combinations goes up with the square of the number of people, so that even before the group size reaches several hundred people, the number of combinations is already in the hundreds. That's why only 23 people are needed to get a probability that exceeds 50 percent.

What is the probability that in a group of 30 people at least two have the same birthday?

The probability is about 70.6 percent. For 50 people it's approximately 97 percent, for 57 people it's about 99 percent and for 70 people it's approximately 99.9 percent. If the number of people in a group exceeds the number of days in a year, then it is guaranteed that at least two people will share the same birthday.

How many people have my birthday?

It is much less likely that someone was born on your exact birthday. To have a 50 percent chance of sharing your birthday with another person, you would need about 253 other people. This is because the probability that any one individual will be born on your date is just one divided by 365.

Does the Birthday Paradox account for leap years?

The standard calculation assumes that there are 365 days in a year, and each day is equally likely. Leap years and multiple births are ignored. You can set the number of days to 366 to simulate leap years, or any other number. The actual distribution of birthdays is very small, so it only slightly increases the probability of a match.

Related calculators

Disclaimer: This calculator is provided for general informational and educational purposes only. Our calculators are under active development, and results may be inaccurate, incomplete, or unsuitable for your situation. Always verify the figures independently and seek advice from a qualified professional before relying on them. We make no warranties and accept no liability for any loss or decision arising from use of this tool.

References

  1. Wikipedia: Birthday problem

    Derivation, approximations, generalizations, and the birthday attack.

  2. Wolfram MathWorld: Birthday Problem

    The exact formula and the number needed for a 50 percent chance.