Birthdays

The Birthday Paradox: Why 23 People Have a 50% Chance of a Shared Birthday

In a group of just 23 people there is a 50.7% chance that two share a birthday; with 70 people it is 99.9%. The maths explained simply, with a table.

The Birthday Paradox: Why 23 People Have a 50% Chance of a Shared Birthday

Photo: eunseong0331 / Pixabay

In this article
  1. When is your next birthday?
  2. The probability table
  3. Why it works: count the pairs
  4. The calculation
  5. Matching your own birthday is much harder
  6. Where the paradox matters
  7. Try it
  8. A quick approximation
  9. Three people sharing a birthday
  10. Near-matches
  11. The same maths elsewhere
  12. Real birthdays are uneven
  13. Try it yourself
  14. Frequently asked questions
  15. Sources

In a group of just 23 people, the chance that at least two share a birthday is — better than a coin toss. This feels wrong, which is why it is called the birthday paradox. However, the maths is simple once you count pairs instead of people.

This surprising phenomenon challenges our intuition about probability. We tend to underestimate the likelihood of shared events in a group. This is especially true when we focus on our own individual chances rather than the collective possibilities. The birthday paradox is a prime example of how quickly probabilities can accumulate in a larger system.

When is your next birthday?

While you work out who in your office shares a birthday, here is your own countdown:

Loading the calculator…

The probability table

People in the group Chance at least two share a birthday
5 2.7%
10 11.7%
15 25.3%
20 41.1%
23 50.7%
30 70.6%
40 89.1%
50 97.0%
57 99.0%
70 99.9%

These figures assume 365 equally likely birthdays and ignore 29 February. Real birthdays are slightly uneven — September is busier than December — which makes a shared birthday very slightly more likely.

Why it works: count the pairs

Our intuition compares people with ourselves: “What are the chances someone has my birthday? But the paradox asks whether any two people match, and 23 people form 253 different pairs (23 × 22 ÷ 2). Each pair has only a 1-in-365 chance of matching, but with 253 chances the odds add up quickly.

To understand the number of pairs, consider a small group. If you have 5 people (let’s call them A, B, C, D, E), you can list the unique pairs: (A,B), (A,C), (A,D), (A,E), (B,C), (B,D), (B,E), (C,D), (C,E), (D,E). That’s 10 pairs. The formula for calculating unique pairs in a group of ‘n’ people is n * (n – 1) / 2. For 5 people, it’s 5 * 4 / 2 = 10 pairs. For 23 people, it’s 23 * 22 / 2 = 253 pairs. Each of these pairs represents an opportunity for a shared birthday, significantly increasing the overall probability.

The calculation

It is easiest to work out the chance that nobody shares a birthday, then subtract from 1:

The Birthday Paradox: Red counters on a whiteboard illustrating numbers 1 to 4.
  • The first person can have any birthday: 365/365 (or 1).
  • Next, the second must avoid the first’s birthday: 364/365.
  • The third must avoid both the first’s and second’s birthdays: 363/365.
  • … and so on, until the 23rd person: 343/365.

So the chance of at least one match is 1 − 0.4927 = .

Worked example: 5 people

Let’s apply the same calculation for a smaller group of 5 people to see the process in action:

  • Person 1: 365/365 = 1 (can have any birthday)
  • Also, Person 2: 364/365 (must not share with Person 1)
  • Person 3: 363/365 (must not share with Person 1 or 2)
  • Then, Person 4: 362/365 (must not share with Person 1, 2, or 3)
  • Person 5: 361/365 (must not share with Person 1, 2, 3, or 4)

Multiply these probabilities together: (365/365) * (364/365) * (363/365) * (362/365) * (361/365) ≈ 0.9730.

Therefore, the chance of at least one shared birthday is 1 – 0.9730 = 0.0270, or . This matches the figure in our probability table, illustrating how the calculation works for any group size.

Matching your own birthday is much harder

For someone in the group to share your specific birthday with even odds, you need about 253 other people. That asymmetry — 23 for any match, 253 for a match with you — is the heart of the paradox.

The distinction lies in the problem you are solving. When you ask, “What is the probability that *anyone* in the group shares *my* birthday?”, you are testing for a match against one specific date (your birthday). Each person in the group has a 1/365 chance of matching your birthday. This is a very different scenario from the original paradox. The paradox considers *all possible pairs* and *any* shared birthday among them, not just yours.

Where the paradox matters

  • Classrooms and teams: In a class of 30, there is a 70% chance of a shared birthday. This means teachers often find themselves celebrating multiple students on the same day. Or they may have to choose which birthday to acknowledge first. It’s a common, observable phenomenon.
  • Computer security: The “birthday attack” on hash functions uses the same maths. A hash function takes an input (like a password or file) and produces a fixed-size string of characters, called a hash. If two different inputs produce the same hash, it’s called a collision. Birthday attacks exploit the paradox by showing that collisions appear far sooner than you would expect. This is why secure cryptographic hashes need very long outputs (e.g., 256-bit or 512-bit) to make collisions computationally infeasible.
  • Data checking: When systems generate random ID numbers, the birthday paradox highlights that collisions (two records getting the same ID) will occur much sooner than people expect unless the number range is huge. For example, if you assign 10-digit random IDs, you might think you have billions of unique IDs. However, collisions become probable surprisingly quickly.

