Birthday Paradox Calculator
Calculate the probability of shared birthdays in a group. Surprisingly high!
Formula
P = 1 - ∏(365-i)/365
Example
23 people → 50.7% chance of a shared birthday!
Embed this calculator on your site
Add this free calculator to your own website with one line of code. The embedded version is responsive, ad-free, and includes a small attribution link back to CalcNest AI.
<iframe src="https://calcnestai.com/embed/birthday-paradox-calculator.html" width="100%" height="700" frameborder="0" style="border: 1px solid #e5e5e5; border-radius: 12px; max-width: 720px;" loading="lazy" title="Birthday Paradox Calculator — Free Tool by CalcNest AI"></iframe>
Understanding the Birthday Paradox Calculator
The birthday paradox calculator finds the probability that at least two people in a group share a birthday. At 23 people it passes 50%, which is genuinely surprising, and understanding why reveals something useful about how badly human intuition handles combinations.
How it actually works
Enter the number of people. The calculator computes the probability that everyone has a distinct birthday by multiplying 364/365, then 363/365, and so on, then subtracts that from one. With 23 people, the chance of at least one shared birthday is 50.73%.
| People | Probability |
|---|---|
| 10 | 11.7% |
| 23 | 50.7% |
| 30 | 70.6% |
| 50 | 97.0% |
| 70 | 99.9% |
The deeper context most people miss
The reason intuition fails is that people instinctively ask how many others share their own birthday, which needs 253 people for a 50% chance. The actual question is whether any pair shares, and 23 people form 253 distinct pairs. It is the same number, arrived at from opposite directions, and the pair count is what drives the result.
Why the complement makes the calculation tractable
Calculating the probability of at least one match directly would require summing the probabilities of exactly one match, exactly two matches, and so on, which is unwieldy. The standard approach instead calculates the probability that nobody shares, which is a single product, and subtracts from one. The logic runs sequentially: the first person can have any birthday, so probability 365/365. The second must avoid the first's birthday, giving 364/365. The third must avoid two dates, giving 363/365. Continuing to n people gives a product that shrinks quickly, because each additional person must avoid an increasing number of dates. At 23 people the product falls to about 0.4927, so the chance of at least one match is 0.5073. This complement technique is broadly useful in probability whenever at least one appears in a problem, and recognising it converts many awkward calculations into simple ones. The underlying reason the result surprises people is combinatorial growth: the number of pairs in a group of n is n times n minus one, all over two, which grows quadratically rather than linearly. Ten people form 45 pairs, 23 form 253, and 50 form 1,225. Each pair is an independent opportunity for a match, and intuition tracks the number of people rather than the number of pairs, which is why the answer feels wrong.
A worked example: the two different questions
Ask two questions about a room of 23 people and get very different answers. First: what is the chance someone shares a birthday with you specifically? Each other person has a 364/365 chance of missing your date, so across 22 others the probability of no match is 364/365 raised to the 22nd power, about 0.9414, giving roughly a 5.9% chance someone matches you. Second: what is the chance any two people in the room share? That is 50.73%. The gap between 5.9% and 50.73% is entirely down to which question is being asked, and people conflate them constantly. To reach 50% for the first question you need around 253 people. That 253 is the same number as the pair count in a 23-person group, which is a pleasing coincidence rather than a deep connection, arising because both calculations involve the same underlying ratio. The practical lesson generalises well beyond birthdays: whenever a problem involves any pair matching rather than a specific match, the probability rises far faster than intuition suggests. This applies to coincidences generally, and it explains why apparently remarkable coincidences occur far more often than people expect, since we notice any coincidence rather than a pre-specified one.
Where this actually matters outside parties
The birthday problem is the mathematical basis of an entire class of cryptographic attack, and this is its most consequential application. A hash function maps data of any size to a fixed-length output, and a collision occurs when two different inputs produce the same hash. Finding a collision with a specific target hash requires searching roughly the full output space, but finding any collision between two arbitrary inputs requires only about the square root of that space, by exactly the reasoning above. This is why a hash function with a 128-bit output offers only about 64 bits of collision resistance, and why cryptographers specify output lengths with the birthday bound in mind. It has practical consequences: MD5 and SHA-1 were both broken in part through collision attacks, with practical SHA-1 collisions demonstrated in 2017, which is why both are deprecated for security purposes. The same reasoning applies to randomly generated identifiers: a system generating random 32-bit IDs will see its first collision after roughly 77,000 IDs rather than after four billion, which surprises developers regularly and causes real bugs. UUID version 4 uses 122 random bits specifically so the birthday bound remains astronomically distant. The principle also appears in DNA profiling, where the probability of any two profiles in a database matching is far higher than the probability of a specific match, which matters for interpreting cold hit evidence.
The simplifying assumptions and how much they matter
The standard calculation assumes birthdays are uniformly distributed across 365 days and ignores leap years, and neither assumption holds exactly. Real birth distributions are not uniform: in many countries September births are notably more common, consistent with conception around the December holiday period, and there are dips around specific dates, with 25 December and 1 January being notably low in the US and Christmas Day low in many Western countries. Scheduled caesarean sections and induced labours also cluster on weekdays and away from public holidays, producing a visible weekday effect in modern data. The direction of the effect on the birthday problem is worth knowing: any deviation from uniformity increases the probability of a match, because clustering makes shared birthdays more likely. So the true probability at 23 people is slightly above 50.73%, though the effect is small enough that it changes the answer by a fraction of a percentage point. Leap years add 29 February with roughly a quarter of the frequency of other dates, and including it makes almost no difference. The assumptions are therefore conservative in the sense that they slightly understate the probability, and the classic result holds comfortably. This is a good example of a model whose assumptions are known to be false and which remains entirely fit for purpose, since the direction and magnitude of the error are both understood.
Variations: near matches, multiple matches, and generalisations
Several related problems have their own answers. The probability that three people share a birthday requires only 88 people for a 50% chance, which is again lower than intuition suggests. Near matches, where birthdays fall within a day of each other, reach 50% at just 14 people, and within a week at around 7. The generalised birthday problem replaces 365 with any number of possible values, and the approximate threshold for a 50% chance of collision is roughly 1.18 times the square root of the number of possibilities, which is the formula cryptographers use. The birthday attack in cryptography applies this directly. Related coincidence problems include the coupon collector problem, which asks how many draws are needed to see every possible value at least once and requires far more draws than the birthday problem needs for a collision, illustrating how differently these two questions behave. The pigeonhole principle gives the trivial upper bound: with 366 people a shared birthday is certain, and with 367 accounting for leap years.
Understanding the birthday paradox
Distinguish the two questions clearly, since the chance that anyone shares with you specifically is about 5.9% at 23 people while the chance that any two people share is 50.7%. Think in pairs rather than people, since a group of n contains n times n minus one over two pairs, which grows quadratically and drives the result. Use the complement approach when calculating, computing the probability that nobody matches and subtracting from one, since it turns an unwieldy sum into a single product. Remember the practical threshold: 23 for a coin flip, 50 for near certainty at 97%, and 70 for 99.9%. Recognise the pattern in other contexts, particularly hash collisions where the birthday bound halves effective security in bits, and randomly generated identifiers where collisions arrive after roughly the square root of the possible values. And note that real birthdays are not uniformly distributed, which slightly increases the true probability rather than decreasing it.
What people get wrong
- Confusing whether anyone shares a birthday with you specifically, which needs 253 people for a 50% chance, with whether any two people share, which needs only 23.
- Thinking in terms of the number of people rather than the number of pairs, when pairs grow quadratically and 23 people form 253 of them.
- Assuming non-uniform real birth distributions weaken the result, when any clustering increases the probability of a match rather than reducing it.
- Overlooking the same reasoning in hash functions and random identifiers, where collisions appear after roughly the square root of the possible values rather than the full space.
Where the math comes from
P(at least one shared birthday) = 1 - P(all distinct), where P(all distinct) is the product of (365 - i) / 365 for i from 1 to n-1. This complement approach turns an unwieldy sum over the possible numbers of matches into a single product. The calculation assumes uniformly distributed birthdays across 365 days and ignores leap years; real distributions are non-uniform, which slightly increases the true probability.
Questions and answers
How do leap years work?
Every 4 years EXCEPT century years not divisible by 400. So 2000 was a leap year (divisible by 400); 1900 was not. 2024 was; 2025 is not; 2028 will be.
How do I handle time zones?
Use UTC for storage and convert at display. World Clock tools handle the conversions; calendar apps handle scheduling across zones.
Business days vs calendar days?
Business days exclude weekends and holidays. 5 business days from a Monday usually lands on Monday (next week); from a Friday, the next Friday. Holidays vary by country.
How does DST affect calculations?
Adds or removes 1 hour twice a year. Naive 'add X hours' across DST transitions is off by 1 hour. Calendar arithmetic typically handles this correctly.
What is UTC?
Coordinated Universal Time - the global time reference. Offset by hours from local times (NYC is UTC-5 in winter, UTC-4 in summer).
Why does it only take 23 people?
Because the question is whether any two people share, not whether someone shares with you. A group of 23 contains 253 distinct pairs, and each pair is an opportunity for a match. Pairs grow quadratically with group size while intuition tracks the number of people, which is why the answer feels wrong.
What if I want someone to share my birthday specifically?
That's a different and much harder question. With 23 people the chance is only about 5.9%, and reaching 50% requires around 253 people. Conflating these two questions is the single most common source of confusion about the birthday paradox.
How does the calculation work?
By computing the probability that nobody shares and subtracting from one. The first person can have any birthday, the second must avoid one date at 364/365, the third must avoid two at 363/365, and so on. At 23 people that product falls to about 0.4927, leaving 50.73% for at least one match.
Does ignoring leap years matter?
Barely. Adding 29 February at roughly a quarter the frequency of other dates changes the answer by a negligible amount. The more interesting deviation is that real birth distributions aren't uniform, with September births more common and holidays less so, and any clustering slightly increases the probability of a match.
Where does this matter in practice?
In cryptography, most importantly. Finding any hash collision requires only about the square root of the output space rather than the full space, which is why a 128-bit hash offers roughly 64 bits of collision resistance. This reasoning underpinned practical attacks on MD5 and SHA-1.
How many people for near certainty?
Fifty people gives 97%, seventy gives 99.9%, and 366 makes it mathematically certain by the pigeonhole principle, or 367 accounting for leap years. The curve rises steeply between 20 and 50 and then flattens as it approaches one.
What about three people sharing a birthday?
That requires around 88 people for a 50% chance, which is again lower than most people expect. Near matches are lower still, with birthdays falling within one day of each other reaching 50% at just 14 people and within a week at around 7.
Related calculators
Drone Flight Time · Lawn Mowing Time · Book Reading Time · Storage Unit Size · Date Difference