Hardy-Weinberg equilibrium is a principle in genetics stating that allele frequencies in a population stay constant from generation to generation, as long as no evolutionary forces are acting on them. Think of it as the genetic version of “nothing changes unless something makes it change.” It provides a baseline for detecting whether evolution is happening at a specific gene.
The principle was independently described in 1908 by two scientists working in different countries: Wilhelm Weinberg, a German physician who presented it at a meeting in Stuttgart in January of that year, and G. H. Hardy, a British mathematician who published the same result months later in the journal Science. Neither knew about the other’s work.
The Core Idea
Every trait you carry is coded by gene variants called alleles. You inherit two copies of each gene, one from each parent. In a large population, you can count up how common each version of a gene is. Hardy-Weinberg equilibrium says that if nothing is disturbing the population, the proportions of these alleles, and the proportions of people carrying each combination, will remain the same indefinitely.
This matters because real populations almost never sit perfectly still. Mutations introduce new alleles, some individuals survive and reproduce better than others, people move between populations, and random chance shifts allele counts in small groups. Each of these forces nudges a population away from equilibrium. By comparing a real population’s genetic makeup to what Hardy-Weinberg predicts, researchers can detect which forces are at work and how strong they are. It functions as a null hypothesis: if the numbers match, no detectable evolution is occurring at that gene. If they don’t match, something interesting is going on.
Five Conditions That Must Hold
For a population to stay in Hardy-Weinberg equilibrium, five conditions must all be true at once:
- No mutations. The gene in question doesn’t change into new versions.
- No migration. No individuals move into or out of the population, so no new alleles arrive and none leave.
- Random mating. Individuals pair up by chance, with no preference for mates who look or behave a certain way.
- No genetic drift. The population is large enough that random chance alone doesn’t shift allele counts from one generation to the next. In theory, the population would need to be infinitely large for drift to have zero effect.
- No natural selection. Every combination of alleles survives and reproduces equally well. No version gives an advantage or disadvantage.
No natural population meets all five conditions perfectly, which is exactly the point. The equilibrium is a theoretical benchmark, not a description of reality. It tells you what the genetic landscape would look like in the absence of evolution, so you can measure how far a real population has drifted from that ideal.
The Equation and What It Calculates
For a gene with two alleles, called A and a, you assign the letter p to the frequency of allele A and the letter q to the frequency of allele a. Since those are the only two options, p + q = 1. If 70% of the alleles in a population are A and 30% are a, then p = 0.7 and q = 0.3.
The Hardy-Weinberg equation predicts the frequency of each genotype (the specific pair of alleles an individual carries):
- p² = frequency of individuals with two copies of A (homozygous dominant)
- 2pq = frequency of individuals with one copy of each (heterozygous, or carriers)
- q² = frequency of individuals with two copies of a (homozygous recessive)
Together: p² + 2pq + q² = 1. Using our example numbers, p² = 0.49 (49% of the population would be AA), 2pq = 0.42 (42% would be Aa), and q² = 0.09 (9% would be aa).
A Worked Example With a Recessive Trait
The equation becomes especially useful when you can only observe the recessive trait directly. Imagine a recessive condition that affects 1 in 2,500 people. Those affected individuals have two copies of the recessive allele, so q² = 1/2,500 = 0.0004. Taking the square root gives you q = 0.02, meaning 2% of the alleles in the population are the recessive version.
Since p + q = 1, the dominant allele frequency is p = 0.98. Now you can estimate the carrier frequency: 2pq = 2 × 0.98 × 0.02 = 0.0392, or roughly 1 in 25 people. That’s the power of the equation. From one observable number (how many people show the recessive trait), you can estimate an invisible number (how many people silently carry one copy).
How It’s Used in Genetics and Medicine
Estimating carrier frequencies for genetic diseases is one of the most practical applications. If you know how common a recessive condition like cystic fibrosis or sickle cell disease is, the Hardy-Weinberg equation lets you estimate how many people in the population carry a single copy of the gene without showing symptoms. This is valuable for genetic counseling, public health planning, and screening programs.
Large genomic studies also use Hardy-Weinberg equilibrium as a quality control tool. When researchers sequence DNA from thousands of people, they check whether each genetic variant follows the expected equilibrium proportions. A variant that deviates sharply from expectations may signal a genotyping error, not a biological finding. The HapMap Project, a major catalog of human genetic variation, uses an exact statistical test with a significance threshold of p > 0.001 to filter out potentially unreliable data points.
That said, genuine biological causes can also produce deviations. In one example from a large genomic dataset, a sickle cell variant appeared in a heterozygous (carrier) state in about 9% of African individuals, roughly 2.5 times the number predicted by the equation given the count of homozygous individuals. That kind of excess of carriers is a hallmark of balancing selection, where carrying one copy of an allele provides a survival advantage (in this case, resistance to malaria) even though two copies cause disease.
What Pushes a Population Out of Equilibrium
When observed genotype frequencies don’t match what the equation predicts, one or more evolutionary forces are responsible. Each force leaves a different signature.
Natural selection changes allele frequencies because some genotypes survive or reproduce better than others. Over generations, advantageous alleles become more common and harmful ones become rarer. One interesting wrinkle: certain types of selection, like balancing selection, can maintain multiple alleles in a population at stable frequencies that still roughly match Hardy-Weinberg predictions for genotype proportions, even though selection is clearly acting.
Mutation introduces new alleles into the gene pool. On its own, mutation changes allele frequencies very slowly because mutation rates are low. But mutation supplies the raw material that other forces, especially selection, act upon.
Migration (also called gene flow) brings alleles into a population or removes them. If immigrants carry different allele frequencies than the resident population, the mix shifts.
Genetic drift is the random fluctuation in allele frequencies that happens in small populations. Flip a coin ten times and you might get seven heads. Flip it ten thousand times and you’ll land close to 50/50. The same logic applies to alleles being passed to the next generation. Small populations are more vulnerable to drift, which can cause alleles to disappear entirely or become fixed at 100% by chance alone.
Non-random mating doesn’t change allele frequencies directly, but it reshuffles which combinations of alleles end up in the same individual. Inbreeding, for instance, increases the proportion of homozygous individuals (people carrying two identical copies) beyond what the equation predicts, while leaving the overall allele frequencies unchanged.
How Scientists Test for Equilibrium
To check whether a population fits Hardy-Weinberg expectations, researchers compare observed genotype counts to the counts predicted by the equation. The most common statistical tool for this comparison is the chi-square goodness-of-fit test, which produces a single number reflecting how far the observed data fall from expected values. That number is compared against a chi-square distribution with one degree of freedom, and the resulting p-value tells you whether the difference is likely due to chance or signals a real departure.
In recent years, an alternative called Haldane’s exact test has gained popularity, particularly for large genomic datasets. The exact test calculates the probability of observing the data directly rather than relying on an approximation, making it more reliable when sample sizes are small or allele frequencies are extreme. Both tests answer the same fundamental question: is this population’s genetic composition consistent with no evolution at this particular gene?

