Hardy–Weinberg Equilibrium Calculator
The Hardy–Weinberg principle predicts genotype frequencies in a population that is not evolving. Comparing real data with these predictions shows whether selection, migration or other forces are at work. This free Hardy–Weinberg equilibrium calculator solves for whichever value you leave blank and shows the formula and steps.
How to use the Hardy–Weinberg equilibrium calculator
Enter the share of the population showing the recessive phenotype (q²). Allele frequencies and all genotype frequencies are calculated.
Equations
p + q = 1 p² + 2pq + q² = 1
Example
If 4% of a population shows a recessive trait:
- q = √0.04 = 0.2, p = 0.8
- Homozygous dominant = 64%
- Carriers (2pq) = 32%
Carrier frequency examples
| Condition frequency (q²) | q | Carriers (2pq) | About 1 in … carriers |
|---|---|---|---|
| 1 in 100 | 0.1000 | 18.00% | 6 |
| 1 in 1,000 | 0.0316 | 6.12% | 16 |
| 1 in 2,500 | 0.0200 | 3.92% | 26 |
| 1 in 10,000 | 0.0100 | 1.98% | 51 |
| 1 in 40,000 | 0.0050 | 1.00% | 101 |
| 1 in 100,000 | 0.0032 | 0.63% | 159 |
Even very rare recessive conditions have many more carriers than affected people.
The five assumptions
Hardy–Weinberg equilibrium holds only when:
- No mutation.
- Random mating.
- No natural selection.
- A very large population (no genetic drift).
- No migration (gene flow).
Real populations break some of these, so differences from the predicted frequencies can reveal evolution in action.
Testing for equilibrium
Compare observed genotype counts with expected counts using a chi-square test with 1 degree of freedom. A chi-square value above 3.84 suggests the population is not in equilibrium at the 5% level.
Sex-linked traits
For X-linked recessive traits, the frequency in males equals q directly (males have one X). In females it is q². Colour blindness affecting about 8% of men of northern European descent gives q ≈ 0.08 and about 0.64% of women affected.
Frequently asked questions
What is Hardy–Weinberg equilibrium?
A model where allele and genotype frequencies stay constant between generations, given random mating and no selection, mutation, migration or genetic drift.
How do I find carrier frequency?
Take the square root of the affected (recessive) frequency to get q, then calculate 2pq.
Do p² + 2pq + q² always add to 1?
Yes — they cover every genotype in the population.
If 1 in 2,500 people has a recessive condition, how many are carriers?
q = 0.02, so 2pq ≈ 3.9% — about 1 in 26.
What is p + q?
p + q = 1, because the two allele frequencies add up to all alleles at that gene.