Hardy-Weinberg Calculator
Find allele and genotype frequencies, carrier rates and expected counts, or test whether a population is in Hardy-Weinberg equilibrium with a chi-square test.
The Hardy-Weinberg equations are p + q = 1 and p² + 2pq + q² = 1. If 16% of a population shows a recessive trait, q² = 0.16, so q = 0.4 and p = 0.6. Then AA = 0.36, Aa = 0.48 (carriers) and aa = 0.16.
- p and q are allele frequencies; p², 2pq and q² are genotype frequencies.
- Start from the recessive phenotype: it always equals q².
- A chi-square value below 3.841 (1 degree of freedom) means the population fits equilibrium.
How to Use the Hardy-Weinberg Calculator
- Recessive trait %: enter the share of the population showing the recessive phenotype. This is the most common textbook problem.
- Allele frequency: enter p or q to get the other allele and all three genotype frequencies.
- Genotype counts: enter observed AA, Aa and aa numbers to get allele frequencies, expected counts and a chi-square test.
The Hardy-Weinberg Formulas
p² + 2pq + q² = 1
| Symbol | Meaning |
|---|---|
| p | Frequency of the dominant allele (A) |
| q | Frequency of the recessive allele (a) |
| p² | Frequency of homozygous dominant (AA) |
| 2pq | Frequency of heterozygotes, or carriers (Aa) |
| q² | Frequency of homozygous recessive (aa) |
The equations hold when a population is not evolving: no mutation, no migration, no natural selection, random mating and a very large population.
Worked Examples
Example 1: From a recessive trait. 16% of a population has a recessive trait.
- q² = 0.16, so q = √0.16 = 0.4
- p = 1 − 0.4 = 0.6
- AA = 0.6² = 0.36; Aa = 2 × 0.6 × 0.4 = 0.48; aa = 0.16
- So 48% of the population are carriers.
Example 2: From genotype counts. A sample has 490 AA, 420 Aa and 90 aa (1,000 people).
- p = (2 × 490 + 420) ÷ 2,000 = 0.7; q = 0.3
- Expected: AA = 0.49 × 1,000 = 490; Aa = 0.42 × 1,000 = 420; aa = 0.09 × 1,000 = 90
- χ² = 0, well below 3.841, so the population is in equilibrium.
Common Recessive Frequencies
| Recessive trait (q²) | q | p | Carriers (2pq) |
|---|---|---|---|
| 1% | 0.10 | 0.90 | 18.0% |
| 4% | 0.20 | 0.80 | 32.0% |
| 9% | 0.30 | 0.70 | 42.0% |
| 16% | 0.40 | 0.60 | 48.0% |
| 25% | 0.50 | 0.50 | 50.0% |
| 36% | 0.60 | 0.40 | 48.0% |
To see a single cross instead of a whole population, use the Punnett square calculator. To turn any count into a percentage, try the percentage calculator.
Tips for Hardy-Weinberg Problems
- Always start with q². The recessive phenotype is the only genotype you can count directly.
- Don’t use the dominant phenotype as p². It includes both AA and Aa.
- Check your work: p² + 2pq + q² should add up to 1.
- Comparing a lab result with the expected value? The percent error calculator shows how far off it is.
Frequently Asked Questions
What is the Hardy-Weinberg equation?
It is p² + 2pq + q² = 1, together with p + q = 1. p and q are the frequencies of the two alleles, and p², 2pq and q² are the frequencies of the AA, Aa and aa genotypes.
How do you find q in Hardy-Weinberg?
Take the frequency of the recessive phenotype (q²) and find its square root. If 9% of a population shows the recessive trait, q = √0.09 = 0.3.
How do you calculate carriers?
Carriers are heterozygotes, so their frequency is 2pq. With p = 0.6 and q = 0.4, 2pq = 0.48, meaning 48% of the population are carriers.
What are the 5 conditions of Hardy-Weinberg equilibrium?
No mutation, no migration (gene flow), no natural selection, random mating and a very large population (no genetic drift).
How do you test for Hardy-Weinberg equilibrium?
Calculate expected genotype counts from p and q, then do a chi-square test with 1 degree of freedom. If χ² is below 3.841, the population fits equilibrium at the 5% significance level.
Why is there only 1 degree of freedom?
There are 3 genotype classes, minus 1 for the total and minus 1 because the allele frequency p is estimated from the data, which leaves 1 degree of freedom.
Can p² be the dominant phenotype frequency?
No. The dominant phenotype includes both AA and Aa individuals, so its frequency is p² + 2pq, not p².
Related Guides & Calculators
- Punnett Square Calculator: genotype and phenotype ratios for a cross.
- Magnification Calculator: image size, actual size and microscope magnification.
- Percent Error Calculator: compare your result with the expected value.
- Percentage Calculator: turn any fraction into a percent.
More Calculators You Can Use
Free tools that pair well with this one.
