Randomness & Probability

Birthday Paradox: Why 23 People Give a 50% Chance of a Match

Read in other languages: 日本語

In a group of 23 people, the chance that at least two share a birthday is about 50.7%. With 70 people it rises to about 99.9%. These figures assume only 365 equally likely birthdays and people picked at random.

Many people guess something closer to 183, half of 365. That gap between intuition and math is why it's called the birthday paradox. It isn't a true logical paradox. It's a result that sounds wrong until you see where it comes from.

Below you'll find the complement method worked step by step, a table of odds for different group sizes, a way to test it yourself with a random number generator, and the assumptions that bend the real-world numbers a little.

Why the birthday paradox works: count pairs, not people

The key is that a match can happen between any two people in the room, not just between you and someone else. With 23 people, the number of possible pairs is:

23 × 22 ÷ 2 = 253 pairs

Each pair has a 1 in 365 chance of sharing a birthday. So the expected number of matching pairs is 253 ÷ 365 ≈ 0.69. That's already close to one, and it shows why the chance of at least one match lands near 50%.

The pair count grows much faster than the group. Double the group from 23 to 46 and the pairs jump from 253 to 1,035, roughly four times as many. That's why the probability climbs so steeply after the low 20s.

You can't just add up 253 chances of 1/365, though. That would give 69%, and the pairs overlap: if Alice matches Bob and Bob matches Carol, then Alice matches Carol too. To get the exact figure you need the complement method.

The complement method: chance that everyone has a different birthday

"At least one shared birthday" covers many cases: one pair, two pairs, three people on one day, and so on. Counting all of them directly is painful. The opposite event, "everyone has a different birthday," is one clean case. So you calculate that and subtract it from 1.

P(at least one shared birthday) = 1 − P(all birthdays different)

Worked example: building up the product

Line people up one at a time and ask how likely it is that each new person avoids every birthday already taken.

  1. Person 1 can have any birthday: 365/365 = 1.
  2. Person 2 must avoid 1 taken day: 364/365 ≈ 0.99726.
  3. Person 3 must avoid 2 taken days: multiply by 363/365 ≈ 0.99452. Running total: 0.99726 × 0.99452 ≈ 0.99180.
  4. Person 4 must avoid 3 days: multiply by 362/365 ≈ 0.99178. Running total ≈ 0.98364.
  5. Person 5 must avoid 4 days: multiply by 361/365 ≈ 0.98904. Running total ≈ 0.97286.
  6. Keep going. Person 23 must avoid 22 taken days, so the last factor is 343/365.

Written out, the full product for 23 people is:

P(all different) = (365 × 364 × 363 × … × 343) ÷ 365²³ ≈ 0.4927

So P(at least one shared birthday) = 1 − 0.4927 = 0.5073, or about 50.7%.

At 5 people, the shared-birthday chance is 1 − 0.97286 ≈ 2.7%. Each factor is only slightly below 1, but multiplying 22 of them together pulls the total below one half.

Doing it in a spreadsheet or calculator

You don't need to type 23 fractions. In Excel or Google Sheets, this formula gives the shared-birthday probability for 23 people:

=1 - PERMUT(365, 23) / 365^23

PERMUT(365, 23) is the top of the fraction, 365 × 364 × … × 343. Change both 23s to any group size. On a basic calculator, multiply the fractions one by one as in the steps above. The free online calculator handles parentheses, so you can chain several factors in one line.

A quick approximation

For a fast estimate, use P(all different) ≈ e^(−pairs ÷ 365). For 23 people: 253 ÷ 365 ≈ 0.6932, and e^(−0.6932) ≈ 0.500. That gives about 50% shared, close to the exact 50.7%. The shortcut is fine for estimates. Use the exact product when you need the decimals.

Birthday paradox odds table: 10 to 70 people

These are the exact values from the complement method, with 365 equally likely birthdays.

People in the group Possible pairs Chance all birthdays differ Chance of at least one shared birthday
10 45 88.3% 11.7%
20 190 58.9% 41.1%
23 253 49.3% 50.7%
30 435 29.4% 70.6%
40 780 10.9% 89.1%
50 1,225 3.0% 97.0%
57 1,596 1.0% 99.0%
70 2,415 0.08% 99.9%

Some useful takeaways:

  • A typical school class of about 30 has a shared birthday more often than not, roughly 7 times in 10.
  • By 50 people, a room without a shared birthday is the unusual case, about 3 in 100.
  • At 70 people, the chance rounds to 99.9%. In the 365-day model it only reaches exactly 100% at 366 people. With 365 possible days, the 366th person must repeat one (the pigeonhole principle).

How to simulate a classroom or office party with random numbers

The math is convincing, but running the experiment makes it stick. You can simulate a group using a random number generator that draws whole numbers from 1 to 365, where each number stands for a day of the year.

Step-by-step simulation

  1. Open a random number generator and set the range to 1–365.
  2. Set it to draw 23 numbers, with repeats allowed. This matters: real people can share birthdays, so the generator must be free to pick the same day twice. A no-repeat draw would rule out matches entirely.
  3. Generate the 23 numbers and check for duplicates. Sorting them first makes repeats easy to spot.
  4. Write down "match" or "no match."
  5. Repeat for at least 20 trials, ideally more, and count how many trials had a match.

With 20 trials, you'd expect around 10 matches. Don't be surprised by 7 or 13, though. Small samples bounce around. The more trials you run, the closer your match rate should settle to 50.7%.

If you want to see the difference between the two drawing modes in detail, the guide on random number generators with no repeats explains when each one fits.

