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 observed counts for each genotype in your sample.
Enter allele frequencies or genotype counts and click Calculate.
Allele Frequencies
p + q = —
Expected Genotype Frequencies
Chi-Square Test (df = 1)
| Genotype | Observed | Expected | (O-E)²/E |
|---|---|---|---|
| Total | — | — | — |
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
- Choose input mode: enter allele frequencies directly, or provide observed genotype counts.
- If entering genotype counts, allele frequencies p and q are derived automatically.
- Expected genotype frequencies are calculated as p², 2pq, and q².
- Expected genotype counts (if sample size is known) are compared to observed counts via chi-square test.
- The chi-square statistic and p-value indicate whether the population deviates from equilibrium.
- 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.