Birthday Problem Calculator
Find the probability that at least two people in a group of any size share the same birthday.
people
days
In a group of 23 with 365 possible days
- 1
Log P(all distinct)
Σᵢ₌₀^22 ln((365 − i) ÷ 365) = -0.707849Log-space sum avoids underflow when multiplying many small fractions. - 2
P(all distinct)
exp(-0.707849) = 0.492703 - 3
P(at least two share a birthday)
(1 − 0.492703) × 100 = 50.73
How does this calculator work?
The birthday problem gives the probability that at least two people in a group share a birthday. Using P = 1 - ∏(d-i)/d, a group of just 23 people has about a 50.7% chance of a shared birthday with 365 days. Probability rises fast and hits 1 once people exceed days.
Formula
How this is calculated
Enter n, the number of people in the group, and d, the number of possible distinct days (365 by default for a year ignoring leap days). The calculator returns the probability that at least two people share a birthday, the complementary probability that everyone has a distinct birthday, and a curve of the shared-birthday probability as the group grows.
The core formula computes the probability that all n birthdays are distinct as the product (d/d)·((d-1)/d)·((d-2)/d)·…·((d-n+1)/d). The probability that at least two coincide is one minus that product. To stay numerically stable for large n we evaluate the product in log space as 1 - exp(Σ ln((d-i)/d)) for i from 0 to n-1, which avoids underflow from multiplying many small fractions.
Assumptions: birthdays are independent and uniformly distributed across the d days, which slightly overstates distinctness in reality. n and d are treated as positive integers (non-integer inputs are floored). Edge cases: if n is 1 or less the shared probability is 0, and if n exceeds d the pigeonhole principle forces a shared day so the probability is exactly 1. The famous result is that just 23 people give about a 50.7% chance of a shared birthday.
Frequently asked questions
Because the comparison is between every pair of people, not between you and one specific person. With 23 people there are 253 pairs, and the chance that none of those pairs match drops below one half.
With 365 possible days, 366 people guarantee a match by the pigeonhole principle, so the probability becomes exactly 1 once n exceeds d.
No. It assumes birthdays are uniformly and independently distributed over d days. Real birth distributions are slightly uneven, which marginally raises the chance of a match.
Also known as
TG we-Calculate Editorial Team. (2026). Birthday Problem Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/birthday-problem-calculator
TG we-Calculate Editorial Team. "Birthday Problem Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/birthday-problem-calculator.
TG we-Calculate Editorial Team, "Birthday Problem Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/birthday-problem-calculator
@misc{wecalculate_birthday_problem_calculator, title = {Birthday Problem Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/birthday-problem-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
