Birthday paradox (collision probability) calculator

Exact birthday paradox collision probability, target→n, and Monte Carlo simulation (fixed seed) — runs locally in your browser.

Compute the probability of at least one collision when drawing n samples from d equally likely values (days or 2^b hash space).

Runs locally in your browser (no server upload). Shareable URLs reproduce the same state.

Other languages: ja | en | es

How to use (3 steps)

  1. Select Days (d=365/366) or Bits (d=2^b).
  2. Enter n (or switch to “Target → n”).
  3. Copy a shareable URL or run a simulation.

Inputs

Mode
What to compute
Example:
Presets:

Results

P(collision)
P(no collision)
Approx (Poisson)
Approx error (abs / rel)
/
Target → required n
Required n (exact)
Required n (approx)

Graph

P(collision) vs n (blue). Orange line marks your current n.

Tip: hover (or tap) the graph to see the probability at a specific n. The quick table below provides accessible values.

Quick table

nP(collision)p (0..1)
Simulation (Monte Carlo)

Estimated P(collision)
95% CI (Wilson)
|p̂ − p_exact|

Notes & formulas

Examples

Classic: d=365, n=23

P(collision) is about 0.5073 (≈ 50.7%).

Hash collisions: 32-bit

Use bits mode with b=32 (d=2^32). Target 0.5 gives n≈77,164.

FAQ

What is the birthday paradox?

It is the collision probability when drawing n samples from d equally likely values. With d=365, n=23 already gives about 50%.

Why does it exceed 50% with only 23 people?

The number of possible pairs grows as C(n,2), so collisions become likely quickly.

What is the exact formula?

P(no collision) = (d)_n / d^n, and P(collision) = 1 − P(no collision).

How do you compute the required n for a target probability?

We search the smallest integer n such that P(collision) ≥ target.

How does this relate to hash collisions (32-bit / 64-bit)?

Use bits mode (d=2^b). For 32-bit, the 50% point is about n≈77,164.

What is the seed in the simulation?

A seed makes the simulation deterministic and reproducible.

Are real birthdays uniform?

Not perfectly. This tool uses the standard uniform model.

Related calculators