Advanced

Birthday Problem Calculator

Find the probability that at least two people in a group of any size share the same birthday.

people

Size of the group

days

365 for a non-leap year
Probability at least two share a birthday
50.73%

In a group of 23 with 365 possible days

P(shared birthday)
50.7297%
P(all distinct)
49.2703%
Group size
23
Possible days
365
P(shared) vs group size (1 to 60)
Step by step
  1. 1

    Log P(all distinct)

    Σᵢ₌₀^22 ln((365 − i) ÷ 365) = -0.707849
    Log-space sum avoids underflow when multiplying many small fractions.
  2. 2

    P(all distinct)

    exp(-0.707849) = 0.492703
  3. 3

    P(at least two share a birthday)

    (1 − 0.492703) × 100 = 50.73
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

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
P(at least two share) = 1 - ∏(i=0..n-1) (d - i) / d
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

birthday paradox
birthday problem
shared birthday probability
same birthday odds
coincidence probability
birthday collision
two people same birthday

APA

TG we-Calculate Editorial Team. (2026). Birthday Problem Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/birthday-problem-calculator

Chicago

TG we-Calculate Editorial Team. "Birthday Problem Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/birthday-problem-calculator.

IEEE

TG we-Calculate Editorial Team, "Birthday Problem Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/birthday-problem-calculator

BibTeX

@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?