Birthday Paradox Calculator

The birthday paradox says that in a group of just 23 people there is a better than 50% chance that two share a birthday: exactly 50.73% for 365 days. It seems surprising only because 23 people form 253 pairs.

Last updated · By · Runs in your browser, nothing is uploaded

Result

Step-by-Step Solution

Enter your values above to see the full working.

What Is the Birthday Paradox?

The birthday paradox (or birthday problem) asks how many people you need in a room before it is more likely than not that at least two of them share a birthday. Most people guess around 180, half of 365. The real answer is just 23.

It is called a paradox only because the result clashes with intuition, not because it is logically contradictory. The intuition goes wrong because we think about matching our own birthday, which needs about 253 people for a 50% chance. But the question allows any two people to match, and the number of pairs grows much faster than the number of people.

How Quickly the Chance Grows

People in the groupProbability of at least one shared birthday
1011.69%
2041.14%
2350.73%
3070.63%
4089.12%
5097.04%
5799.01%
7099.92%

Birthday Problem Formula

It is easiest to calculate the probability that everyone has a different birthday, and subtract from 1:

P(all different) = 365 × 364 × … × (365 − n + 1) ÷ 365ⁿ P(at least one match) = 1 − P(all different)
  • n is the number of people.
  • The numerator multiplies the choices: the first person can have any of 365 days, the second any of the remaining 364, and so on.
  • The denominator 365ⁿ is the total number of equally likely birthday assignments.
  • For other “year lengths” replace 365 by the number of possible values, which is useful for hash collisions.

A handy approximation is P ≈ 1 − e^(−n(n − 1) ÷ (2 × 365)). For counting pairs, see the combination calculator: the number of pairs among n people is C(n, 2) = n(n − 1) ÷ 2.

The Same Idea for Any Number of Possibilities

For N equally likely values, a collision becomes about 50% likely after roughly 1.18 × √N draws. With N = 365 that gives 22.5, matching the answer of 23. With a million possible IDs you need only about 1,177 random IDs for a coin-flip chance of a duplicate, which is why large systems use much longer identifiers.

Worked Example: A Group of 23

  1. All different: (365 ÷ 365) × (364 ÷ 365) × (363 ÷ 365) × … × (343 ÷ 365) = 0.4927.
  2. At least one match: 1 − 0.4927 = 0.5073, or 50.73%.
  3. Number of pairs: 23 × 22 ÷ 2 = 253.
  4. Approximation: 1 − e^(−506 ÷ 730) = 1 − e^(−0.693) = 0.500, a close match.

Why 253 Pairs Make the Difference

Each pair has a 1 in 365 chance of matching. With 253 pairs the expected number of matching pairs is 253 ÷ 365 = 0.69, which is already high enough that at least one match is as likely as not. Compare that with the 22 pairs that include you: those give only a 6% chance that someone shares your birthday.

Variations

The model assumes that all 365 dates are equally likely and ignores 29 February. In reality, birthdays are slightly clustered, which makes shared birthdays a little more likely, so the true figures are a touch higher than the calculator’s.

How to Use This Birthday Paradox Calculator

  1. Enter the number of people in the group.
  2. Leave the days in the year at 365, or change it to model other situations, for example 366 or the size of a hash space.
  3. Read the probability of at least one shared birthday, the probability that all are different, the group size needed for 50% and the number of pairs.

For related counting questions, the probability calculator covers the basic rules of combining events.

Real-World Uses of the Birthday Problem

  • Cryptography: the “birthday attack” finds collisions in hash functions far faster than brute-force guessing. A 128-bit hash offers only about 64 bits of collision resistance.
  • Database design: estimating how likely randomly generated IDs are to collide.
  • Classrooms and parties: a classic demonstration of how poor human intuition is about probability.
  • Genetics and ecology: estimating repeated matches in samples drawn from limited categories.
  • Quality control: estimating the chance of duplicate serial numbers or sample labels.

What Are the Most Common Mistakes With the Birthday Paradox Calculator?

  • Confusing “any match” with “my birthday”. The paradox is about any pair. Matching one specific person is far less likely.
  • Assuming uniform birthdays. Real births vary through the year, and that raises the true probability slightly.
  • Ignoring leap years. The standard model uses 365 days.
  • Dividing by 2. The linear guess of 365 ÷ 2 = 182 ignores that pairs grow quadratically.
  • Applying it to non-random groups. Twins, siblings or a team with a hiring pattern break the independence assumption.
  • Reading 50.73% as a guarantee. Even with 23 people, nearly half of such groups will have no matches.

Where Can You Verify These Formulas?

The definitions and formulas on this page follow standard references. Check them against these sources:

Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.

Frequently Asked Questions

What is the birthday paradox?

It is the surprising fact that in a group of only 23 people there is a better than 50% chance that at least two share a birthday.

How many people are needed for a 99% chance of a shared birthday?

About 57 people give a 99% chance, and 70 people give over 99.9%.

What is the formula for the birthday problem?

P(at least one match) = 1 − 365! ÷ [(365 − n)! × 365ⁿ]. It is calculated as 1 minus the probability that all n birthdays are different.

Why is the answer so much smaller than most people expect?

Because any two people can match. A group of 23 has 253 pairs, and each pair offers a chance of a match.

How is the birthday paradox used in cryptography?

The birthday attack uses the same maths to find hash collisions. Finding two inputs with the same hash takes roughly the square root of the number of possible hash values.

Does it matter that birthdays are not evenly spread over the year?

Slightly. Uneven birthdays make a shared birthday somewhat more likely, so the real probability is a little higher than the uniform model suggests.