Toolstia / Birthday paradox calculator
Birthday paradox calculator
In a room of just 23 people there is a better than even chance that two share a birthday. Enter a group size to see the probability, or enter a target probability to find the smallest group that reaches it. You can change the number of possible birthdays too.
It feels like you would need far more than 23 people for a 50 percent chance, but the number of pairs grows quickly. This assumes every day is equally likely and ignores leap days.
How it works
- Choose probability for a group or group size for a target.
- Enter the number of people or the target percentage.
- Read the chance and the number of pairs.
Why it surprises people
You are not matching your own birthday. In a group of n people there are n(n-1)/2 pairs, and any pair can match.
The calculation
It works out the chance that everyone has a different birthday by multiplying 365/365, 364/365, 363/365 and so on, then subtracts from 1.
Other cycles
Change the number of possible birthdays to model other cases, such as 1,000 equally likely codes or 12 months.
Assumptions
Every day is equally likely and leap days are ignored. Real birthdays are slightly uneven, which makes a match a little more likely.
Questions
Is 23 people exactly 50 percent?
It is about 50.7 percent. With 22 people it is about 47.6 percent. Everything happens in your browser, and nothing you enter is sent anywhere.
At what size is a match certain?
With 366 people in a 365 day year there must be a match. In practice 70 people give over 99.9 percent.
Does it apply to hash collisions?
Yes. The same maths shows how quickly random identifiers collide.