Skip to content
FiftyCalc Free calculators for all 50 states

Hardy-Weinberg Equilibrium Calculator

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter observed genotype counts to compare them with Hardy-Weinberg expectations.

Result

Sample figures

Chi-square (1 degree of freedom)—

Individuals (N) —

  • Frequency of A (p)—
  • Frequency of a (q)—
  • Expected AA (p² × N)—
  • Expected Aa (2pq × N)—
  • Expected aa (q² × N)—
  • Result at the 5% level—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Hardy-Weinberg Equilibrium Calculator

Number of AA individuals (homozygous dominant): enter 0 or more. Prefilled example: 36.

Number of Aa individuals (heterozygous): enter 0 or more. Prefilled example: 48.

Number of aa individuals (homozygous recessive): enter 0 or more. Prefilled example: 16.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Number of AA individuals (homozygous dominant): enter 0 or more.
  2. Number of Aa individuals (heterozygous): enter 0 or more.
  3. Number of aa individuals (homozygous recessive): enter 0 or more.
  4. Read the result: Chi-square (1 degree of freedom); the panel also shows Individuals (N), Frequency of A (p), Frequency of a (q), Expected AA (p² × N), Expected Aa (2pq × N), Expected aa (q² × N) and Result at the 5% level.

How this calculator works

Allele frequencies come from gene counting: p = (2 × AA + Aa) ÷ 2N and q = 1 − p. Under Hardy-Weinberg equilibrium (random mating, no selection, migration or mutation, large population), genotype frequencies are p², 2pq and q², which add up to 1.

Chi-square = Σ (observed − expected)² ÷ expected over the three genotypes. With two alleles the test has 1 degree of freedom (3 classes − 1 − 1 estimated frequency); the 5% critical value is 3.841. Expected counts below 5 make the test unreliable.

The formula

  1. N=aa2+aa1+aa0
  2. P=2×aa2+aa12×N
  3. Q=1−P
  4. E2=P2×N
  5. E1=2×P×Q×N
  6. E0=Q2×N
  7. Chi=(aa2−E2)2E2+(aa1−E1)2E1+(aa0−E0)2E0
Symbols used in the formula
SymbolMeaning
aa2Number of AA individuals (homozygous dominant)
aa1Number of Aa individuals (heterozygous)
aa0Number of aa individuals (homozygous recessive)
NIndividuals (N)
PFrequency of A (p)
QFrequency of a (q)
E2Expected AA (p² × N)
E1Expected Aa (2pq × N)
E0Expected aa (q² × N)
ChiChi-square (1 degree of freedom)

Worked example

Number of AA individuals (homozygous dominant)36
Number of Aa individuals (heterozygous)48
Number of aa individuals (homozygous recessive)16
Individuals (N)100
Frequency of A (p)0.6
Frequency of a (q)0.4
Expected AA (p² × N)36.00
Expected Aa (2pq × N)48.00
Expected aa (q² × N)16.00
Result at the 5% levelConsistent with Hardy-Weinberg equilibrium (chi-square below 3.841)
  1. N=36+48+16=100
  2. P=2×36+482×100=0.6
  3. Q=1−0.6=0.4
  4. E2=0.62×100=36
  5. E1=2×0.6×0.4×100=48
  6. E0=0.42×100=16
  7. Chi=(36−36)236+(48−48)248+(16−16)216=7.88861×10−31

Chi-square (1 degree of freedom) 0.00

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What are the Hardy-Weinberg equations?

p + q = 1 for alleles and p² + 2pq + q² = 1 for genotypes.

Are 36 AA, 48 Aa and 16 aa in equilibrium?

Yes, exactly: p = 0.6, so the expected counts are 36, 48 and 16 and chi-square is 0.

Related calculators