Skip to content
MoneyDeck

Birthday Paradox Calculator

Chance that two people in a group share a birthday — and why it is so high

Updated · Free, no signup

Use 365 for birthdays, or any number of equally likely values (e.g. possible PINs or hash outputs).

%

Finds the smallest group with at least this chance of a match.

Probability at least two share a birthday

50.7297%

Probability all birthdays differ

49.2703%

Number of pairs in the group

253

Expected matching pairs

0.6932

Probability someone shares a specific person’s birthday

5.8571%

Smallest group for target probability

23

  • A group of 23 contains 253 pairs of people — that is why matches are likelier than intuition suggests.
  • With 365 equally likely days, 23 people give at least a 50% chance of a shared birthday.

Chance of a shared birthday by group size

About the Birthday Paradox Calculator

This birthday paradox calculator answers the classic birthday problem: in a room of n people, what is the chance that at least two of them share a birthday? Enter the group size and it returns the exact probability, the chance that everyone’s birthday is different, the expected number of matching pairs, the much smaller chance that someone shares your own birthday, and the smallest group needed to reach any target probability.

The famous answer — just 23 people give better than even odds — surprises almost everyone, which is why the problem is a staple of probability classes, team-building puzzles and job interviews. The same mathematics underpins hash collisions and “birthday attacks” in cryptography, so you can change the number of days to any number of equally likely values (for example 1,000,000 possible IDs).

The calculation assumes 365 equally likely birthdays and ignores leap days and twins. Real birthdays are slightly uneven across the year, which makes a shared birthday a little more likely than the figures shown, not less.

With the default inputs, the probability at least two share a birthday is 50.7297%. Change any value above to recalculate instantly.

How to use the birthday paradox calculator

  1. 1Enter the number of people in the group.
  2. 2Keep 365 days for birthdays, or change it to model other collisions.
  3. 3Set a target probability to find the group size needed to reach it.
  4. 4Compare “any two share” with “someone shares a specific birthday” in the chart.

Formula and method

P(match) = 1 − [d × (d − 1) × … × (d − n + 1)] ÷ dⁿ = 1 − ∏ᵢ₌₁ⁿ⁻¹ (1 − i/d)

It is easiest to compute the chance that nobody shares a birthday and subtract it from 1. The first person can have any birthday; the second must avoid one day (probability (d − 1)/d); the third must avoid two days ((d − 2)/d); and so on. Multiplying these n − 1 factors gives the probability that all birthdays differ.

The expected number of matching pairs is C(n, 2) ÷ d, because each of the n(n − 1)/2 pairs matches with probability 1/d. The chance that someone matches one particular person’s birthday is much lower, 1 − ((d − 1)/d)^(n − 1), since only n − 1 comparisons are involved. A handy approximation is P(match) ≈ 1 − e^(−n²/2d), so a 50% chance needs about 1.18√d people.

n
Number of people
d
Number of equally likely birthdays (365)
C(n, 2)
Number of pairs, n(n − 1)/2

Worked examples

The classic 23 people

Twenty-three people form 253 pairs. The probability that all 23 birthdays differ is 365 × 364 × … × 343 ÷ 365²³ = 0.4927, so the chance of at least one match is 50.73%. Yet the chance that someone shares one particular person’s birthday is only 5.86%.

A class of 50 students

With 50 people there are 1,225 pairs and an expected 3.36 matching pairs, so a shared birthday is 97.04% likely. Reaching 99% certainty takes 57 people.

30 items sharing 100 possible IDs

If 30 items each get one of 100 equally likely IDs, a collision is 99.22% likely. Just 13 items already give better-than-even odds, roughly 1.18 × √100 ≈ 12 — the same effect that drives hash collisions.

Frequently asked questions

Why is it called the birthday paradox?+

It is not a true paradox, just a strongly counter-intuitive result. People compare themselves with others (22 comparisons in a group of 23), but a match can occur between any two people, and 23 people form 253 pairs, enough to make a match more likely than not.

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

Twenty-three people give a 50.7% chance. For a 90% chance you need 41 people, for 99% you need 57, and with 70 people the probability is about 99.9%. Only 366 people (ignoring leap days) guarantee a match.

What is the chance that someone shares my birthday?+

Much lower: with n other people it is 1 − (364/365)ⁿ. You need 253 other people to reach a 50% chance that at least one shares your specific birthday, compared with 23 for any two people to share.

Does the calculation account for leap years and uneven birth rates?+

No — it assumes 365 equally likely days. Including 29 February changes the results only slightly. Real birthdays are not spread perfectly evenly across the year, and any unevenness makes a shared birthday slightly more likely, so real-world odds are, if anything, a little higher than shown.

How is the birthday paradox used in cryptography?+

A birthday attack exploits the fact that collisions among d possible hash values become likely after about √d attempts rather than d. That is why a hash with 2¹²⁸ outputs offers only about 2⁶⁴ collision resistance, and why secure hashes use long outputs.

Related tools