Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

Hypergeometric Distribution Calculator

Compute hypergeometric probabilities without replacement. Enter population size, successes, sample size, and k to get exact or tail probabilities.

Enter the Details






Result will appear here...


Last updated: March 23, 2026

Created by: Eon Tools Dev Team

Reviewed by: Ankit Khatiwada



What the hypergeometric distribution calculator does

The hypergeometric distribution describes the number of successes when you draw a sample from a finite group without putting items back. This calculator works out those probabilities from the size of the group, how many successes it contains, the size of your sample, and the number of successes you are asking about, along with the mean and variance.

It fits any draw from a fixed pool, like defective parts in a batch or aces in a hand of cards. Below is how it works and how it differs from its close cousin, the binomial.

How to use it

  1. Enter the population size and the number of successes it contains.
  2. Enter the sample size and the number of successes in the sample you are asking about.
  3. Choose what to compute, an exact or a cumulative probability, then press Calculate or Reset.

Sampling without replacement

The defining feature of the hypergeometric distribution is that items are not replaced once drawn. Each time you take one, the pool shrinks and its make-up changes, so the odds shift with every draw. Pull an ace from a deck and there are fewer aces, and fewer cards, left for the next draw.

This is the natural model for the many real situations where you cannot draw the same item twice: inspecting a batch, dealing cards, choosing a committee, running a lottery. Because each draw changes what remains, the trials are not independent, which is exactly the condition that rules out the simpler binomial.

How the probability is worked out

The probability is built from combinations, counting the ways to get your result and dividing by the ways to draw any sample at all:

P(X = k) = C(K, k) × C(N minus K, n minus k) ÷ C(N, n)

Reading it in pieces: C(K, k) counts the ways to choose your k successes from the successes available, C(N minus K, n minus k) counts the ways to fill the rest of the sample from the failures, and C(N, n) on the bottom counts every possible sample of that size. The successes times the failures, over the total, gives the chance of exactly that many successes.

Hypergeometric versus binomial

The two distributions answer the same kind of question, the number of successes in a sample, but under different rules. The binomial draws with replacement, or from a pool so large that removing a few makes no difference, so the odds stay constant. The hypergeometric draws without replacement from a finite pool, so the odds change as you go.

The practical guide is the size of the pool relative to the sample. When the population is huge next to the sample, the two give almost identical answers, and the binomial is a fine, simpler approximation. When the sample is a real fraction of the population, the without-replacement effect matters, and the hypergeometric is the honest choice. This is the same finite-population effect that shrinks a margin of error when you survey much of a small group.

The mean and variance

The mean is pleasingly simple: the sample size times the proportion of successes in the population. If a tenth of the pool are successes and you draw 20, you expect 2, exactly what intuition suggests. The calculator reports this alongside the probability.

The variance carries an extra piece the binomial does not have, a finite population correction that shrinks it because sampling without replacement is a little more predictable than sampling with it. Once you have removed some items, there is slightly less room for surprise in what remains, and the variance reflects that.

A worked example

Suppose a batch of 20 parts contains 5 defective ones, and you inspect a sample of 4. What is the chance of finding exactly 1 defective? Here the population is 20, the successes are the 5 defectives, the sample is 4, and k is 1.

The probability works out to about 47 percent, from the ways to pick 1 defective and 3 good parts, over all the ways to pick 4 from 20. The mean number of defectives in such a sample is the sample size times the defective rate, 4 times 5 over 20 = 1, so finding exactly one is both the average and the most likely outcome.

Entering your values

Enter whole numbers throughout. The sample cannot be larger than the population, the successes in the sample cannot exceed either the sample size or the successes in the population, and the successes in the population cannot exceed its size. The calculator returns your chosen probability along with the mean and variance of the distribution.

Questions people ask

What is the hypergeometric distribution?

The distribution of the number of successes in a sample drawn without replacement from a finite population. The odds change with each draw as the pool shrinks.

How is it different from the binomial?

The binomial draws with replacement, keeping the odds constant. The hypergeometric draws without replacement, so the odds shift. For a huge population the two nearly agree.

When should I use it?

When you draw a sample from a fixed pool and cannot draw the same item twice, like inspecting a batch, dealing cards, or picking a committee.

What is the mean?

The sample size times the proportion of successes in the population. Draw 20 from a pool that is one tenth successes and you expect 2.

References

A quick note on where the methods here come from. The hypergeometric distribution is set out in the NIST/SEMATECH e-Handbook of Statistical Methods, the US government's public statistics reference. OpenStax Introductory Statistics is a free, widely used textbook covering the hypergeometric distribution.

  1. NIST/SEMATECH e-Handbook of Statistical Methods (the hypergeometric distribution). https://www.itl.nist.gov/div898/handbook/
  2. OpenStax, Introductory Statistics (the hypergeometric distribution). https://openstax.org/details/books/introductory-statistics-2e


Ankit Khatiwada

Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.