Hardy-Weinberg Equilibrium Calculator
Enter allele frequency p to get expected genotype frequencies, then optionally enter observed counts for a chi-square goodness-of-fit test.
Use the Hardy-Weinberg Equilibrium Calculator
Allele Frequency
Enter a decimal value between 0 and 1 (e.g. 0.6)
Chi-Square Test (optional)
Enter observed genotype counts to test for deviation from HWE.
Enter allele frequency p and click Calculate to see results.
Allele Frequencies
Expected Genotype Frequencies
Frequency Distribution
Chi-Square Goodness-of-Fit Test
| Genotype | Observed | Expected | (O−E)²/E |
|---|
Summary
The Hardy-Weinberg Equilibrium (HWE) principle states that allele and genotype frequencies in a population remain constant from generation to generation in the absence of evolutionary influences. Given the dominant allele frequency p, this calculator derives q = 1 − p and computes expected genotype frequencies: p² (homozygous dominant), 2pq (heterozygous), and q² (homozygous recessive). It also supports a chi-square goodness-of-fit test to determine whether an observed sample deviates significantly from HWE.
How it works
- Enter the frequency of allele A (dominant) as a decimal between 0 and 1.
- The calculator automatically computes q = 1 − p (recessive allele frequency).
- Expected genotype frequencies are displayed: p² (AA), 2pq (Aa), and q² (aa).
- Optionally enter the total sample size (N) plus observed counts for AA, Aa, and aa genotypes.
- The chi-square statistic and p-value are calculated to test for significant deviation from HWE.
- A conclusion states whether the population is in Hardy-Weinberg equilibrium at α = 0.05.
Use cases
- Estimate genotype frequencies in a population genetics study.
- Test whether a SNP dataset deviates from Hardy-Weinberg equilibrium.
- Verify population data quality in GWAS pre-processing.
- Teach or learn the Hardy-Weinberg principle in genetics courses.
- Estimate the frequency of heterozygous carriers of a recessive allele.
- Detect non-random mating, selection, or population structure in survey data.
- Cross-check manually computed HWE values in lab reports.
- Quickly explore how changing p shifts expected genotype proportions.