Hypergeometric Distribution Calculator

Find exact hypergeometric probabilities P(X = k) and P(X <= k) for sampling without replacement.
Inputs: population size, success count, draws, and target k.

Hypergeometric Distribution

The hypergeometric distribution answers a specific question: you have a population of N items, K of which are tagged as successes. You draw n items without replacement (no putting back). What is the probability that exactly k of your draws are successes?

The formula is P(X = k) = C(K, k) * C(N-K, n-k) / C(N, n), where C(a, b) is the binomial coefficient “a choose b.” The numerator counts the ways to choose k successes from the K available and n-k failures from the N-K available. The denominator counts all possible samples of size n from the full population.

Without replacement is the critical assumption. If you sample with replacement, each draw is independent and the binomial distribution applies instead. The hypergeometric accounts for the fact that drawing one success makes the next draw slightly less likely to be a success.

Classic applications include quality control (defective items in a batch), card games (drawing specific cards from a shuffled deck), clinical trials (patients with a characteristic in a cohort), and ecology (tagged animals in a capture-recapture study).

For a deck-of-cards example: N = 52, K = 13 (clubs), n = 5 (hand size). The hypergeometric gives the exact probability of getting k clubs in a five-card hand.

The mean of the distribution is nK/N, which makes intuitive sense: if K/N of the population are successes, you expect that fraction of your sample to be successes too. The variance is n(K/N)(1-K/N)(N-n)/(N-1). The extra factor (N-n)/(N-1) is the finite population correction, which shrinks below 1 and reduces variance compared to the binomial.

The chart shows the full probability mass function from k = 0 to k = min(K, n), so you can see which outcomes are plausible given your setup.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.