Hourwiz Explains · video notes

The Birthday Paradox: Why 23 People Is Enough

From the Hourwiz video “Birthday paradox!” · Checked Oct 18, 2026

Watch on YouTube (opens in a new tab)Instagram (opens in a new tab)Facebook (opens in a new tab)

The short answer: 23 people is all it takes. In a room of 23, the chance that at least two of them share a birthday is 50.73%, a bit better than a coin flip (our math, assuming 365 equally likely days). 23 is the smallest group that gets above 50%.

The answer: 23 people

Our math. Exact arithmetic with the standard birthday-problem formula (below), checked by our script. Wolfram MathWorld gives the same answer for 23 people: about 0.507297, and n = 23 is the smallest group with better-than-even odds.

Our math: the chance that at least two people in a group share a birthday
People in the roomChance of a shared birthday
2247.57%
2350.73%: the smallest group above 50%
4594.10%
7099.92%

A shared birthday means the same month and day. The year doesn't matter.

Why it feels wrong

Our take: your gut counts 22 checks. The room has 253 pairs.

What about your birthday?

A real room: 45 presidents

Our take: it's not spooky. Under the model, a shared birthday among 45 people was a 94% bet.

Our test: a million rooms

Our test. We didn't just trust the formula. Our script (no outside libraries, run with Node v24.21.0 on Oct 17, 2026) built 1,000,000 random rooms for each case below. Each person gets a random day out of 365, then the script checks the room for a match. It uses a fixed seed (20261017), so a rerun gives the same numbers.

Our test: simulated rooms vs the exact math
What we simulatedRooms with a matchSimulatedExact math
Rooms of 23: any shared birthday507,558 of 1,000,00050.76%50.73%
Rooms of 45: any shared birthday940,829 of 1,000,00094.08%94.10%
You + 253 others: someone shares your birthday500,944 of 1,000,00050.09%50.05%

Each simulated result is within a few hundredths of a point of the exact value. The script checks this too: every result lands well inside normal random variation (less than 3 standard errors from the exact value).

The formula

The chance that at least two of n people share a birthday (Wolfram MathWorld):

P(shared) = 1 − 365! / ((365 − n)! · 365^n)

The core of our script

// P(at least two of n share a birthday) = 1 - prod_{k=0}^{n-1} (365-k)/365
function pAny(n) {
  if (n > DAYS) return 1;
  let none = 1;
  for (let k = 0; k < n; k++) none *= (DAYS - k) / DAYS;
  return 1 - none;
}
// P(at least one of n OTHER people shares YOUR birthday) = 1 - (364/365)^n
function pYours(n) {
  return 1 - Math.pow((DAYS - 1) / DAYS, n);
}

An excerpt from our script, unchanged. The full file is in the download below.

What the math assumes

Download our math

The script prints a few extra lines we don't use on this page. The presidents' birth dates in it are copied from each president's Miller Center page.

Images in the video

Photos are shown unedited (cropped and resized only). Everything else in the video is drawn in code by Hourwiz.

Sources

Every fact on this page comes from these pages, opened on Oct 18, 2026. Things change: check the live page before you rely on it.

  1. Wolfram MathWorld, Birthday Problem The formula (eq. 5); about 0.507297 for 23 people; n = 23; 365-day years, leap days ignored, uniform birthdays.
  2. Harvey Mudd College, Math Fun Facts (Francis Su) You need “only 23 people to have at least a 50 percent chance of a match.”
  3. Miller Center, University of Virginia: the presidents 47 numbered presidencies, 45 people; Polk the 11th, Harding the 29th. We read the birth date on all 45 presidents' pages.
  4. Miller Center, James K. Polk Birth date: November 2, 1795.
  5. Miller Center, Warren G. Harding Birth date: November 2, 1865.
  6. National Park Service, on presidential births and deaths (Alan Gephardt, James A. Garfield National Historic Site) “Two presidents share a birthday”: Polk and Harding, Nov. 2.
  7. The White House, Donald J. Trump “45th & 47th President of the United States”.

Our numbers are exact arithmetic under the assumptions above, rounded as shown, plus one seeded simulation. Hourwiz is not affiliated with Wolfram MathWorld, Harvey Mudd College, the Miller Center, the National Park Service, the National Archives or the Library of Congress, and none of them made, reviewed or endorsed this page or the video.

No sponsor and no affiliate links on this page. Vendors are named so you can check them yourself, not as recommendations.

Follow Hourwiz

Get the week’s videos in one email

All video pages Back to Hourwiz home