Hardy-Weinberg Equilibrium Calculator
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. Given the frequency of one allele (p or q) in a two-allele system, this calculator computes the expected genotype frequencies: p2 (homozygous dominant, AA), 2pq (heterozygous, Aa), and q2 (homozygous recessive, aa). The sum p2 + 2pq + q2 always equals 1. This calculator is widely used in genetics to estimate carrier frequencies for recessive diseases and to detect whether a population is evolving.
Hardy-Weinberg formula
p + q = 1
p2 + 2pq + q2 = 1
Where p is the frequency of the dominant allele, q is the frequency of the recessive allele, p2 is the homozygous dominant genotype frequency, 2pq is the heterozygous genotype frequency, and q2 is the homozygous recessive genotype frequency.
Using Hardy-Weinberg in practice
- To estimate carrier frequency for a recessive genetic disease: if q2 is the disease prevalence, q = sqrt(q2), and the carrier frequency is 2pq.
- Comparing observed genotype frequencies to Hardy-Weinberg predictions reveals whether a population is evolving at a particular locus.
- The principle applies to diploid sexually reproducing organisms with two alleles per locus.
- Real populations rarely meet all five H-W conditions, so deviations are biologically informative.
Frequently asked questions
What is Hardy-Weinberg equilibrium?
Hardy-Weinberg equilibrium describes the expected genotype frequencies in an infinitely large, randomly mating population with no selection, mutation, migration, or genetic drift. It predicts that allele frequencies remain constant from generation to generation.
What do p and q represent?
In a two-allele system, p is the frequency of the dominant allele and q is the frequency of the recessive allele. They must sum to 1 (p + q = 1). If you know one, the other is 1 minus the first.
What are p2, 2pq, and q2?
p2 is the expected frequency of the homozygous dominant genotype (AA), 2pq is the heterozygous genotype frequency (Aa), and q2 is the homozygous recessive genotype frequency (aa). Together they sum to 1.
How do I find the carrier frequency from a disease prevalence?
If the disease is recessive and has prevalence q2, take the square root to find q, then compute p = 1 - q. The carrier frequency is 2pq. For example, if 1 in 10,000 people has the disease, q2 = 0.0001, q = 0.01, p = 0.99, and 2pq = 0.0198 (about 2%).
What are the five conditions required for Hardy-Weinberg equilibrium?
The five conditions are: (1) random mating, (2) no natural selection, (3) no mutation, (4) no gene flow (migration), and (5) an infinitely large population (no genetic drift). Deviations from these conditions cause allele frequencies to change over generations.
Official sources
- National Human Genome Research Institute (NHGRI): Hardy-Weinberg Equilibrium definition.
- National Center for Biotechnology Information (NCBI): Genetics and population genetics resources.
Reviewed by the CalculatorHub team, edited by James Graham, 15 June 2026. See our methodology.