Enter the observed genotype counts (AA, Aa, and aa) into the calculator to estimate the allele frequencies (p and q, where p + q = 1), compute the expected genotype counts under Hardy–Weinberg equilibrium (HWE), and calculate the χ² statistic for a standard HWE goodness-of-fit test.

HWE Calculator

Enter genotype counts (AA, Aa, and aa):

Calculation Steps

No calculations performed yet.

Related Calculators

HWE Formulas

For a single bi-allelic locus with allele frequencies p and q (where p + q = 1), Hardy–Weinberg equilibrium (HWE) predicts the following expected genotype frequencies:

\begin{aligned}
p + q &= 1 \\
f(AA) &= p^2 \\
f(Aa) &= 2pq \\
f(aa) &= q^2
\end{aligned}

Variables:

  • p is the frequency of the first allele (A) in the population
  • q is the frequency of the second allele (a) in the population
  • , 2pq, and are the expected genotype frequencies of AA, Aa, and aa, respectively

If you have a sample size of N individuals, the expected genotype counts under HWE are E(AA)=p²·N, E(Aa)=2pq·N, and E(aa)=q²·N.

How to Calculate HWE Expected Genotype Frequencies?

The following steps outline how to calculate the Hardy–Weinberg expected genotype frequencies using f(AA)=p², f(Aa)=2pq, and f(aa)=q² (with p + q = 1).


  1. Determine the frequency of the first allele in the population (p).
  2. Compute the frequency of the second allele as q = 1 − p.
  3. Calculate the expected genotype frequencies: (AA), 2pq (Aa), and (aa).
  4. If you have a total sample size N, multiply each expected frequency by N to obtain expected genotype counts.

Example Problem:

Use the following variables as an example problem to test your knowledge:

Frequency of the first allele in the population (p) = 0.6

Frequency of the second allele in the population (q) = 0.4

Expected genotype frequencies under HWE: p² = 0.36 (AA), 2pq = 0.48 (Aa), and q² = 0.16 (aa).