Try it

Look at a sports squad: football World Cup squads of 23 players are a classic test — an analysis of the 32 squads at the 2014 World Cup found that 16 of them contained a shared birthday, just as the maths predicts. Or check a family: with parents, grandparents, siblings and cousins, a shared birthday is more likely than not once you pass about two dozen people.

Five young adults smiling on a couch with party decorations in the background.

A quick approximation

You don’t need to multiply 23 fractions. A good approximation for the chance of at least one shared birthday among n people is:

P ≈ 1 − e−n(n−1)/730

For n = 23: 23 × 22 = 506; 506 ÷ 730 = 0.693; e−0.693 The 730 is twice the number of days in the year. The same formula works for any number of “slots”: replace 730 with twice the number of possible values.

This approximation is derived from the Taylor series expansion of ex and is particularly useful for larger ‘n’ values where direct multiplication becomes cumbersome. It provides a quick way to estimate the probability without needing to calculate many individual fractions.

Three people sharing a birthday

88 people. For four people, about 187. Shared birthdays between pairs are common; larger coincidences take far more people.

This is because the number of combinations for three people to share a birthday grows much faster than for two. You are not just looking for any pair, but for a specific triplet. The problem shifts from “any two match” to “any three match,” which is a significantly rarer event in smaller groups.

Near-matches

This variation of the problem is sometimes called the “generalized birthday problem.

The same maths elsewhere

  • PIN codes and passwords: With 10,000 possible 4-digit PINs, only about 119 people are needed for a 50% chance that two have the same PIN. This is far fewer in practice, because people favour predictable sequences like 1234 or birthdays (e.g., month and day). This non-random selection further increases the collision probability.
  • Random IDs: Software that gives random 32-bit IDs to records will see a collision after about 77,000 records with 50% probability. A 32-bit ID offers 232 (over 4 billion) unique possibilities. However, the birthday paradox shows that you will likely encounter a duplicate far sooner than you might expect simply by dividing the total possibilities by two. This is why modern systems use much longer 128-bit identifiers (UUIDs or GUIDs). These have 2128 possibilities, making collisions virtually impossible in practical applications.
  • Lotteries: Repeated winning number combinations surprise people for the same reason. While the odds of a specific sequence appearing twice are astronomically low, the odds of *any* sequence repeating *at some point* across many drawings become much higher due to the birthday paradox principle.

Real birthdays are uneven

The textbook answer assumes every day is equally likely. In reality, September birthdays are more common and holidays less common (see the most common birthdays). Uneven distributions always increase the chance of a match. However, the effect is tiny: with real US birth data, 23 people still give a probability of about 51%.

When certain “slots” (birthdays in this case) are more popular than others, it effectively reduces the number of *truly* available unique slots, making collisions more likely. Think of it like a game of musical chairs where some chairs are more desirable – people will gravitate towards them, increasing the chance of two people wanting the same one.

Try it yourself

Collect the birthdays of 30 people — a class, a team, a family group chat — and sort them by month and day. Seven times out of ten you will find a match. If you want to know how far apart two people’s birthdays are in days, the days between dates calculator gives the exact gap.

A collage of many diverse faces, representing a large group of people.

Frequently asked questions

What is the birthday paradox?

The surprising fact that only 23 people are needed for a better-than-even chance that at least two of them share a birthday. It’s called a paradox because the result goes against most people’s initial intuition about probability.

How many people for a 99% chance?

Why is it called a paradox?

It isn’t a true logical paradox in the sense of a contradiction. It is called a paradox because the mathematical result strongly contradicts most people’s common sense or intuition about probability, making the outcome seem highly unlikely at first glance.

Does 29 February change the answer?

Only negligibly; including 29 February (leap day) slightly increases the total number of possible birthdays to 366.

What if there are twins in the group?

If you explicitly know a group contains twins, they inherently share a birthday, guaranteeing a match. The birthday paradox calculation assumes each person’s birthday is an independent random event. If you include individuals who are known to share a birthday (like identical or fraternal twins born on the same day), you would adjust the group size or consider them as a single “birthday event” for the purpose of the calculation.

Sources

Photo of Yasir Hafeez

Written by

Yasir Hafeez is the founder and editor of ItsAgeCalculator. He builds the calculators, writes and checks the guides and articles, and tests every result against fixed date rules. He also runs OmniMatrics, a site of everyday calculators and converters.

More articles · Editorial policy · Spotted a mistake? Let us know.

Age tools