Hardy-Weinberg Calculator
From a recessive frequency or allele frequency, get the full genotype distribution.
Genotypes — AA: 0.36, Aa: 0.48, aa: 0.16
The Hardy-Weinberg equation is p² + 2pq + q² = 1, with p + q = 1. If 16% show the recessive phenotype, then q² = 0.16, so q = √0.16 = 0.4 and p = 0.6. The genotypes are AA = 0.36, Aa = 0.48, and aa = 0.16 — meaning 48% are carriers.
How the Hardy-Weinberg principle works
In an idealized population that isn’t evolving, allele and genotype frequencies stay constant from one generation to the next. There are two alleles for the gene: the dominant one with frequency p and the recessive one with frequency q. Because every allele is one or the other, p + q = 1. Squaring that relationship spreads the alleles across the three possible genotypes.
p² = AA, 2pq = Aa, q² = aa; and p + q = 1
Worked example
Suppose 16% of a population shows the recessive phenotype, so q² = 0.16:
- 1 Find q from the recessive phenotype. q² = 0.16, so q = √0.16 = 0.4. The recessive allele makes up 40% of the gene pool.
- 2 Find p from p + q = 1. p = 1 − 0.4 = 0.6. The dominant allele makes up 60%.
- 3 Spread the alleles across genotypes. AA = p² = 0.6² = 0.36, Aa = 2pq = 2 × 0.6 × 0.4 = 0.48, aa = q² = 0.16.
- 4 Check that the frequencies sum to 1. 0.36 + 0.48 + 0.16 = 1.00. So 48% of the population are carriers (Aa).
Assumptions, uses, and pitfalls
The five assumptions. Equilibrium holds only with no selection, no mutation, no migration, no genetic drift (an effectively infinite population), and random mating. Real populations only approximate these conditions. If you start instead from observed genotype counts, the allele frequency calculator works the equation in reverse to recover p and q.
Real-world example. Cystic fibrosis appears in roughly 1 in 2,500 births in some populations, so q² ≈ 0.0004, giving q ≈ 0.02 and a carrier frequency 2pq ≈ 0.039 — about 1 in 25 people carry one copy without showing the disease.
Common mistakes. Don’t confuse the recessive allele frequency (q) with the recessive phenotype frequency (q²) — you must take a square root to get from one to the other. And the dominant phenotype is p² + 2pq, not just p², because heterozygotes also look dominant.
Genotype frequencies at sample allele frequencies
Each row sums to 1; carrier frequency (2pq) peaks when p = q = 0.5.
| p | q | AA (p²) | Aa (2pq) | aa (q²) |
|---|---|---|---|---|
| 0.9 | 0.1 | 0.81 | 0.18 | 0.01 |
| 0.7 | 0.3 | 0.49 | 0.42 | 0.09 |
| 0.6 | 0.4 | 0.36 | 0.48 | 0.16 |
| 0.5 | 0.5 | 0.25 | 0.50 | 0.25 |