Skip to content
K Knidox Search…
Biology · Population Genetics

Hardy-Weinberg Calculator

From a recessive frequency or allele frequency, get the full genotype distribution.

Allele frequencies
p = 0.6 · q = 0.4

Genotypes — AA: 0.36, Aa: 0.48, aa: 0.16

Genotype frequencies (%)

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² + 2pq + q² = 1

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. 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. 2
    Find p from p + q = 1. p = 1 − 0.4 = 0.6. The dominant allele makes up 60%.
  3. 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. 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.

pqAA (p²)Aa (2pq)aa (q²)
0.90.10.810.180.01
0.70.30.490.420.09
0.60.40.360.480.16
0.50.50.250.500.25
What does q² represent?
The frequency of the homozygous recessive genotype (aa), which equals the recessive phenotype frequency. Take its square root to get the recessive allele frequency q.
What are the five assumptions?
No natural selection, no mutation, no migration (gene flow), no genetic drift (a very large population), and random mating. Real populations only approximate them.
Who carries the trait without showing it?
Carriers are heterozygous (Aa), with frequency 2pq. They have one recessive allele but the dominant phenotype.
How do I find the dominant phenotype frequency?
Add the two dominant genotypes: p² + 2pq. Equivalently, it is 1 − q². It is not just p².
Can I start from the dominant allele frequency instead?
Yes. Switch the tool to “From p”, enter p, and q = 1 − p; the genotype frequencies follow directly.
How would I test whether a population is actually at equilibrium?
Compare observed genotype counts to the expected p², 2pq, q² counts with a chi-square goodness-of-fit test. A large gap suggests evolutionary forces are acting.