Math calculators

Hypergeometric Calculator

Updated Jun 18, 2026 By Jehan Wadia

Calculation Mode

Example Presets

Parameters

Total number of items in the population.
How many population items are “successes”.
How many items are drawn (slider capped at N).
Target successes (slider capped at n).

Problem Summary

Results

P(X = k)
Decimal
Percentage
Fraction

All Probability Variants

Probability Decimal Percentage Fraction

Formula

Show step-by-step solution

Distribution Properties

Mean (μ = n·K/N)
Variance (σ², with FPC)
Standard Deviation (σ)
Mode(s)
P(X = ⌊μ⌋)
Variance and standard deviation include the Finite Population Correction (FPC) factor (N−n)/(N−1), improving accuracy for small populations.

Probability Distribution Table

X (Successes) P(X = x) Cumulative P(X ≤ x)

Probability Mass Function (PMF)

P(X = x) Selected value(s)  ·  Mean (μ)

Cumulative Distribution Function (CDF)

P(X ≤ x)  ·  Median reference (0.5)

Statistical Insight


Introduction

A hypergeometric distribution tells you the chance of getting a certain number of successes when you draw items from a group without putting them back. For example, if you pull 7 cards from a deck of 52, what is the chance that exactly 4 of them are red? That is a hypergeometric probability problem.

This hypergeometric calculator solves problems like that for you. Enter four numbers: the total population size (N), how many items count as successes (K), how many items you draw (n), and the number of successes you want to find the probability for (k). The calculator does the rest. It gives you the exact probability as a decimal, a percentage, and a fraction. It also shows a step-by-step solution, a full probability distribution table, and charts of the probability mass function (PMF) and cumulative distribution function (CDF).

You can choose from four calculation modes. Exact finds P(X = k), the chance of getting exactly k successes. Cumulative finds P(X ≤ k), the chance of getting k or fewer. At Least finds P(X ≥ k), the chance of getting k or more. Range finds the chance that the number of successes falls between two values you pick. Use the preset buttons to load common examples and see how it works right away.

How to Use Our Hypergeometric Calculator

Enter a few numbers about your population and sample below. The calculator will give you the exact probability of getting a certain number of successes when you draw items without replacement. You will also get charts, a step-by-step solution, and a full distribution table.

Calculation Mode: Pick the type of probability you want to find. Choose Exact for the chance of getting exactly k successes, Cumulative for k or fewer, At Least for k or more, or Range to set a lower and upper bound.

Population Size (N): Enter the total number of items in the whole group you are drawing from. For example, a standard deck of cards has 52.

Success States (K): Enter how many items in the population count as a success. This must be a whole number from 0 up to N.

Draws / Sample Size (n): Enter how many items you draw from the population. You can also use the slider to adjust this value. It cannot be more than N. If you need help figuring out how many items to draw for a study, a sample size calculator can help you decide.

Observed Successes (k): Enter the number of successes you want to find the probability for. This value cannot be more than n. If you chose Range mode, enter a Minimum (x₁) and a Maximum (x₂) instead.

Press the Calculate button to see your results. Press Reset to clear everything and start over. You can also click any Example Preset to load a common scenario instantly.

What Is the Hypergeometric Distribution?

The hypergeometric distribution tells you the probability of getting a certain number of successes when you draw items from a group without putting them back. This is different from flipping a coin or rolling dice, where the odds stay the same each time. When you draw without replacement, each draw changes the odds of the next one.

A Simple Example

Imagine a bag with 52 marbles — 26 are red and 26 are blue. You reach in and pull out 7 marbles without looking. What are the chances that exactly 4 of them are red? That is the kind of question the hypergeometric distribution answers.

The Four Numbers You Need

Every hypergeometric problem uses four values:

  • N (Population Size) — The total number of items in the whole group.
  • K (Success States) — How many items in the group count as a "success."
  • n (Draws) — How many items you pull out.
  • k (Observed Successes) — The number of successes you want to find the probability for.

When Is This Used?

The hypergeometric distribution shows up any time you pick a sample from a fixed group and do not replace what you pick. Common uses include:

  • Card games — Finding the odds of drawing a certain hand from a deck. Tools like a poker odds calculator or a blackjack calculator rely on this same sampling-without-replacement logic.
  • Quality control — Checking a batch of products for defects by testing a small sample.
  • Ecology — Estimating animal populations using capture-recapture methods.
  • Lottery and raffles — Calculating your chances of picking winning tickets. You can also explore general dice probability problems for other games of chance.

How It Differs from the Binomial Distribution

The binomial distribution assumes each trial has the same probability of success. That works when you replace items or when the population is very large. The hypergeometric distribution does not make that assumption. It accounts for the fact that each draw shrinks the pool, so the probability shifts slightly every time. This makes it more accurate for small populations or sampling without replacement. For very large populations, the hypergeometric distribution approaches the binomial, and both can be approximated by the normal distribution.

