Free · Biology · p² + 2pq + q² = 1

Hardy-Weinberg Calculator

Find allele and genotype frequencies, carrier rates and expected counts, or test whether a population is in Hardy-Weinberg equilibrium with a chi-square test.

Calculate Hardy-Weinberg Frequencies
Results update as you type.
This is q² × 100. Example: 16
For expected numbers
—

—
—
—
Hardy-Weinberg equations: p + q = 1 and p² + 2pq + q² = 1, where p is the dominant allele frequency, q the recessive allele frequency, p² = AA, 2pq = Aa (carriers) and q² = aa.

The Hardy-Weinberg equations are p + q = 1 and p² + 2pq + q² = 1. If 16% of a population shows a recessive trait, q² = 0.16, so q = 0.4 and p = 0.6. Then AA = 0.36, Aa = 0.48 (carriers) and aa = 0.16.

Key takeaways
  • p and q are allele frequencies; p², 2pq and q² are genotype frequencies.
  • Start from the recessive phenotype: it always equals q².
  • A chi-square value below 3.841 (1 degree of freedom) means the population fits equilibrium.

How to Use the Hardy-Weinberg Calculator

  1. Recessive trait %: enter the share of the population showing the recessive phenotype. This is the most common textbook problem.
  2. Allele frequency: enter p or q to get the other allele and all three genotype frequencies.
  3. Genotype counts: enter observed AA, Aa and aa numbers to get allele frequencies, expected counts and a chi-square test.

The Hardy-Weinberg Formulas

p + q = 1
p² + 2pq + q² = 1
SymbolMeaning
pFrequency of the dominant allele (A)
qFrequency of the recessive allele (a)
p²Frequency of homozygous dominant (AA)
2pqFrequency of heterozygotes, or carriers (Aa)
q²Frequency of homozygous recessive (aa)

The equations hold when a population is not evolving: no mutation, no migration, no natural selection, random mating and a very large population.

Worked Examples

Example 1: From a recessive trait. 16% of a population has a recessive trait.

  1. q² = 0.16, so q = √0.16 = 0.4
  2. p = 1 − 0.4 = 0.6
  3. AA = 0.6² = 0.36; Aa = 2 × 0.6 × 0.4 = 0.48; aa = 0.16
  4. So 48% of the population are carriers.

Example 2: From genotype counts. A sample has 490 AA, 420 Aa and 90 aa (1,000 people).

  1. p = (2 × 490 + 420) ÷ 2,000 = 0.7; q = 0.3
  2. Expected: AA = 0.49 × 1,000 = 490; Aa = 0.42 × 1,000 = 420; aa = 0.09 × 1,000 = 90
  3. χ² = 0, well below 3.841, so the population is in equilibrium.

Common Recessive Frequencies

Recessive trait (q²)qpCarriers (2pq)
1%0.100.9018.0%
4%0.200.8032.0%
9%0.300.7042.0%
16%0.400.6048.0%
25%0.500.5050.0%
36%0.600.4048.0%

To see a single cross instead of a whole population, use the Punnett square calculator. To turn any count into a percentage, try the percentage calculator.

Tips for Hardy-Weinberg Problems

  • Always start with q². The recessive phenotype is the only genotype you can count directly.
  • Don’t use the dominant phenotype as p². It includes both AA and Aa.
  • Check your work: p² + 2pq + q² should add up to 1.
  • Comparing a lab result with the expected value? The percent error calculator shows how far off it is.

Frequently Asked Questions

What is the Hardy-Weinberg equation?

It is p² + 2pq + q² = 1, together with p + q = 1. p and q are the frequencies of the two alleles, and p², 2pq and q² are the frequencies of the AA, Aa and aa genotypes.

How do you find q in Hardy-Weinberg?

Take the frequency of the recessive phenotype (q²) and find its square root. If 9% of a population shows the recessive trait, q = √0.09 = 0.3.

How do you calculate carriers?

Carriers are heterozygotes, so their frequency is 2pq. With p = 0.6 and q = 0.4, 2pq = 0.48, meaning 48% of the population are carriers.

What are the 5 conditions of Hardy-Weinberg equilibrium?

No mutation, no migration (gene flow), no natural selection, random mating and a very large population (no genetic drift).

How do you test for Hardy-Weinberg equilibrium?

Calculate expected genotype counts from p and q, then do a chi-square test with 1 degree of freedom. If χ² is below 3.841, the population fits equilibrium at the 5% significance level.

Why is there only 1 degree of freedom?

There are 3 genotype classes, minus 1 for the total and minus 1 because the allele frequency p is estimated from the data, which leaves 1 degree of freedom.

Can p² be the dominant phenotype frequency?

No. The dominant phenotype includes both AA and Aa individuals, so its frequency is p² + 2pq, not p².

More Calculators You Can Use

Free tools that pair well with this one.

Punnett Square Calculator

Genotype and phenotype ratios for any cross.

Open calculator

Magnification Calculator

Image size, actual size and magnification.

Open calculator

Percent Error Calculator

Compare a measured value with the true value.

Open calculator

Percentage Calculator

Turn any fraction into a percent.

Open calculator

Z-Score Calculator

Z-scores, percentiles and the normal curve.

Open calculator

Percentile Calculator

Find the percentile rank of any score.

Open calculator
Scroll to Top