{"id":57869,"date":"2016-01-27T11:47:36","date_gmt":"2016-01-27T09:47:36","guid":{"rendered":"http:\/\/wpcalc.com\/?p=57869"},"modified":"2026-10-01T13:30:16","modified_gmt":"2026-10-01T10:30:16","slug":"equilibrium-hardy-weinberg","status":"publish","type":"post","link":"https:\/\/wpcalc.com\/en\/medical\/equilibrium-hardy-weinberg\/","title":{"rendered":"Hardy-Weinberg Equilibrium 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\">Hardy-Weinberg Frequency and Chi-Square Test<\/h2><\/div><div class=\"calcdash-favorite group\">\n  <button type=\"button\" class=\"favorite\" id=\"favorite\" data-favorite-id=\"57869\" data-favorite-title=\"Hardy-Weinberg Equilibrium\" data-favorite-url=\"https:\/\/wpcalc.com\/en\/medical\/equilibrium-hardy-weinberg\/\" data-favorite-excerpt=\"Enter observed counts of homozygous dominant, heterozygous, and homozygous recessive individuals to calculate allele frequencies (p and q), expected genotype frequencies, and a chi-square statistic that tests whether the population is in Hardy-Weinberg equilibrium.\" aria-label=\"Add to Favorites\" data-favorite-icon=\"icon icon-flask\">\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\/medical\/equilibrium-hardy-weinberg\/\" method=\"POST\" class=\"calculator\" id=\"calculator-57869\" data-post=\"57869\"><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\">Homozygous dominant<\/label><div class=\"term\">CH<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"homozygous_dominant\" id=\"field-1\" aria-describedby=\"calc-info-1\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"0\" value=\"50\"\/><small id=\"calc-info-1\">Number of individuals with dominant homozygous genotype (AA)<\/small><\/div><div class=\"field has-term\" id=\"input-2\"><label for=\"field-2\">Heterozygous<\/label><div class=\"term\">H<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"heterozygous\" id=\"field-2\" aria-describedby=\"calc-info-2\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"0\" value=\"30\"\/><small id=\"calc-info-2\">Number of heterozygous individuals (Aa)<\/small><\/div><div class=\"field has-term\" id=\"input-3\"><label for=\"field-3\">Homozygous recessive<\/label><div class=\"term\">RH<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"text\" name=\"homozygous_recessive\" id=\"field-3\" aria-describedby=\"calc-info-3\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" min=\"0\" value=\"20\"\/><small id=\"calc-info-3\">Number of individuals with recessive homozygous genotype (aa)<\/small><\/div><\/fieldset><div class=\"buttons\"><button type=\"submit\" data-text=\"Re-Calculate\" id=\"calculate-button\" data-post=\"57869\">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> Your Results<\/h3><div class=\"result-box\"><div class=\"field-result\" id=\"output-1\"><span class=\"field-title\"><span>Allele frequency p<\/span><\/span><span class=\"field-value\" id=\"result-1\"><\/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>Allele frequency q<\/span><\/span><span class=\"field-value\" id=\"result-2\"><\/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>Expected CH (AA)<\/span><\/span><span class=\"field-value\" id=\"result-3\"><\/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>Expected H (Aa)<\/span><\/span><span class=\"field-value\" id=\"result-4\"><\/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>Expected RH (aa)<\/span><\/span><span class=\"field-value\" id=\"result-5\"><\/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-6\"><span class=\"field-title\"><span>Chi-squared (\u03c7\u00b2)<\/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><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=\"57869\" 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\">16<\/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\">6<\/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\">14<\/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\">5<\/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\">6<\/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>Hardy-Weinberg Equilibrium 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 = \\frac{CH + 0.5 \\cdot H}{CH + H + RH}, \\qquad q = \\frac{RH + 0.5 \\cdot H}{CH + H + RH} \\\\\nE_{CH} = p^2 N, \\qquad E_H = 2pqN, \\qquad E_{RH} = q^2 N \\\\\n\\chi^2 = \\frac{(CH - E_{CH})^2}{E_{CH}} + \\frac{(H - E_H)^2}{E_H} + \\frac{(RH - E_{RH})^2}{E_{RH}} \\]\n<\/div>\r\n\t<\/figure>\r\n\t<\/p>\n<p><strong>Where:<\/strong><\/p>\n<ul>\n<li>\\(CH\\) \u2014 number of homozygous dominant individuals (AA)<\/li>\n<li>\\(H\\) \u2014 number of heterozygous individuals (Aa)<\/li>\n<li>\\(RH\\) \u2014 number of homozygous recessive individuals (aa)<\/li>\n<li>\\(N\\) \u2014 total population size, \\(N = CH + H + RH\\)<\/li>\n<li>\\(p\\), \\(q\\) \u2014 frequencies of alleles A and a (\\(p + q = 1\\))<\/li>\n<li>\\(E_{CH}\\), \\(E_H\\), \\(E_{RH}\\) \u2014 expected genotype counts under equilibrium<\/li>\n<li>\\(\\chi^2\\) \u2014 chi-square statistic measuring deviation from equilibrium<\/li>\n<\/ul>\n<p>The first two equations estimate allele frequencies from genotype counts (heterozygotes contribute one copy of each allele), the middle three give the genotype counts expected under Hardy-Weinberg equilibrium, and the last quantifies how far the observed counts deviate from those expectations.<\/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>Hardy-Weinberg Equilibrium \u2013 Calculation Example<\/h2><\/div>\r\n\r\n<\/p>\n<p><strong>Example:<\/strong> a sample of 100 individuals contains 50 homozygous dominant (AA), 30 heterozygous (Aa), and 20 homozygous recessive (aa) individuals.<\/p>\n<p>\\[ p = \\frac{50 + 0.5 \\cdot 30}{100} = 0.65, \\qquad q = \\frac{20 + 0.5 \\cdot 30}{100} = 0.35 \\]<\/p>\n<p>\\[ E_{CH} = 0.65^2 \\cdot 100 = 42.25, \\quad E_H = 2(0.65)(0.35) \\cdot 100 = 45.5, \\quad E_{RH} = 0.35^2 \\cdot 100 = 12.25 \\]<\/p>\n<p>\\[ \\chi^2 = \\frac{(50 - 42.25)^2}{42.25} + \\frac{(30 - 45.5)^2}{45.5} + \\frac{(20 - 12.25)^2}{12.25} \\approx 11.61 \\]<\/p>\n<p><strong>Result:<\/strong> \\(p = 0.65\\), \\(q = 0.35\\); expected counts 42.25 AA, 45.5 Aa, 12.25 aa; \\(\\chi^2 \\approx 11.61\\). Since 11.61 exceeds the critical value of 3.84 (1 degree of freedom, \\(\\alpha = 0.05\\)), the population deviates significantly from Hardy-Weinberg equilibrium \u2014 there is a deficit of heterozygotes.<\/p>\n<p>\n\r\n<\/section>\n<h2>How to Use the Calculator<\/h2>\n<ol>\n<li>Enter the number of <strong>Homozygous dominant<\/strong> individuals (genotype AA) in the first field.<\/li>\n<li>Enter the number of <strong>Heterozygous<\/strong> individuals (genotype Aa) in the second field.<\/li>\n<li>Enter the number of <strong>Homozygous recessive<\/strong> individuals (genotype aa) in the third field.<\/li>\n<li>Read the results: allele frequencies <strong>p<\/strong> and <strong>q<\/strong>, the <strong>expected<\/strong> counts of each genotype, and the <strong>Chi-squared (\u03c7\u00b2)<\/strong> statistic.<\/li>\n<li>Compare the chi-squared value with the critical value below to judge whether the population is in equilibrium.<\/li>\n<\/ol>\n<h2>What Is Hardy-Weinberg Equilibrium?<\/h2>\n<p>The Hardy-Weinberg principle states that allele and genotype frequencies in a population remain constant from generation to generation in the absence of evolutionary forces. For a gene with two alleles, A and a, with frequencies \\(p\\) and \\(q\\) (where \\(p + q = 1\\)), the genotype frequencies after one generation of random mating are \\(p^2\\) (AA), \\(2pq\\) (Aa), and \\(q^2\\) (aa). This relationship holds only under ideal conditions: no mutation, no migration, no natural selection, infinitely large population size (no genetic drift), and random mating.<\/p>\n<p>Because real populations rarely satisfy all these conditions perfectly, Hardy-Weinberg equilibrium serves as a null model. If observed genotype counts match the expected \\(p^2 : 2pq : q^2\\) proportions, there is no evidence that evolutionary forces are acting on that locus. If they do not match, the deviation points to one or more violated assumptions \u2014 selection, non-random mating (inbreeding), genetic drift, mutation, migration, or genotyping error.<\/p>\n<p>The chi-square goodness-of-fit test quantifies the disagreement between observed and expected counts. Because allele frequencies are estimated from the same data, the test has \\(3 - 1 - 1 = 1\\) degree of freedom. At the conventional significance level of 0.05, the critical value is 3.84: a \u03c7\u00b2 below 3.84 is consistent with equilibrium, while a larger value suggests a significant deviation. The allele frequencies p and q themselves remain useful summary statistics even when the equilibrium test is rejected.<\/p>\n<p>This tool is widely used in population genetics, evolutionary biology, and classroom exercises. In genetics counseling contexts, allele frequencies also underpin carrier-risk estimation \u2014 see the <a href=\"https:\/\/wpcalc.com\/en\/medical\/inheritance-of-blood-type\/\">Blood Type Inheritance Calculator<\/a> for how genotype combinations pass from parents to offspring.<\/p>\n<h2>Interpreting the Chi-Square Result<\/h2>\n<table>\n<thead>\n<tr>\n<th>Degrees of freedom<\/th>\n<th>\u03c7\u00b2 critical value (\u03b1 = 0.05)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>3.841<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>5.991<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For this test, use 1 degree of freedom, since one allele frequency is estimated from the data. If your \u03c7\u00b2 value is below 3.841, accept the null hypothesis of equilibrium; if it is above, the deviation is statistically significant at the 5% level.<\/p>\n<h2>Assumptions and Limitations<\/h2>\n<ul>\n<li>The calculator assumes a single autosomal locus with exactly two alleles and complete dominance (AA and Aa are phenotypically distinguishable from aa, and genotypes can be counted directly, e.g. by genetic testing).<\/li>\n<li>Equilibrium requires random mating, no selection, no mutation, no migration, and a large population. A significant \u03c7\u00b2 indicates at least one of these assumptions fails \u2014 it does not tell you which.<\/li>\n<li>The chi-square approximation is unreliable when expected counts are small (as a rule of thumb, any \\(E &lt; 5\\)). Combine genotype classes or collect a larger sample in that case.<\/li>\n<li>Genotyping errors, sampling bias, and pooled subpopulations (the Wahlund effect) can all produce apparent heterozygote deficits that mimic disequilibrium.<\/li>\n<li>The test detects deviation at one locus only; conclusions about a whole population require examining multiple loci.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Enter observed counts of homozygous dominant, heterozygous, and homozygous recessive individuals to calculate allele frequencies (p and q), expected genotype frequencies, and a chi-square statistic that tests whether the population is in Hardy-Weinberg equilibrium.<\/p>\n","protected":false},"author":70,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[8],"tags":[50],"class_list":["post-57869","post","type-post","status-publish","format-standard","hentry","category-medical","tag-diagnostics"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/57869","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\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/comments?post=57869"}],"version-history":[{"count":3,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/57869\/revisions"}],"predecessor-version":[{"id":66327,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/57869\/revisions\/66327"}],"wp:attachment":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/media?parent=57869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/categories?post=57869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/tags?post=57869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}