Hardy-Weinberg calculator
Enter one known frequency to get the rest, with the steps shown.
Use decimals, so 4% is 0.04. Assumes a two-allele gene in Hardy-Weinberg equilibrium: p + q = 1 and p² + 2pq + q² = 1.
The two equations
For a gene with two alleles, p is the frequency of the dominant allele and q is the frequency of the recessive allele, so p + q = 1. Genotype frequencies follow p² + 2pq + q² = 1.
A common problem gives the share of people showing the recessive trait. That is q², so q is its square root. The model assumes random mating, no selection, no mutation, no migration, and a large population.
Worked example
In a population, 16% of individuals show a recessive trait (aa). That fraction is q², so q² = 0.16 and q = √0.16 = 0.4. Since p + q = 1, p = 0.6.
The genotype frequencies are then p² = 0.36 (36% AA), 2pq = 2 × 0.6 × 0.4 = 0.48 (48% Aa, the carriers) and q² = 0.16 (16% aa). They add up to 1.00, which is a good check.
Frequently asked questions
Why do I start from q² instead of p²?
Recessive individuals (aa) are the only genotype you can identify just by looking, because AA and Aa look the same. So the recessive phenotype frequency gives you q² directly.
What conditions does Hardy-Weinberg assume?
No mutation, random mating, no natural selection, a very large population (no genetic drift) and no gene flow (migration). Real populations rarely meet all five, which is the point: differences from the prediction show that evolution is happening.
What is the difference between p and p²?
p is the frequency of the A allele among all gene copies. p² is the frequency of AA individuals in the population.
How do I test whether a population is in equilibrium?
Compare the observed genotype counts with the expected counts (p² × N, 2pq × N, q² × N) using a chi-square test. A large difference means the population is not in Hardy-Weinberg equilibrium.