Hardy-Weinberg Equilibrium Calculator
Calculate allele and genotype frequencies using the Hardy-Weinberg equations. Test whether a population is in equilibrium with a chi-square goodness-of-fit test, or simulate how evolutionary forces change allele frequencies over generations.
Allele Frequencies
Genotype Frequencies
Population (100 individuals)
Controls
Results
Reference Guide
The Hardy-Weinberg Principle
The Hardy-Weinberg principle states that allele and genotype frequencies in a population remain constant from generation to generation in the absence of evolutionary forces.
Five conditions must be met for a population to be in Hardy-Weinberg equilibrium: no mutation, random mating, no natural selection, very large population size, and no gene flow (migration).
Allele and Genotype Frequencies
In a two-allele system, p represents the frequency of the dominant allele (A) and q represents the frequency of the recessive allele (a).
The carrier frequency (2pq) tells you how many heterozygous individuals carry one copy of a recessive allele without showing the trait.
Testing for Equilibrium (Chi-Square)
A chi-square goodness-of-fit test compares observed genotype counts to the expected counts under Hardy-Weinberg equilibrium.
With 3 genotype classes and 1 estimated parameter (p), the degrees of freedom is df = 1. The critical value at the 0.05 significance level is 3.841.
Evolutionary Forces
When any of the five HW conditions is violated, allele frequencies change over time.
Natural selection changes frequencies based on fitness differences between genotypes. Alleles linked to higher fitness increase.
Genetic drift is random change due to sampling error in finite populations. Smaller populations drift faster and can lose alleles entirely.
Mutation introduces new alleles. Forward mutation A to a gradually increases q.
Gene flow (migration) brings alleles from other populations, pulling frequencies toward the source population.