Birthday Paradox Calculator
Enter how many people are in the room and how many possible birthdays there are, and the calculator gives the chance that at least two of them share one. It also shows the chance that someone matches you in particular, the number of pairs, the expected number of matching pairs, and how many people you need for a 50%, 90% or 99% chance. Change the number of possible values to use the same maths for hash collisions, random IDs or any draw with repeats. Everything runs in your browser.
| Chance you want | Any two share | Someone shares yours |
|---|---|---|
| 50% | 23 people | 253 others |
| 90% | 41 people | 840 others |
| 99% | 57 people | 1,679 others |
The chance that all n people have different birthdays is 365/365 x 364/365 x 363/365 and so on, one factor per person. The tool multiplies those factors exactly, assuming every day is equally likely and ignoring leap days when you use 365. Real birthdays are not perfectly even, which makes a match slightly more likely. Change the number of possible values to use the same maths for hash collisions, random IDs or any other draw with repeats. Everything runs in your browser.
Related Tools
[5 suggestions]Permutation and Combination Calculator
Count permutations (nPr) and combinations (nCr), with or without repeats, plus factorials, as exact whole numbers.
Math & MoneyBinomial Probability Calculator
Find the chance of exactly, at most or at least k successes in n trials, with the mean, standard deviation and a chart of the whole distribution.
Math & MoneyHypergeometric Distribution Calculator and Lottery Odds
Find the probability of drawing k successes without replacement from a population, such as aces in a hand or defects in a sample, and work out lottery odds.
Student ToolsPoisson Distribution Calculator
Find Poisson probabilities for exactly, at most, at least, fewer than, more than or between k events, with the mean, spread and a full probability table.
Student ToolsDice Probability Calculator
Find the exact odds for any dice roll, including keep highest, keep lowest, advantage and 4d6 drop lowest, with a full table and a roll button.
Student ToolsAbout the Birthday Paradox Calculator
The birthday paradox is the surprise that a small group is likely to contain a shared birthday. The chance that everyone has a different birthday is 365/365 x 364/365 x 363/365 and so on, one factor for each person, and the chance of a match is 1 minus that product. With 23 people the chance of a match is 50.73%, with 30 it is 70.63%, and with 57 it is 99.01%. It feels wrong because the question is about any pair, and 23 people make 253 pairs. A match with your own birthday is a different, much rarer event: you need 253 other people for a 50% chance. The same formula covers collisions in computing. With 2^32 possible values, about 77,164 random items give a 50% chance of a duplicate, and with 2^64 values it takes about 5.06 billion. For large spaces the calculator switches to an accurate series, so the answer stays exact enough even when the number of values is huge. It assumes every value is equally likely, and real birthdays are not perfectly even, which makes a match slightly more likely.
How many people are needed for a 50% chance of a shared birthday?▾
Twenty-three people give a 50.73% chance, ignoring leap days and assuming every birthday is equally likely.
Why is the birthday paradox surprising?▾
Because 23 people form 253 different pairs, and any one of those pairs can match. People tend to think only of a match with their own birthday.
How many people are needed to match my birthday?▾
About 253 other people for a 50% chance, and 840 for 90%.
Does it apply to hash collisions?▾
Yes. Set the number of possible values to the size of the hash space. For a 32-bit hash, about 77,164 random items give a 50% chance of a collision.
Is my data uploaded?▾
No. The calculation runs in your browser and nothing you enter is sent anywhere.