Hardy-Weinberg Equilibrium Calculator
Test cases replayed : 2 of 2 match · Methodology · No outside source listed
Enter observed genotype counts to compare them with Hardy-Weinberg expectations.
Result
Chi-square (1 degree of freedom)
Individuals (N)
- Frequency of A (p)
- Frequency of a (q)
- Expected AA (p² × N)
- Expected Aa (2pq × N)
- Expected aa (q² × N)
- Result at the 5% level
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Number of AA individuals (homozygous dominant): enter 0 or more.
- Number of Aa individuals (heterozygous): enter 0 or more.
- Number of aa individuals (homozygous recessive): enter 0 or more.
- Read the result: Chi-square (1 degree of freedom); the panel also shows Individuals (N), Frequency of A (p), Frequency of a (q), Expected AA (p² × N), Expected Aa (2pq × N), Expected aa (q² × N) and Result at the 5% level.
How this calculator works
Allele frequencies come from gene counting: p = (2 × AA + Aa) ÷ 2N and q = 1 − p. Under Hardy-Weinberg equilibrium (random mating, no selection, migration or mutation, large population), genotype frequencies are p², 2pq and q², which add up to 1.
Chi-square = Σ (observed − expected)² ÷ expected over the three genotypes. With two alleles the test has 1 degree of freedom (3 classes − 1 − 1 estimated frequency); the 5% critical value is 3.841. Expected counts below 5 make the test unreliable.
The formula
| Symbol | Meaning |
|---|---|
| Number of AA individuals (homozygous dominant) | |
| Number of Aa individuals (heterozygous) | |
| Number of aa individuals (homozygous recessive) | |
| Individuals (N) | |
| Frequency of A (p) | |
| Frequency of a (q) | |
| Expected AA (p² × N) | |
| Expected Aa (2pq × N) | |
| Expected aa (q² × N) | |
| Chi-square (1 degree of freedom) |
Worked example
| Number of AA individuals (homozygous dominant) | 36 |
|---|---|
| Number of Aa individuals (heterozygous) | 48 |
| Number of aa individuals (homozygous recessive) | 16 |
| Individuals (N) | 100 |
|---|---|
| Frequency of A (p) | 0.6 |
| Frequency of a (q) | 0.4 |
| Expected AA (p² × N) | 36.00 |
| Expected Aa (2pq × N) | 48.00 |
| Expected aa (q² × N) | 16.00 |
| Result at the 5% level | Consistent with Hardy-Weinberg equilibrium (chi-square below 3.841) |
Chi-square (1 degree of freedom) 0.00
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What are the Hardy-Weinberg equations?
p + q = 1 for alleles and p² + 2pq + q² = 1 for genotypes.
Are 36 AA, 48 Aa and 16 aa in equilibrium?
Yes, exactly: p = 0.6, so the expected counts are 36, 48 and 16 and chi-square is 0.