The Formula

The probability of getting exactly k successes is calculated as:

P(X = k) = C(K, k) × C(N − K, n − k) / C(N, n)

Here, C(a, b) means "a choose b" — the number of ways to pick b items from a items, also known as a combination. Each combination is computed using factorials, where C(a, b) = a! / (b! × (a − b)!). The numerator counts every favorable outcome, and the denominator counts every possible outcome. Dividing one by the other gives you the exact probability. The result section of this calculator displays the answer as a decimal, a percentage, and a fraction so you can use whichever format you prefer.


Frequently asked questions

What does without replacement mean?

Without replacement means that once you draw an item from the group, you do not put it back before drawing the next one. Each draw shrinks the pool by one. This is what makes the hypergeometric distribution different from the binomial distribution, where the odds stay the same on every trial.

What is the difference between N, K, n, and k?

N is the total number of items in the whole group. K is how many of those items count as successes. n is how many items you draw. k is the specific number of successes you want to find the probability for. All four must be whole numbers, and K cannot be larger than N, and k cannot be larger than n.

What do the four calculation modes do?

Exact gives the chance of getting exactly k successes. Cumulative gives the chance of getting k or fewer successes. At Least gives the chance of getting k or more successes. Range lets you set a lower and upper bound and gives the chance the number of successes falls between them.

Can I enter decimals or negative numbers?

No. All inputs must be whole numbers that are zero or greater. N and n must be at least 1. The calculator will show an error if you enter decimals, negative numbers, or leave a field blank.

What is the PMF chart?

PMF stands for Probability Mass Function. The PMF chart is a bar graph that shows the probability of each possible number of successes. Taller bars mean higher probability. The orange bar marks your selected value, and the dashed red line shows the mean.

What is the CDF chart?

CDF stands for Cumulative Distribution Function. The CDF chart is a step line that shows the running total of probabilities. At any point X on the chart, the height tells you the probability of getting X or fewer successes. It always starts near 0 and ends at 1.

What does the Finite Population Correction factor mean?

The Finite Population Correction (FPC) adjusts the variance and standard deviation to account for the fact that you are sampling from a limited group. The factor is (N − n) / (N − 1). When your sample is a large share of the population, this correction matters more. It makes the results more accurate for small populations.

Why is my probability showing as zero?

A probability of zero means the outcome you asked for is impossible. This usually happens when k is larger than K (you want more successes than exist) or when k is larger than n (you want more successes than items drawn). It can also happen when n − k is larger than N − K, meaning there are not enough non-success items to fill the remaining draws.

What do the mean, variance, and standard deviation tell me?

The mean is the average number of successes you would expect over many repeated draws. The variance measures how spread out the results are around that average. The standard deviation is the square root of the variance and gives the spread in the same units as the data. A small standard deviation means results tend to cluster near the mean.

What is the mode in the distribution properties?

The mode is the number of successes that has the highest probability. It is the peak of the PMF chart. Sometimes two neighboring values share the highest probability, so there can be more than one mode.

How accurate are the results for very large numbers?

The calculator uses logarithmic math and BigInt arithmetic to handle large populations accurately. For extremely large values, exact fractions may be shown as approximations, but the decimal and percentage results remain precise to at least six significant figures.

What does the fraction output represent?

The fraction shows the probability as an exact ratio of favorable outcomes to total outcomes. For example, if there are 100 favorable outcomes out of 1,000 total, the fraction is 100 / 1,000, which simplifies to 1 / 10. When the numbers are very large, the calculator shows an approximate fraction instead.

Can this calculator handle a full 52-card deck problem?

Yes. The calculator works well with standard card deck problems. Set N to 52, set K to the number of cards that count as a success (such as 13 for all hearts), set n to the number of cards you draw, and set k to the number of successes you want. Click Calculate to see the result.

What is the highlighted row in the distribution table?

The highlighted row in yellow marks the value or values you selected. In Exact mode it highlights k. In Range mode it highlights every value from x₁ to x₂. This makes it easy to find your chosen outcome in the full table.

Why does the distribution table sometimes not appear?

When the number of possible outcomes is very large (more than 2,000 rows), the calculator skips the row-by-row table to keep the page fast. You can still see the full distribution shape in the PMF and CDF charts.

How do I use the preset examples?

Click any preset button at the top of the calculator. It fills in all the input fields with values from a common scenario, such as drawing cards or checking products for defects. The calculator runs automatically so you can see the results right away. You can then change any value to fit your own problem.

Can I use this for quality control inspection?

Yes. Set N to the total number of items in the batch, K to the number of defective items you suspect, n to how many items you inspect, and k to the number of defects you want to evaluate. The calculator will tell you the probability of finding that many defects in your sample.

What is the step-by-step solution section?

The step-by-step section breaks the calculation into clear stages. It shows each combination value, how the numerator and denominator are built, and how they are divided to get the final probability. Click Show step-by-step solution to expand it.