Skip to content
Popular Calculators
Browse Other calculators

Birthday Paradox Calculator

The chance that two people in a group share a birthday, how many people give any target probability, and the chance someone shares yours.

For the number of people needed.

365 for birthdays; any number for other matching problems.

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

PeopleChance of a shared birthday
1011.7%
2350.7%
3070.6%
5097.0%
5799.0%
7099.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.

Frequently Asked Questions

What is the birthday paradox?

The surprising fact that in a group of just 23 people, there is a better than even chance, 50.7 percent, that at least two share a birthday. Most people guess you would need around 180, half the days in a year.

Why are only 23 people needed?

Because every pair can match, not just pairs involving you. 23 people form 253 different pairs, and each pair has a 1 in 365 chance of sharing a birthday. With that many chances, a match becomes more likely than not.

How many people are needed for a 99 percent chance?

57 people give a 99 percent chance of at least one shared birthday. With 30 people the chance is about 70.6 percent, with 50 it is about 97 percent, and with 70 it is 99.9 percent.

What is the chance someone shares my birthday?

Much lower, because only pairs that include you count. In a group of 23, the chance that someone else shares your birthday is about 5.9 percent. You would need 253 other people for an even chance.

Does the calculation assume birthdays are equally likely?

Yes, and it ignores 29 February. Real birthdays are slightly uneven, with more in some months, which makes a shared birthday a little more likely than the calculation suggests, not less.

Where else does the birthday problem apply?

Anywhere matches are counted among pairs: hash collisions in computing, duplicate lottery tickets, matching DNA markers and repeated random codes. Change the number of days to the number of possible values to apply it.

Last reviewed September 28, 2026 by the CalculatorPeak editorial team.