Running hundreds of trials in a spreadsheet

For a bigger sample, put =RANDBETWEEN(1,365) in cells A1 through A23. Then this formula returns TRUE if any value appears more than once:

=SUMPRODUCT((COUNTIF(A1:A23, A1:A23) > 1) * 1) > 0

Copy the setup across many columns, one column per trial, and count the TRUE results. Spreadsheets recalculate random values whenever the sheet changes, so copy and paste the results as values if you want to keep a set.

"Someone shares my birthday" is a different question

This is the most common mix-up. The 50.7% figure is about any two people matching. If you ask how likely it is that someone matches your birthday, you're only looking at the pairs that include you, which is far fewer.

In a group of 23, you're part of just 22 of the 253 pairs. The chance that none of the 22 others shares your birthday is (364/365)²². So:

P(someone shares my birthday) = 1 − (364/365)²² ≈ 1 − 0.941 ≈ 5.9%, or about 6%

To get a 50% chance that at least one other person has your specific birthday, you need about 253 other people: 1 − (364/365)²⁵³ ≈ 50.05%. With 252 others it's just under 50%.

Others in the room Chance any two share a birthday (whole group) Chance someone shares your birthday
22 (group of 23) 50.7% 5.9%
49 (group of 50) 97.0% 12.6%
99 (group of 100) over 99.99% 23.8%
253 effectively 100% 50.0%

Why 253 appears in both answers

The number 253 isn't a coincidence. Both questions cross 50% when the number of independent-ish chances reaches about 365 × ln 2 ≈ 253, which is why the same number appears twice. In the whole-group question, those chances are the 253 pairs among 23 people. In the "my birthday" question, each chance is one other person compared against you, so you need 253 people to supply them.

The assumptions behind the 50.7% figure

The classic calculation rests on three simplifications. None of them changes the headline number much, but it helps to know which way each one pushes.

February 29 birthdays

The standard model ignores leap day. Including February 29 as a rare 366th birthday (it shows up roughly once every four years; the leap year rules explain exactly when) spreads birthdays over slightly more days. That makes a match very slightly less likely. The effect on the 23-person figure is less than a tenth of a percentage point, so 23 is still the group size where the odds pass 50%.

Births aren't spread evenly over the year

The model assumes every day is equally likely. Real birth counts vary by season, and in some countries scheduled deliveries make certain weekdays more common than holidays. Any unevenness makes shared birthdays more likely, not less, because crowded days pick up extra matches. Mathematically, a perfectly even spread over 365 days gives the lowest possible chance of a match.

So uneven birth patterns push the real probability slightly above the 50.7% model figure. Leap day nudges it down by a smaller amount, so in practice the real chance for 23 people is at or a little above 50.7%.

People chosen independently

The math assumes each person's birthday is unrelated to everyone else's. Twins break this. So do groups whose members were selected in a way linked to birth date. One example is a competitive youth sports team grouped by an age cutoff: selection often favors children born soon after the cutoff, because they're older and more physically developed than teammates born later in the year. This is called the relative age effect. A study group recruited by birth season is another example. Groups like these bunch their birthdays into fewer months and tend to match more often than the table suggests.

An ordinary school grade doesn't count as bunching just because of its entry cutoff. The cutoff sets a 12-month birth window, and that window still covers every calendar day.

Quick reference

  • Any two people share a birthday: 1 − (365 × 364 × … × (365 − n + 1)) ÷ 365ⁿ
  • Spreadsheet version: =1 - PERMUT(365, n) / 365^n
  • Someone shares your birthday (n others): 1 − (364/365)ⁿ
  • Number of pairs in a group of n: n × (n − 1) ÷ 2
  • Key thresholds (any match): 23 people ≈ 50.7%, 30 ≈ 70.6%, 50 ≈ 97.0%, 57 ≈ 99.0%, 70 ≈ 99.9%, 366 = certain (365-day model)
  • Key threshold (your birthday): about 253 other people for 50%, since 365 × ln 2 ≈ 253
  • Simulating it: draw n numbers from 1–365 with repeats allowed, check for duplicates, and repeat many times
  • Real-world adjustments: leap day lowers the odds very slightly; uneven birth patterns, twins, and groups selected by birth date (such as age-cutoff sports teams) raise them

Frequently Asked Questions

What is the chance that two random people share a birthday?

With just two people, the chance is 1 in 365, or about 0.27%. The second person has to land on the one specific day the first person already has. The probability only gets large as the number of pairs grows with group size.

How many people do you need for a 99% chance of a shared birthday?

57 people. With 57 people the chance of at least one shared birthday is about 99.0%, assuming 365 equally likely birthdays. Below that, 50 people give about 97%.

Is the birthday paradox actually a paradox?

Not in the logical sense. Nothing in it contradicts itself. It's called a paradox because the true answer, 23 people for a 50% chance, is much smaller than many people guess. The surprise comes from counting people when you should be counting pairs.

Where is the birthday paradox used outside of birthdays?

The same math describes collisions whenever items are assigned at random to a fixed number of slots. In computer security it's the basis of the "birthday attack" on hash functions. With N possible hash values, a collision becomes likely after roughly the square root of N items, not N. That's why hash outputs need to be much longer than intuition suggests.

What are the odds that two people share the exact same birth date, including the year?

Much lower, because there are far more possible dates than 365. If birthdays are spread over several decades, the pool runs into the tens of thousands of days (about 3,650 per decade). You can still use the complement method by replacing 365 with the number of possible dates. Real ages cluster unevenly, though, so treat any result as a rough estimate.