Interactive tool

Hardy-Weinberg Allele Frequency Calculator

The Hardy-Weinberg equation (p + q)^2 = p^2 + 2pq + q^2 predicts genotype frequencies in a population that is not evolving - large, randomly mating, with no selection, mutation, or migration. In allele-frequency mode you enter p, the frequency of allele A, and the tool returns p^2 (AA), 2pq (Aa), and q^2 (aa). This is the null model of population genetics: any deviation from it signals that evolution is acting.

Hardy–Weinberg Calculator

Expected genotype frequencies under p² + 2pq + q² = 1, plus a χ² goodness-of-fit test against observed counts.

q (a) = 0.40 — p + q must equal 1.

Expected genotype frequencies (Hardy–Weinberg equilibrium):

  • AA: p² = 0.3600 (36.0%)
  • Aa: 2pq = 0.4800 (48.0%)
  • aa: q² = 0.1600 (16.0%)
Assumptions behind these numbers: random mating, no selection, no mutation, no migration, and a very large population. If real genotype counts deviate significantly, one of these assumptions is being violated — that is how the test below detects evolution.

How to use it

  1. Enter the frequency p of allele A (a decimal between 0 and 1).

  2. Read the three expected genotype frequencies p^2, 2pq, and q^2, which the tool calculates automatically.

  3. Try extreme values (p near 0 or 1) and p = 0.5 to see how heterozygote frequency changes.

  4. Check that the three frequencies always sum to 1.

What you will learn

  • State the Hardy-Weinberg equation and define each term.
  • Calculate expected genotype frequencies from an allele frequency.
  • List the five conditions under which allele frequencies stay constant.
  • Explain why the equation serves as a null hypothesis for detecting evolution.