Interactive tool

Chi-Square Test for Hardy-Weinberg Equilibrium

This tool uses the counts mode of the Hardy-Weinberg calculator: you enter the observed numbers of AA, Aa, and aa individuals in a real population, and it estimates the allele frequency p from the data, computes the expected genotype counts under Hardy-Weinberg equilibrium, and runs a chi-square goodness-of-fit test comparing observed with expected. A significant chi-square (typically with 1 degree of freedom for this test) tells you the population deviates from equilibrium - evidence that selection, nonrandom mating, or another evolutionary force is at work.

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 observed counts of AA, Aa, and aa individuals in the three input fields.

  2. Note the estimated allele frequency p the tool derives from your counts.

  3. Read the expected genotype counts under Hardy-Weinberg equilibrium beside your observed counts.

  4. Interpret the chi-square statistic and p-value: a small p-value means reject equilibrium.

What you will learn

  • Estimate allele frequency from observed genotype counts.
  • Compute expected genotype counts under Hardy-Weinberg equilibrium.
  • Apply the chi-square goodness-of-fit test to genetic data.
  • Interpret what rejecting equilibrium implies about evolutionary forces.