Hardy-Weinberg Equilibrium Calculator

The Hardy-Weinberg principle is the foundation of population genetics. It predicts the genotype frequencies expected in a population that is not evolving, given the allele frequencies. For two alleles with frequencies p and q, the expected proportions of the three genotypes are p squared, 2pq and q squared. This calculator takes the frequency p of the dominant allele, computes q as 1 minus p, and returns the expected genotype frequencies. Enter p between 0 and 1 to see the expected genotype distribution.

0.00
0.00
0.00
0.00

Hardy-Weinberg formula

q = 1 - p
homozygous dominant = p²
heterozygous = 2pq
homozygous recessive = q²
p² + 2pq + q² = 1

The three genotype frequencies are the terms of the expanded square (p + q)², which always sums to one. The model assumes random mating and no evolutionary forces.

Worked example

With p = 0.7, then q = 1 - 0.7 = 0.30. The homozygous dominant frequency is 0.7² = 0.49, the heterozygous frequency is 2 times 0.7 times 0.3 = 0.42, and the homozygous recessive frequency is 0.3² = 0.09. Check: 0.49 + 0.42 + 0.09 = 1.00.

Hardy-Weinberg equilibrium: frequently asked questions

What is the Hardy-Weinberg principle?

The Hardy-Weinberg principle states that allele and genotype frequencies in a population stay constant from generation to generation in the absence of evolutionary influences. For two alleles with frequencies p and q (where p + q = 1), the expected genotype frequencies are p squared for the homozygous dominant, 2pq for the heterozygous, and q squared for the homozygous recessive. These three sum to one.

What assumptions does Hardy-Weinberg equilibrium require?

The model assumes a large population with random mating, no mutation, no gene flow (migration), no natural selection, and no genetic drift. Real populations rarely meet all these conditions exactly, so the Hardy-Weinberg equilibrium serves as a null model. Comparing observed genotype frequencies against the expected values reveals whether evolutionary forces are at work.

How do you find allele frequency from genotype counts?

If you know the genotype counts, the frequency of an allele is the number of copies of that allele divided by the total number of alleles. Each homozygote contributes two copies of one allele, and each heterozygote contributes one of each. This calculator takes the allele frequency p directly; q is found as 1 minus p, since the two frequencies must sum to one.

Why must the allele frequencies sum to one?

For a single gene with two alleles, every allele in the population is one of the two types, so their frequencies are exhaustive and must add to one. This is why q is calculated as 1 minus p. If a gene has more than two alleles, the model extends to additional terms, but the frequencies still sum to one across all alleles.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 19 June 2026. See our methodology.