Hardy-Weinberg Equilibrium Calculator
The Hardy-Weinberg principle states that allele and genotype frequencies in a large, randomly mating population remain constant across generations in the absence of evolutionary forces. Given the frequency of homozygous recessive individuals, this calculator derives the frequencies of both alleles and the heterozygous carrier genotype.
Advertisement
Calculator
See your Hardy-Weinberg Equilibrium Calculator results
Enter your email to unlock results — free forever.
No spam, ever. Unsubscribe at any time.
Advertisement
Formula
p² + 2pq + q² = 1; q = √q²; p = 1 − q
q² is the observed frequency of homozygous recessive individuals (the only genotype directly observable for recessive traits). Taking the square root gives q, the recessive allele frequency. p = 1 − q because there are only two alleles. The carrier (heterozygous) frequency is 2pq, which is typically much higher than q² and represents the hidden genetic load in the population.
How to use the Hardy-Weinberg Equilibrium Calculator
- 1
Enter your frequency of homozygous recessive (q²)
Value should be in (0–1).
- 2
Read your results instantly
Results update in real time as you type.
Advertisement
The Hardy-Weinberg principle and evolutionary equilibrium
Independently derived in 1908 by G.H. Hardy and Wilhelm Weinberg, the Hardy-Weinberg principle is a mathematical null hypothesis for population genetics. It predicts that a population will maintain constant allele and genotype frequencies across generations if five conditions are met: no mutation, no migration, random mating, infinite population size, and no natural selection. These conditions are never fully met in nature, which is precisely why the principle is useful — deviations from Hardy-Weinberg predictions reveal that one or more evolutionary forces are acting on the population. The principle is used in medical genetics to estimate carrier frequencies for recessive diseases, in forensics to interpret DNA profile probabilities, and in ecology to assess population health.
Practical uses in genetic counseling
One of the most important applications of Hardy-Weinberg is estimating the carrier frequency for autosomal recessive diseases. Cystic fibrosis affects approximately 1 in 2,500 people of Northern European descent, meaning q² ≈ 0.0004. Taking the square root gives q ≈ 0.02, p ≈ 0.98, and the carrier frequency 2pq ≈ 0.039 — roughly 1 in 25 people carry one copy of the mutant CFTR allele without being affected. This estimate is vital for genetic counselors advising couples about their risk of having an affected child. Note that this calculation assumes the population is in Hardy-Weinberg equilibrium for this locus, which may not hold if founder effects, consanguinity, or strong selection are present.
Tips & Insights
q² must be between 0 and 1
Enter the frequency as a proportion, not a percentage. If 4% of a population is homozygous recessive, enter 0.04. Entering 4 will produce an error or nonsensical result since square roots of numbers greater than 1 give values outside the 0–1 range expected for a frequency.
Verify your result: p + q should equal 1
After calculating p and q, add them together. They must sum to exactly 1 (within rounding). If they do not, your input q² value may have been estimated incorrectly. Also verify that p² + 2pq + q² = 1 as a check on all three genotype frequencies.
Carrier frequency is always larger than disease frequency
For rare recessive diseases, the carrier frequency (2pq) is always much larger than the disease frequency (q²). When q is small, 2pq ≈ 2q, so carriers outnumber affected individuals by a ratio of about 2/q. This explains why recessive diseases persist in populations despite reducing fitness of affected individuals.
Worked Examples
Cystic fibrosis (Northern European population)
q ≈ 0.02, p ≈ 0.98, carrier frequency 2pq ≈ 0.0392 (about 1 in 25 individuals is a carrier).
Albinism (approximate global frequency)
q ≈ 0.01, p ≈ 0.99, carrier frequency 2pq ≈ 0.0198 (roughly 1 in 50 individuals carries the recessive allele).
Advertisement
Frequently Asked Questions
Why can we only directly observe q² and not q?
For a recessive trait, only homozygous recessive individuals (aa) show the recessive phenotype. Heterozygous carriers (Aa) look identical to homozygous dominants (AA) when dominance is complete. So the only directly countable recessive genotype in the population is aa, which has frequency q².
What does it mean if a population is NOT in Hardy-Weinberg equilibrium?
Deviations from expected genotype frequencies suggest that one of the five assumptions is being violated. Common causes include non-random mating (inbreeding increases homozygosity), selection against one genotype, a recent population bottleneck, or gene flow from a different population with different allele frequencies.
Can Hardy-Weinberg be applied to traits with more than two alleles?
Yes, the principle extends to multiple alleles. With three alleles (p, q, r), the genotype frequencies are p², q², r², 2pq, 2pr, and 2qr, and p + q + r = 1. The calculation becomes more complex, but the underlying concept is the same. This calculator handles the two-allele case only.
Does Hardy-Weinberg apply to X-linked traits?
With modifications, yes. For X-linked loci, males are hemizygous (only one allele), so they show the recessive phenotype at frequency q rather than q². The equilibrium still holds, but the frequency calculations differ between sexes and take longer to reach equilibrium when starting from non-equilibrium frequencies.
How is the Hardy-Weinberg principle used in forensic DNA analysis?
In forensic DNA profiling, each genetic locus has known allele frequencies in the relevant population database. The probability of a random person having a specific genotype at one locus is estimated using Hardy-Weinberg: p² for homozygotes or 2pq for heterozygotes. These probabilities are multiplied across multiple independent loci (the product rule) to give the overall match probability.
Advertisement