{"id":65524,"date":"2026-09-29T14:37:14","date_gmt":"2026-09-29T11:37:14","guid":{"rendered":"https:\/\/wpcalc.com\/en\/?p=65524"},"modified":"2026-09-29T15:19:14","modified_gmt":"2026-09-29T12:19:14","slug":"hypergeometric-distribution-calculator","status":"publish","type":"post","link":"https:\/\/wpcalc.com\/en\/statistics\/hypergeometric-distribution-calculator\/","title":{"rendered":"Hypergeometric Distribution Calculator"},"content":{"rendered":"<section class=\"not-prose calculator-box\" aria-labelledby=\"calculator-title\"><div class=\"flex items-baseline sm:items-center justify-between gap-2 sm:gap-3\"><div class=\"flex flex-col sm:flex-row sm:items-center gap-2\"><span class=\"icon icon-calculator text-primary-700! text-base! dark:text-primary-300!\" aria-hidden=\"true\"><\/span><h2 id=\"calculator-title\" class=\"text-lg font-display font-bold\">Compute Hypergeometric Probabilities<\/h2><\/div><div class=\"calcdash-favorite group\">\n  <button type=\"button\" class=\"favorite\" id=\"favorite\" data-favorite-id=\"65524\" data-favorite-title=\"Hypergeometric Distribution\" data-favorite-url=\"https:\/\/wpcalc.com\/en\/statistics\/hypergeometric-distribution-calculator\/\" data-favorite-excerpt=\"Calculate exact and cumulative hypergeometric probabilities for sampling without replacement. Enter the population size, number of successes, draws, and desired successes.\" aria-label=\"Add to Favorites\" data-favorite-icon=\"icon icon-wpcalc-distribution-histogram\">\n    <span class=\"icon icon-shape-star-empty\" aria-hidden=\"true\"><\/span>\n  <\/button>\n  <div class=\"calcdash-favorite__tip\" aria-hidden=\"true\">\n   <span class=\"favorite-tooltip\" id=\"favorite-tooltip\"><\/span>\n  <\/div>\n  <span class=\"sr-only\" role=\"status\" id=\"favorite-status\"><\/span>\n<\/div><\/div><form action=\"https:\/\/wpcalc.com\/en\/statistics\/hypergeometric-distribution-calculator\/\" method=\"POST\" class=\"calculator\" id=\"calculator-65524\" data-post=\"65524\"><fieldset class=\"fieldset-input is-1\"><legend class=\"sr-only\">Input Fields<\/legend><div class=\"field has-term\" id=\"input-1\"><label for=\"field-1\">Population size<\/label><div class=\"term\">N<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"population_size\" id=\"field-1\" aria-describedby=\"calc-unit-1 calc-info-1\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"1\" value=\"52\"\/><div class=\"unit\" id=\"calc-unit-1\">items<\/div><small id=\"calc-info-1\">Total number of items in the population.<\/small><\/div><div class=\"field has-term\" id=\"input-2\"><label for=\"field-2\">Successes in population<\/label><div class=\"term\">K<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"successes_in_population\" id=\"field-2\" aria-describedby=\"calc-unit-2 calc-info-2\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"0\" value=\"13\"\/><div class=\"unit\" id=\"calc-unit-2\">items<\/div><small id=\"calc-info-2\">Number of items with the desired property in the population.<\/small><\/div><div class=\"field has-term\" id=\"input-3\"><label for=\"field-3\">Draws (sample size)<\/label><div class=\"term\">n<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"draws_sample_size\" id=\"field-3\" aria-describedby=\"calc-unit-3 calc-info-3\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"0\" value=\"5\"\/><div class=\"unit\" id=\"calc-unit-3\">draws<\/div><small id=\"calc-info-3\">Number of items drawn without replacement.<\/small><\/div><div class=\"field has-term\" id=\"input-4\"><label for=\"field-4\">Desired successes<\/label><div class=\"term\">k<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"desired_successes\" id=\"field-4\" aria-describedby=\"calc-unit-4 calc-info-4\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"0\" value=\"2\"\/><div class=\"unit\" id=\"calc-unit-4\">successes<\/div><small id=\"calc-info-4\">Number of successes you want among the draws.<\/small><\/div><\/fieldset><div class=\"buttons\"><button type=\"submit\" data-text=\"Re-Calculate\" id=\"calculate-button\" data-post=\"65524\">Calculate<\/button><button type=\"reset\">Reset<\/button><\/div><div class=\"field is-checkbox hidden!\" id=\"field-auto-calc\"><input type=\"checkbox\" id=\"auto-calc\"><label for=\"auto-calc\">Calculate automatically<\/label><small>If enabled, the result will update automatically when you change any value.<\/small><\/div><div class=\"fieldset-result is-hidden\" aria-labelledby=\"result-title\" aria-live=\"polite\" role=\"region\"> <h3 class=\"result-title bg-gradient-to-r from-primary-50 to-gray-50 dark:from-primary-900 dark:to-gray-800\" id=\"result-title\"><span class=\"icon icon-s-pulse\" aria-hidden=\"true\"><\/span> Hypergeometric Probabilities<\/h3><div class=\"result-box\"><div class=\"field-result\" id=\"output-1\"><span class=\"field-title\"><span>Exact probability P(X = k)<\/span><\/span><span class=\"field-value\" id=\"result-1\" data-unit=\"%\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-2\"><span class=\"field-title\"><span>Cumulative P(X \u2264 k)<\/span><\/span><span class=\"field-value\" id=\"result-2\" data-unit=\"%\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-3\"><span class=\"field-title\"><span>Cumulative P(X &lt; k)<\/span><\/span><span class=\"field-value\" id=\"result-3\" data-unit=\"%\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-4\"><span class=\"field-title\"><span>Cumulative P(X \u2265 k)<\/span><\/span><span class=\"field-value\" id=\"result-4\" data-unit=\"%\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-5\"><span class=\"field-title\"><span>Cumulative P(X &gt; k)<\/span><\/span><span class=\"field-value\" id=\"result-5\" data-unit=\"%\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result is-column\" id=\"output-6\"><span class=\"field-title\"><span>Mean and standard deviation<\/span><\/span><span class=\"field-value\" id=\"result-6\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result is-column\" id=\"output-7\"><span class=\"field-title\"><span>Formula with your values<\/span><\/span><span class=\"field-value\" id=\"result-7\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result is-column\" id=\"output-8\"><span class=\"field-title\"><span>Interpretation<\/span><\/span><span class=\"field-value\" id=\"result-8\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><\/div><div class=\"result-actions\"><button type=\"button\" class=\"copy-link\"><svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z\"\/><path d=\"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z\"\/><\/svg><span class=\"copy-link__text\">Copy link to this calculation<\/span><\/button><span class=\"sr-only\" role=\"status\" id=\"copy-link-status\"><\/span><\/div><\/div><a href=\"#respond\" class=\"hidden transition-opacity duration-300 opacity-0 w-50 text-sm justify-center items-center gap-2 px-4 py-2 rounded bg-gray-200 text-gray-700 hover:bg-gray-300\" id=\"leave-comment\"><span class=\"icon icon-comments\" aria-hidden=\"true\"><\/span>Leave a Comment<\/a><\/form><\/section><section id=\"calc-reactions\" class=\"not-prose hidden my-12 bg-gradient-to-r from-primary-50 to-gray-50 border border-indigo-100 rounded-xl px-6 py-4 shadow-sm\" data-post=\"65524\" aria-live=\"polite\" aria-labelledby=\"calc-reactions-title\"><p id=\"calc-reactions-title\" class=\"text-sm text-gray-500 text-center mb-2\">How did this result make you feel?<\/p><div role=\"group\" aria-labelledby=\"calc-reactions-title\" class=\"grid grid-cols-3 sm:flex sm:flex-row sm:justify-around gap-4 sm:items-center sm:flex-wrap\"><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"like\"><span class=\"reaction-count\" data-reaction-count=\"like\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude00 <\/span><span class=\"reaction-description font-medium\">Like <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"helpful\"><span class=\"reaction-count\" data-reaction-count=\"helpful\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\udca1 <\/span><span class=\"reaction-description font-medium\">Helpful <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"confused\"><span class=\"reaction-count\" data-reaction-count=\"confused\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude15 <\/span><span class=\"reaction-description font-medium\">Confused <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"disappointed\"><span class=\"reaction-count\" data-reaction-count=\"disappointed\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude1e <\/span><span class=\"reaction-description font-medium\">Disappointed <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"inaccurate\"><span class=\"reaction-count\" data-reaction-count=\"inaccurate\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\u274c <\/span><span class=\"reaction-description font-medium\">Inaccurate <\/span><\/button><\/div><div id=\"reaction-message\" class=\"hidden mt-8 rounded-md border border-primary-100 bg-white\/50 backdrop-blur-sm px-4 py-2 text-sm text-center shadow-sm\"><\/div><\/section><div class=\"calcdash-ad not-prose calcdash-ad--calc_result calcdash-ad--in-article\"><ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-1721569815777345\" data-ad-slot=\"6317458308\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\"><\/ins><script>(adsbygoogle = window.adsbygoogle || []).push({});<\/script><\/div>\n<style id=\"wpcoderpro-inline-1\">.formula-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section class=\"formula-box\" aria-labelledby=\"formula-title\">\r\n\t<div id=\"formula-title\" class=\"not-prose font-display mb-4\"><span class=\"icon icon-formula\" aria-hidden=\"true\"><\/span><h2>Hypergeometric Distribution Formula<\/h2><\/div>\r\n\t<figure class=\"not-prose formula\">\r\n\t\t<figcaption class=\"formula-title\">Formula<\/figcaption>\r\n\t\t<div class=\"text-base text-gray-800\" id=\"formula\">\n\\[ P(X = k) = \\frac{\\binom{K}{k}\\binom{N-K}{n-k}}{\\binom{N}{n}} \\]\n<\/div>\r\n\t<\/figure>\r\n\t<\/p>\n<p><strong>Where:<\/strong><\/p>\n<ul>\n<li>\\(N\\) \u2014 population size (total number of items)<\/li>\n<li>\\(K\\) \u2014 number of successes in the population (items with the desired property)<\/li>\n<li>\\(n\\) \u2014 number of draws (sample size, drawn without replacement)<\/li>\n<li>\\(k\\) \u2014 desired number of successes in the sample<\/li>\n<\/ul>\n<p>The formula gives the probability of finding exactly \\(k\\) successes in a sample of \\(n\\) items drawn without replacement from a finite population of \\(N\\) items containing \\(K\\) successes. The mean and standard deviation are \\(E(X) = nK\/N\\) and \\(SD(X) = \\sqrt{n \\cdot \\frac{K}{N} \\cdot \\left(1 - \\frac{K}{N}\\right) \\cdot \\frac{N-n}{N-1}}\\).<\/p>\n<p>\r\n<\/section>\n<style id=\"wpcoderpro-inline-459\">.calculation-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section id=\"calculation\" class=\"calculation-box\" aria-labelledby=\"calculation-title\">\r\n\t<div id=\"calculation-title\" class=\"not-prose font-display\"><span class=\"icon icon-unordered-list\" aria-hidden=\"true\"><\/span><h2>Hypergeometric Distribution \u2013 Calculation Example<\/h2><\/div>\r\n\r\n<\/p>\n<p><strong>Example:<\/strong> a standard deck has 52 cards, 13 of which are hearts. You draw 5 cards and want the probability of getting exactly 2 hearts. So \\(N = 52\\), \\(K = 13\\), \\(n = 5\\), \\(k = 2\\).<\/p>\n<p>\\[ P(X = 2) = \\frac{\\binom{13}{2}\\binom{39}{3}}{\\binom{52}{5}} = \\frac{78 \\times 9139}{2598960} = \\frac{712842}{2598960} \\approx 0.2743 \\]<\/p>\n<p><strong>Result:<\/strong> \\(P(X = 2) \\approx 0.2743\\), or about 27.43% (roughly 1 in 4). The cumulative probability \\(P(X \\le 2)\\) is about 90.72%, the mean is \\(E(X) = 1.25\\) hearts, and the standard deviation is about 0.93.<\/p>\n<p>\n\r\n<\/section>\n<h2>How to Use the Calculator<\/h2>\n<ol>\n<li>Enter the <strong>Population size<\/strong> \\(N\\) \u2014 the total number of items you are drawing from.<\/li>\n<li>Enter the <strong>Successes in population<\/strong> \\(K\\) \u2014 how many of those items have the property you care about.<\/li>\n<li>Enter the <strong>Draws (sample size)<\/strong> \\(n\\) \u2014 how many items you draw without replacement.<\/li>\n<li>Enter the <strong>Desired successes<\/strong> \\(k\\) \u2014 the number of successes you want in your sample.<\/li>\n<li>Read the results: the exact probability \\(P(X = k)\\), the cumulative probabilities \\(P(X \\le k)\\), \\(P(X  k)\\) (all in percent), plus the mean, standard deviation, the formula with your values substituted, and a plain-language interpretation.<\/li>\n<\/ol>\n<h2>What Is the Hypergeometric Distribution?<\/h2>\n<p>The hypergeometric distribution describes the number of successes you get when drawing a fixed number of items <em>without replacement<\/em> from a finite population. It is the correct model whenever each draw changes the composition of what remains \u2014 dealing cards from a deck, picking parts from a batch for quality inspection, selecting people for a survey from a small group, or drawing lottery numbers.<\/p>\n<p>Its closest relative is the binomial distribution, which applies when items are drawn <em>with<\/em> replacement (or from an effectively infinite population), so every trial has the same probability of success. With the hypergeometric distribution, each success you remove lowers the success rate for the remaining draws, which is exactly what happens with a real deck of cards or a finite batch of products. If the sample is small compared to the population (say, under 5\u201310%), the two distributions give nearly identical answers.<\/p>\n<p>The calculator reports the probability of every outcome at once, which is often more useful than the exact value alone. For example, a quality inspector may need \\(P(X \\ge k)\\) \u2014 the chance of finding <em>at least<\/em> a certain number of defective items \u2014 while a card player may want \\(P(X \\le k)\\), the chance of drawing <em>at most<\/em> a few key cards. The mean \\(E(X) = nK\/N\\) tells you the expected number of successes in an average sample; it is simply the sample size times the population success rate.<\/p>\n<p>The shape of the distribution depends on the parameters: it can be symmetric, skewed toward few successes, or skewed toward many. The possible values of \\(X\\) are also bounded \u2014 you cannot draw more successes than exist in the population or more items than you draw, so the number of successes is limited to the range \\([\\max(0, n-(N-K)), \\; \\min(n, K)]\\). The calculator automatically returns a probability of zero if your \\(k\\) falls outside this range.<\/p>\n<h2>Assumptions, Limitations and Tips<\/h2>\n<ul>\n<li><strong>Sampling without replacement:<\/strong> the model assumes drawn items are not returned to the population. If items are replaced after each draw, use the <a href=\"https:\/\/wpcalc.com\/en\/statistics\/binomial-distribution-calculator\/\">Binomial Distribution Calculator<\/a> instead.<\/li>\n<li><strong>Fixed sample size:<\/strong> the number of draws \\(n\\) must be decided in advance and stay fixed. If you count events occurring randomly over a fixed interval of time or space, the <a href=\"https:\/\/wpcalc.com\/en\/statistics\/poisson-distribution-calculator\/\">Poisson Distribution Calculator<\/a> is the better tool.<\/li>\n<li><strong>Equally likely samples:<\/strong> every possible subset of \\(n\\) items must have the same chance of being drawn. If some items are more likely to be selected, the hypergeometric model does not apply.<\/li>\n<li><strong>Whole numbers only:<\/strong> \\(N\\), \\(K\\), \\(n\\) and \\(k\\) must be integers, with \\(1 \\le N \\le 1{,}000{,}000\\), \\(0 \\le K \\le N\\), \\(0 \\le n \\le N\\), and \\(0 \\le k \\le n\\).<\/li>\n<li><strong>Large populations:<\/strong> when \\(n\\) is small relative to \\(N\\), the hypergeometric distribution is well approximated by the binomial (or, for large counts, by the <a href=\"https:\/\/wpcalc.com\/en\/statistics\/normal-distribution-calculator\/\">normal distribution<\/a>), but this calculator gives the exact result with no approximation needed.<\/li>\n<li><strong>Check the binomial coefficients:<\/strong> the substituted formula uses \\(\\binom{a}{b}\\) notation. You can verify these values with the <a href=\"https:\/\/wpcalc.com\/en\/statistics\/permutation-and-combination-calculator\/\">Permutations &amp; Combinations Calculator<\/a>.<\/li>\n<li><strong>Interpreting zero probability:<\/strong> a result of 0% usually means your \\(k\\) is impossible \u2014 for instance, asking for 3 successes when the population contains only 2 success items.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Calculate exact and cumulative hypergeometric probabilities for sampling without replacement. Enter the population size, number of successes, draws, and desired successes.<\/p>\n","protected":false},"author":3168,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[74],"tags":[77],"class_list":["post-65524","post","type-post","status-publish","format-standard","hentry","category-statistics","tag-distributions"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/65524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/users\/3168"}],"replies":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/comments?post=65524"}],"version-history":[{"count":3,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/65524\/revisions"}],"predecessor-version":[{"id":65695,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/65524\/revisions\/65695"}],"wp:attachment":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/media?parent=65524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/categories?post=65524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/tags?post=65524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}