TTKTheTextKit

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 of a shared value
50.7297%
Chance of no match
49.2703%
Chance someone matches you
5.85713%
Among the other 22 people
Pairs to compare
253
Expected matching pairs: 0.693
Chance you wantAny two shareSomeone shares yours
50%23 people253 others
90%41 people840 others
99%57 people1,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]

About 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.