Birthday Paradox Calculator

This birthday paradox calculator finds the probability that at least two people in a group share a birthday, and the group size needed for any target probability. It works for any number of possible days, not only 365.

Change this for hash collisions, 366 days, lottery numbers and so on.

Checks on your data

  • The calculation assumes 365 equally likely days and ignores twins and leap days. Real birthdays are not perfectly uniform, which makes matches slightly more likely than shown.

Results

Chance at least two of 23 share a birthday
0.5072972
50.73 %
Chance everyone is different
0.4927028
People needed for a 90% chance
41
People needed for 50%
23
the famous 23
People needed for 99%
57
Number of pairs of people
253
Expected number of matching pairs
0.69315
Quick approximation 1 − e^(−n(n−1)/2d)
0.500002
very close for moderate n
Probability of a shared birthday as the group grows (365 possible days)
0%50%100%102030405060n = 2390% at 41Number of people
Chance of a shared birthday by group size (365 possible days)
PeopleProbabilityComment
52.7136 %
1011.695 %
1525.29 %
2041.144 %
2350.73 %over 50%
3070.632 %
4089.123 %
5097.037 %
6099.412 %
7099.916 %over 99.9%
100100 %
Show step-by-step solution
  1. Probability that all 23 people have different birthdays = (365/365) × (364/365) × … × (343/365) = 0.49270277.
  2. So P(at least one shared birthday) = 1 − 0.49270277 = 0.50729723.
  3. Searching n upward, the smallest group with probability at least 90% is n = 41.
23 peopleover 50% shared birthday
70 peopleover 99.9%
WhyPairs grow like n²
Also modelsHash collisions

What Is Birthday Paradox?

The birthday paradox is the surprising fact that a small group already has a good chance of a shared birthday. The probability that all n birthdays are different is the product (d/d) × ((d − 1)/d) × … × ((d − n + 1)/d) with d possible days, and the chance of at least one match is 1 minus that.

The calculator reports the probability for your group size, the number of pairs of people, the expected number of matching pairs, and the group size needed for 50 % and 99 %. It also shows a quick exponential approximation. Set d to a different number to model other situations, such as matching hash values.

Below you will find the formulas, a variables table, a worked example and answers to common questions such as why the answer feels counter-intuitive.

How to Use the Birthday Paradox Calculator

  1. Enter the number of people in the group.
  2. Leave the number of possible values at 365, or change it for other collision problems.
  3. Set a target probability to see the group size needed to reach it.
  4. Read the exact probability, the pairs count and the curve. Use the table for a quick lookup.

Birthday Paradox Formula

Probability that all n birthdays differ

P(no match)=∏i=0n−1d−id=d!(d−n)! d nP(\text{no match})=\prod_{i=0}^{n-1}\frac{d-i}{d}=\frac{d!}{(d-n)!\,d^{\,n}}

Probability of at least one match

P(match)=1−d!(d−n)! d nP(\text{match})=1-\frac{d!}{(d-n)!\,d^{\,n}}

Approximation

P≈1−e−n(n−1)/(2d)P\approx1-e^{-n(n-1)/(2d)}

Group size for 50% (rule of thumb)

n≈1.1774dn\approx1.1774\sqrt{d}

Birthday Paradox Variables Explained

SymbolMeaningNotes
nNumber of people
dNumber of possible days (or values)365 by default
P(all differ)No shared birthdayProduct of falling fractions
P(match)At least one shared birthday1 − P(all differ)
n(n − 1)/2Number of pairs

Birthday Paradox Worked Example

Using the example values (press “Load example” above to try them):

  1. Probability that all 23 people have different birthdays = (365/365) × (364/365) × … × (343/365) = 0.49270277.
  2. So P(at least one shared birthday) = 1 − 0.49270277 = 0.50729723.
  3. Searching n upward, the smallest group with probability at least 90% is n = 41.

Result: Chance at least two of 23 share a birthday = 0.5072972; People needed for a 90% chance = 41.

Why does it work with so few people?

The number of pairs grows with the square of the group. With n people there are n(n − 1)/2 pairs. Ten people have 45 pairs, 23 have 253, and 50 have 1,225. Each pair has a small chance of matching, but with hundreds of pairs those small chances add up quickly.

It is also easier to compute the chance that everyone has a different birthday and subtract from 1. The second person avoids the first person’s birthday with probability 364/365, the third avoids both with 363/365, and so on; multiplying these gives the chance of no match.

Shared birthday probability (365 days)
PeoplePairsProbability of a match
104511.7%
2019041.1%
2325350.7%
3043570.6%
4078089.1%
501,22597.0%
702,41599.92%

Assumptions and real-world differences

  • Birthdays are uniformly spread over 365 days. In reality there are seasonal patterns, which make a match slightly more likely.
  • February 29 is ignored. Using 366 changes the numbers only slightly.
  • People are unrelated: twins or family members would increase the chance of a match.
  • The question is about any pair sharing a birthday, not about sharing a particular person’s birthday. The chance someone matches your birthday needs about 253 people for 50%.

The same maths in computing and security

The birthday problem describes collisions: two items landing in the same bucket. In computing it explains why hash functions need many more bits than you might expect. A hash with d possible outputs starts producing collisions after about √d items, which is why a 128-bit hash gives only about 64 bits of collision resistance. Cryptographic “birthday attacks” exploit this. Change the “possible values” input to 2^32 = 4,294,967,296 to see that around 77,000 random 32-bit IDs already have a 50% chance of a collision.

Where Birthday Paradox Is Used

Probability teaching

Showing a counter-intuitive result with exact numbers.

Collision estimates

Estimating the chance of repeated values when d possible values are drawn at random.

Group planning

Finding how many people make a shared birthday likely.

Checking the approximation

Comparing the exact value with the exponential estimate.

Common Birthday Paradox Mistakes to Avoid

  • To match a specific date, not any pair, use the “at least once” probability with p = 1/365 instead.
  • For large d, the square-root rule n ≈ 1.18√d gives the 50% point.
  • The curve is S-shaped: it moves slowly at first, then quickly, then flattens.

Birthday Paradox Terms and Definitions

Collision
Two items mapping to the same value.
Pair
A combination of two people; there are n(n − 1)/2 in a group of n.

Birthday Paradox FAQs

What is the birthday paradox?

The counter-intuitive fact that in a group of only 23 people there is about a 50.7% chance that two share a birthday.

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

57 people give about 99% chance. With 70, the chance is over 99.9%.

Is it really a paradox?

No. It is only surprising because we compare with a single person’s birthday, while the question involves every pair in the group.

What is the chance someone shares my birthday?

That is a different problem. You would need about 253 people for a 50% chance, because only comparisons with your own date count.

How is it used in cryptography?

Birthday attacks look for hash collisions in about √d tries rather than d. That is why hash outputs need to be long.

Does leap day change the result?

Slightly. With 366 days the group size for 50% is still 23, and the probabilities differ only in the third decimal place.

Can I use a number of days other than 365?

Yes. Enter any number of possible values to model other collision problems.

Related calculators

Last updated 2026-11-09. See our disclaimer.