Generador Studio

The Birthday Paradox: Why 23 People Is Enough

Last updated: November 9, 2026

If someone tells you that in a room of 23 people it is more likely than not that two share a birthday, almost nobody believes it at first. But it is exact mathematics, not a trick: the probability is about 50.7%. This is called the birthday paradox, although strictly it is not a paradox but a result that clashes with intuition. This guide explains why it happens, gives the full table, and shows where it appears in real life, from raffles to unique identifiers.

The question and the surprising answer

The question is: how many people do you need to gather for the probability that at least two share a birthday to pass 50%? Almost everyone guesses a large number, close to 180 (half of 365). The correct answer is 23. With 23 people the probability is 50.73%; with 30 it rises to 70.6%; with 50, to 97.0%; and with 70 it is 99.9%, practically certain.

Intuition fails because we think of "someone matching me", and that does require many people (calculated below). The real problem asks about any pair within the group, and the number of pairs grows much faster than the number of people.

Why it happens: count the pairs, not the people

In a group of 23 people there are 23 × 22 ÷ 2 = 253 distinct pairs, and each one is a chance to match. With 10 people there are 45 pairs; with 50 people, 1,225. The number of chances grows with the square of the group size, not linearly.

The easiest way to compute the probability is to use the complement: the probability that NOBODY matches. The first person has 365 possible days; the second must avoid the first one's (364 of 365 options), the third must avoid the previous two (363 of 365), and so on. Multiply those fractions and the result is the probability that all birthdays are different; subtract it from 1 and you get the probability of at least one match. With 23 people, the probability that all are different falls to 49.3%, which is why the probability of a match goes past 50%.

Probability that at least two people share a birthday (365 equally likely days)
People in the groupPossible pairsProbability of at least one match
104511.7%
2019041.1%
2325350.7%
3043570.6%
4078089.1%
501,22597.0%
571,59699.0%
702,41599.9%

What it is NOT: matching one specific person

If instead you ask how many people you need for at least one to have YOUR birthday, the answer is much larger: 253 people to reach 50% (and it is a curious coincidence that 253 is also the number of pairs in a group of 23). Here each new person has only one chance to match you, not to match everyone else.

That difference is the heart of the paradox: "someone matches someone" is a far more likely event than "someone matches me". In raffles, databases and cryptography, the first question is almost always the one that matters.

What these numbers assume

The table assumes two simplifications: that all 365 days are equally likely and that nobody is born on February 29. In reality births are not spread perfectly evenly (some times of year have more births than others). Mathematically, any departure from uniformity makes the probability of a match slightly higher, not lower, so the 50.7% for 23 people is in practice a slightly conservative value. Including February 29 lowers it very little.

Where it shows up in practice: collisions

The same calculation, replacing 365 with the number of possible values, tells you when two items "chosen at random" are likely to repeat. When you pick several items at random from a set, repeats arrive much sooner than it seems. That is why a raffle with random ticket numbers has collisions more often than expected, and why random identifiers need enormous spaces.

The same formula applied to other "birthday spaces"
SituationPossible valuesItemsProbability of at least one repeat
Tickets with a random number1,000104.4%
Tickets with a random number1,0003035.6%
Random codes10,00010039.1%
UUID v4 (122 random bits)≈5.3 × 10³⁶≈2.7 × 10¹⁸50% (approx.)

What to do about it

If you run a raffle with random numbers and repeats are a problem (for example, tickets that must be unique), do not trust that "they will not repeat": either generate them and discard duplicates, or use a space of values much larger than the square of how many you need. A practical rule: to keep the collision probability low, the number of possible values should be at least on the order of the square of the number of items you plan to generate.

And if you want to check the paradox yourself, generate groups of 23 random dates or numbers with any random generator and count how many groups contain at least one repeat: with enough repetitions of the experiment, the percentage approaches 50%.

Related generators

Frequently asked questions

How many people are needed for a better than 50% chance of a shared birthday?
Only 23. With 23 people the probability that at least two share a birthday is about 50.7%, assuming 365 equally likely days.
Why does it seem so counterintuitive?
Because we think of someone matching us, not any pair in the group. With 23 people there are 253 possible pairs, and each can match.
How many people are needed for someone to share MY birthday with a 50% chance?
About 253 people. It is a different question: here each new person is compared against only one fixed date, yours.
Does the result change if births are not uniform across the year?
Yes, but in the opposite direction from what many expect: the less uniform the distribution, the higher the probability of a match. That is why the 50.7% value is slightly conservative.
What does it have to do with raffles or unique identifiers?
It is the same calculation: when you pick values at random from a set of d possibilities, repeats become likely around the square root of d, long before the set is exhausted. That is why an identifier with 122 random bits (like UUID v4) only reaches a likely collision after about 2.7 × 10¹⁸ values.

Ver esta guía en español →