Hardy-Weinberg Calculator

Calculate Hardy-Weinberg allele and genotype frequencies from counts, then run a chi-square goodness-of-fit test with degrees of freedom, an exact p-value, and a reject or fail-to-reject verdict.

At a glance

Computes
Allele and genotype frequencies, plus a chi-square goodness-of-fit test with df and p.
You supply
Observed genotype counts, or an allele frequency, for one two-allele locus.
Use when
One locus, two alleles, and you need to test a population against equilibrium.
Assumes
Random mating, no selection, migration, mutation, or drift, and a large population.
Input mode

Enter p, q, or both. If both are entered, they must sum to 1.

Genotype frequency against Allele frequency p

0.00.20.40.60.81.00.00.20.40.60.81.0Entered p = 0.5p squared2pqq squared

Allele frequencies

Enter values

Biallelic autosomal Hardy-Weinberg model.

p allele frequency
0
q allele frequency
0
Chi-square
Only for counts
Degrees of freedom
Only for counts
p-value
Only for counts
Verdict
Only for counts

Chi-square is a classroom check, not proof of equilibrium.

Expected genotype frequencies
GenotypeFrequencyPercentExpected countObserved count

Equilibrium assumptions

  • Biallelic diploid autosomal locus.
  • Random mating in a large population.
  • No selection, mutation, migration, or genetic drift.
  • Equal allele frequencies across sexes.
Export

p + q = 1; AA = p^2; Aa = 2pq; aa = q^2 How?

How this is calculated

In allele-frequency mode, the calculator accepts p, q, or both. In recessive phenotype mode, it takes the square root of q squared to estimate q and then sets p to 1 minus q.

In genotype-count mode, p is estimated as twice AA plus Aa divided by twice the sample size. Expected counts are the Hardy-Weinberg genotype frequencies multiplied by that sample size. The chi-square value sums observed minus expected squared over expected across AA, Aa, and aa.

Formula: p + q = 1; AA = p^2; Aa = 2pq; aa = q^2

Sources

  1. Hardy-Weinberg principle. Wikipedia. Retrieved .
  2. Chi-Square Test of Goodness-of-Fit (Hardy-Weinberg df). Biology LibreTexts. Retrieved .
  3. A straightforward multiallelic significance test for the Hardy-Weinberg equilibrium law. Genetics and Molecular Biology 32(3):619-625 (Lauretto et al., 2009). Retrieved .

Method last reviewed