Hardy-Weinberg equilibrium calculator

Enter how many individuals of each genotype you counted to get the allele frequencies, the counts expected under Hardy-Weinberg equilibrium and a chi-square test of whether the population fits. Or start from the share of recessive individuals to estimate carriers.

Start from
p (frequency of A)0.5425
q (frequency of a)0.4575
AA expected share (p²)
29.43 %
Aa expected share (2pq)
49.64 %
aa expected share (q²)
20.93 %
AA expected count
294.31
Aa expected count
496.39
aa expected count
209.31
Chi-square (χ², 1 df)
0.2215
p-value
0.6379
In equilibrium at α = 0.05
yes, no significant deviation

Runs in your browser: nothing you enter is sent anywhere.

How to use

  1. Keep Genotype counts and type how many AA, Aa and aa individuals you observed.
  2. Read p and q, the expected shares and counts, χ², the p-value and whether the sample fits equilibrium at the 5 % level.
  3. For a recessive trait where carriers cannot be told apart, choose Recessive phenotype share and enter the percentage with the trait.

Formulas

  • p = (2·AA + Aa) / (2N), q = 1 − p, where N = AA + Aa + aa.
  • Expected genotype shares: p², 2pq, q²; expected counts: these × N.
  • χ² = Σ (O − E)² / E with 1 degree of freedom; the p-value is 2 × (1 − Φ(√χ²)), where Φ is the standard normal distribution (the χ² distribution with 1 df is the square of a standard normal).
  • From the recessive share: q = √q², p = 1 − q, carriers = 2pq, “1 in” = 1 / 2pq.

Worked example

The default sample has AA 298, Aa 489, aa 213 (N = 1000). p = (596 + 489) / 2000 = 0.5425, q = 0.4575. Expected counts are 294.31, 496.39 and 209.31. χ² = 3.69²/294.31 + 7.39²/496.39 + 3.69²/209.31 = 0.2215, p-value 0.6379 — no significant deviation, the sample fits equilibrium.

If 1 % of a population shows a recessive trait: q = 0.1, p = 0.9, AA 81 %, Aa 18 %, aa 1 %; carriers are 1 in 5.6.

Tips

  • Use counts, not percentages, in the first mode: the χ² test depends on the sample size.
  • A non-significant result does not prove equilibrium; small samples rarely show deviations.
  • Expected counts below about 5 make the χ² approximation rough; consider an exact test for small samples.

Frequently asked questions

What is Hardy-Weinberg equilibrium?

In a large, randomly mating population with no selection, mutation or migration, allele frequencies stay the same from generation to generation and genotypes settle at p² (AA), 2pq (Aa) and q² (aa), where p + q = 1.

How is the chi-square test done?

Expected counts are p²N, 2pqN and q²N. χ² = Σ (observed − expected)² / expected over the three genotypes. With two alleles there is 1 degree of freedom (3 classes − 1 − 1 estimated frequency), so χ² above 3.84 means p < 0.05 and a significant deviation.

How do I find the carrier frequency of a recessive disease?

Switch to the recessive share and enter how common the condition is. If 1 in 2,500 people is affected, q² = 0.04 %, q = 0.02 and carriers 2pq = 3.92 %, or 1 in 25.5. This assumes equilibrium, which real populations only approximate.

Why is there no chi-square for some counts?

If one allele is missing (for example only AA individuals), an expected count is zero and the test cannot be done; p and q are still shown.

More in Education

All tools in this category: Education ·Updated November 4, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.