Hardy Weinberg Calculator

Enter allele frequencies or observed genotype counts to calculate Hardy-Weinberg equilibrium allele and genotype frequencies.

Use the Hardy Weinberg Calculator

Input Mode

Leave blank to auto-compute q = 1 - p

Enter allele frequencies or genotype counts and click Calculate.

Summary

The Hardy-Weinberg principle states that allele and genotype frequencies in a population remain constant from generation to generation in the absence of evolutionary influences. Given allele frequencies p and q (where p + q = 1), expected genotype frequencies are: p² (homozygous dominant), 2pq (heterozygous), and q² (homozygous recessive). This calculator also performs a chi-square goodness-of-fit test to determine whether an observed population is in Hardy-Weinberg equilibrium.

How it works

  1. Choose input mode: enter allele frequencies directly, or provide observed genotype counts.
  2. If entering genotype counts, allele frequencies p and q are derived automatically.
  3. Expected genotype frequencies are calculated as p², 2pq, and q².
  4. Expected genotype counts (if sample size is known) are compared to observed counts via chi-square test.
  5. The chi-square statistic and p-value indicate whether the population deviates from equilibrium.
  6. Results update instantly as you type.

Use cases

  • Genetics coursework and exam preparation.
  • Estimating carrier frequency for recessive genetic disorders.
  • Population genetics research and data analysis.
  • Testing whether a sampled population is in Hardy-Weinberg equilibrium.
  • Predicting genotype distribution given known allele frequencies.
  • Biology and bioinformatics teaching demonstrations.
  • Forensic genetics allele frequency analysis.
  • Evolutionary biology studies comparing generations.

Frequently Asked Questions

Last updated: 2026-09-30 · Reviewed by Nham Vu