Hardy-Weinberg Law: Principle, Equation, and Uses
By Dr. Zubair Khalid, DVM, MS, PhD ·

The Hardy-Weinberg law states that in a large, randomly mating population with no selection, mutation, or migration, allele frequencies and genotype frequencies stay constant from one generation to the next. It is the null model of population genetics: the baseline you compare real data against to find out whether something interesting is happening.
That baseline matters because almost every practical question in genetics is a question about change. Is a disease allele becoming more common? Did a genotyping assay fail? Is a population split into subgroups that marry within themselves? The Hardy-Weinberg principle gives you a way to answer those questions with simple arithmetic. You count alleles, predict what the genotype frequencies should be, and then check whether the observed numbers match. When they do not match, the direction and size of the mismatch point toward a specific cause.
What the Hardy-Weinberg Principle Actually Says
The principle rests on a single idea. If mating is random with respect to a genetic locus, then the alleles present in a population behave like marbles drawn from a bag. Each offspring inherits one allele from each parent, and the probability of any particular combination is just the product of the two allele frequencies. That is the whole engine of the model.
Two researchers, Godfrey Hardy and Wilhelm Weinberg, reached this conclusion independently in 1908. Their insight resolved a puzzle that had bothered biologists: why do dominant traits not simply spread until everyone shows them? The answer is that allele frequencies do not change just because one allele is dominant. Dominance affects how a genotype looks, not how often the allele is transmitted.
The model applies to a single locus with two alleles. Call them A and a. Every individual carries two copies, so there are three possible genotypes: AA, Aa, and aa. The model predicts the frequency of each from the allele frequencies alone.
The Two Equations
Two equations carry the entire framework.
p + q = 1
Here p is the frequency of one allele (conventionally the dominant or reference allele) and q is the frequency of the other. Because there are only two alleles at this locus, their frequencies must sum to 1. If p is 0.7, then q is 0.3.
p² + 2pq + q² = 1
Here p² is the predicted frequency of the AA homozygote, 2pq is the predicted frequency of the Aa heterozygote, and q² is the predicted frequency of the aa homozygote. The three genotype frequencies sum to 1.
A homozygote is an individual carrying two identical alleles at a locus. A heterozygote carries two different alleles. The 2 in front of pq appears because there are two ways to make a heterozygote: inherit A from the mother and a from the father, or the reverse. Those two paths have the same probability, pq, and they add together.
Why the Equation Squares and Doubles
The algebra is just probability. If the chance of drawing allele A from the gene pool is p, the chance of drawing it twice in a row is p × p, which is p². The same logic gives q² for the aa homozygote. The heterozygote combines one of each, and because order does not matter, both orders count, giving 2pq.
This is why the model is sometimes described as a product of allele frequencies. Nothing about the organism changes the math. The genotype frequencies are a direct consequence of how alleles are shuffled during reproduction.
A Worked Example: q = 0.3
Numbers make the principle concrete. Suppose a locus has two alleles, and the frequency of the recessive allele a is q = 0.3.
Step 1. Find p. Because p + q = 1, p = 1 - 0.3 = 0.7.
Step 2. Predict the homozygote frequencies.
- AA frequency = p² = 0.7 × 0.7 = 0.49
- aa frequency = q² = 0.3 × 0.3 = 0.09
Step 3. Predict the heterozygote frequency.
- Aa frequency = 2pq = 2 × 0.7 × 0.3 = 0.42
Step 4. Check that the parts sum to one.
0.49 + 0.42 + 0.09 = 1.00
So in a population of 1,000 individuals at Hardy-Weinberg equilibrium with q = 0.3, you would expect about 490 AA, 420 Aa, and 90 aa individuals.
Notice something useful about rare recessive alleles. The heterozygote frequency, 2pq, is much larger than the homozygote frequency, q², when q is small. If q = 0.01, then q² = 0.0001 and 2pq ≈ 0.0198. Almost all copies of a rare recessive allele sit in carriers who show no sign of it. This is the arithmetic behind carrier screening for autosomal recessive conditions, where the goal is to find the healthy heterozygotes who could pass a variant to a child [1].
Genotype Frequencies for Different Allele Frequencies
The table below shows how the three genotype frequencies shift as q changes. Read it as a reference for checking your own calculations.
| q (recessive allele) | p (dominant allele) | p² (AA) | 2pq (Aa) | q² (aa) |
|---|---|---|---|---|
| 0.1 | 0.9 | 0.81 | 0.18 | 0.01 |
| 0.2 | 0.8 | 0.64 | 0.32 | 0.04 |
| 0.3 | 0.7 | 0.49 | 0.42 | 0.09 |
| 0.4 | 0.6 | 0.36 | 0.48 | 0.16 |
| 0.5 | 0.5 | 0.25 | 0.50 | 0.25 |
| 0.6 | 0.4 | 0.16 | 0.48 | 0.36 |
| 0.7 | 0.3 | 0.09 | 0.42 | 0.49 |
Heterozygote frequency peaks at q = 0.5, where half the population is heterozygous. Rare alleles spend most of their time in heterozygotes, and common alleles spend most of their time in homozygotes.
The Five Assumptions
The Hardy-Weinberg principle holds only when five conditions are met. Each assumption maps to a real biological force, and each violation leaves a recognizable signature.
- No selection. All genotypes survive and reproduce equally well. If one genotype leaves more offspring, its allele frequency rises and the equilibrium breaks.
- No mutation. Alleles do not change from one form to another. Mutation introduces new alleles and slowly shifts frequencies.
- No migration. No individuals move in or out of the population. Gene flow from another population can pull allele frequencies in a new direction.
- Infinite population size. The population is large enough that random chance does not shift allele frequencies. Real populations are finite, so sampling error causes drift.
- Random mating. Individuals pair without regard to genotype at the locus in question. Assortative mating and inbreeding both violate this condition.
These assumptions are idealized. No natural population meets all five at once. That is the point. The Hardy-Weinberg law is a null hypothesis, a benchmark of what you would see if nothing interesting were happening. When observed genotype frequencies depart from the prediction, the departure is evidence that at least one assumption fails.
What Each Assumption Protects Against
Each assumption blocks a specific mechanism of change.
- Selection and mutation change allele frequencies directly.
- Migration imports alleles from elsewhere.
- Finite population size causes genetic drift, the random fluctuation of allele frequencies across generations.
- Non-random mating changes genotype frequencies without necessarily changing allele frequencies.
That last point is subtle and worth holding onto. Inbreeding, for example, increases the proportion of homozygotes and decreases heterozygotes, but it does not by itself change p or q. The allele frequencies stay put while the genotype frequencies shift. This is why tests of Hardy-Weinberg equilibrium can detect inbreeding even when allele frequencies look stable.
What Deviations Indicate
A deviation from Hardy-Weinberg equilibrium, often written as HWD for Hardy-Weinberg disequilibrium, is a signal. The signal has several possible sources, and the direction of the deviation helps narrow them down.
Excess Heterozygotes
More heterozygotes than expected can point to:
- Negative assortative mating, where unlike genotypes pair more often than chance.
- Heterozygote advantage, where heterozygotes survive or reproduce better than either homozygote.
- Population substructure with mixing, where two previously separated populations with different allele frequencies come together and their offspring appear heterozygous.
- Genotyping error, particularly when alleles are miscalled as heterozygous.
Deficit of Heterozygotes
Fewer heterozygotes than expected (equivalently, an excess of homozygotes) can point to:
- Inbreeding, which raises homozygosity across the genome.
- Positive assortative mating, where similar genotypes pair.
- Population stratification, where a sample combines subgroups that each mate internally.
- Null alleles or allele dropout, technical failures that make a true heterozygote look homozygous.
A clear real-world example comes from a study of the APOE gene in an Angolan population sample, where significant Hardy-Weinberg disequilibrium appeared as an excess of ε4 homozygotes and a deficit of certain heterozygotes [2]. The authors discussed population structuring, convenience sampling, and genotyping as candidate explanations. That is the typical reasoning: the deviation is a clue, and you work through the plausible causes.
Why Direction Matters
The magnitude of a deviation tells you how far the population is from equilibrium. The direction tells you which force is likely responsible. A heterozygote deficit across many independent loci usually means inbreeding or stratification rather than selection at each locus. A deviation at a single locus in a sample that is otherwise clean often points to a genotyping problem. Reading the pattern across many markers is more informative than reading one marker alone.
How Hardy-Weinberg Is Tested in Practice
Testing for Hardy-Weinberg equilibrium is routine in genetics. The steps are consistent across studies.
- Genotype the samples at the locus of interest.
- Count the observed numbers of each genotype.
- Estimate allele frequencies from the genotype counts.
- Compute the expected genotype frequencies under Hardy-Weinberg.
- Compare observed and expected counts with a statistical test.
The Statistical Tests
Two tests dominate. The chi-square goodness-of-fit test compares observed and expected genotype counts and works well with large samples. The exact test, often associated with Wigginton, computes the probability of the observed genotype counts under Hardy-Weinberg without relying on the chi-square approximation, which makes it better for small samples or rare alleles.
A study of HIV-associated genes in the Mizo population of Northeast India used the Wigginton exact test with Bonferroni correction to assess Hardy-Weinberg equilibrium across thousands of variants [3]. Bonferroni correction adjusts the significance threshold when many tests run at once, reducing false positives. This is standard practice in genome-wide work, where thousands of markers are tested simultaneously.
Quality Control and Sex-Aware Analysis
In genome-wide association studies, Hardy-Weinberg testing is a quality-control filter. Markers that deviate strongly from equilibrium in controls are often flagged as genotyping errors and removed before analysis [4]. The logic is that a real biological deviation is usually small, while a technical artifact can produce a large one.
Recent work has refined this practice. A 2026 study using telomere-to-telomere aligned whole genome sequencing data from 2,490 individuals in the 1000 Genomes Project examined sex-specific deviations from Hardy-Weinberg equilibrium across five super-populations [5]. At a genome-wide significance threshold, 0.9% of autosomal SNPs showed significant deviations, and most of these tracked with genomic features indicating poor sequence quality. Restricting the analysis to reliable genomic regions reduced the count substantially. The lesson is that many apparent deviations are artifacts of sequence quality rather than biology, and sex-aware analysis can separate the two.
Testing in Cases and Controls
A common convention is to test Hardy-Weinberg equilibrium in controls only, on the assumption that cases may deviate because the disease is associated with the locus. A 2024 analysis challenged that convention for co-dominant markers. Under a co-dominance model, the genotype distribution is in Hardy-Weinberg equilibrium among controls if and only if it is also in equilibrium among cases [6]. The practical recommendation is to test both groups and combine the results, rather than testing controls alone. This matters for how association studies are designed and interpreted.
Uses of the Hardy-Weinberg Principle
The principle earns its place in genetics because it does real work in several settings.
Estimating Carrier Frequencies
For autosomal recessive conditions, affected individuals are homozygous for a pathogenic variant, and their frequency in the population approximates q². From that, you can estimate q and then the carrier frequency 2pq. A screening study in a Peruvian pediatric cohort applied Hardy-Weinberg assumptions to estimate the expected frequency of affected individuals from observed carrier data [1]. This kind of calculation underpins carrier screening programs, where the goal is to identify couples at risk before an affected child is born.
Quality Control in Genotyping
Hardy-Weinberg testing catches genotyping errors. A cluster of markers that deviate from equilibrium in a way that suggests heterozygote deficiency often signals allele dropout or a poorly designed assay. Removing those markers improves the reliability of downstream analysis [4].
Detecting Population Stratification
When a sample is drawn from a population with hidden subgroups, the combined genotype frequencies can deviate from Hardy-Weinberg expectations. Testing for equilibrium across many markers helps detect this stratification, which is a major confounder in association studies [4]. If cases and controls come from different subgroups with different allele frequencies, an apparent association can be spurious.
Estimating Penetrance and Testing Association
Hardy-Weinberg principles feed into estimates of penetrance, the probability that a genotype produces a phenotype, and into tests of association between markers and disease [4]. The equilibrium model provides the expected genotype distribution against which observed case and control distributions are compared.
Population Genetics and Conservation
Beyond human genetics, Hardy-Weinberg calculations describe genetic diversity in animal populations. A study of Zambian indigenous cattle used microsatellite markers and reported heterozygote deficits and genetic differentiation among breeds, with a global deficit of heterozygotes of 4.2% [7]. Those statistics rest on the same equilibrium framework. Deviations from Hardy-Weinberg expectations in livestock or wildlife signal inbreeding, substructure, or selection, all of which matter for breeding programs and conservation.
Pharmacogenomics and Population-Specific Frequencies
Pharmacogenomic studies report allele and genotype frequencies for variants that affect drug response, and Hardy-Weinberg testing is part of the quality check. A study of clinically relevant pharmacogenomic variants in Kazakh, Russian, and Uzbek populations in Kazakhstan analyzed genotype counts and carrier proportions across 112 directly genotyped variants [8]. Reliable frequency estimates depend on confirming that the genotype data are consistent with Hardy-Weinberg expectations.
Common Mistakes and Limitations
Several errors come up repeatedly when students and researchers work with this principle.
Assuming equilibrium means no evolution. Hardy-Weinberg equilibrium describes a population that is not evolving at that locus. Equilibrium is the absence of change, not evidence that change is impossible. A population at equilibrium today can drift away tomorrow if conditions shift.
Confusing allele and genotype frequencies. Allele frequencies describe the gene pool. Genotype frequencies describe individuals. The model links them, but they are not the same thing. A common slip is to treat p as the frequency of the AA genotype, which it is not.
Forgetting that the model is per locus. The Hardy-Weinberg law applies to one locus with two alleles at a time. Multi-allelic loci and multi-locus interactions need extensions. Linkage between loci and epistasis fall outside the simple two-allele model.
Ignoring sample size. Small samples produce noisy genotype counts, and a chi-square test on a small sample can be unreliable. The exact test is preferred when samples are small or alleles are rare.
Reading too much into one deviation. A single marker that deviates from equilibrium in a large study is often a technical artifact rather than a biological signal. Context matters. A deviation that appears across many markers, or that has a consistent direction, is more meaningful than an isolated one.
Overlooking that selection can fluctuate. Selection is not always constant. A modeling study of fluctuating selection showed that allele frequencies can oscillate over time when the selective environment changes periodically, and that spectral analysis can detect these oscillations even under complex regimes [9]. A population sampled at one time point may look like it is at equilibrium while it is actually mid-oscillation.
Treating Hardy-Weinberg as a law of nature. It is a mathematical consequence of the assumptions, not a force that acts on populations. When the assumptions fail, the prediction fails, and that failure is informative.
For any individual case in a clinical or breeding context, a qualified professional should interpret the genotype data, because the causes of a deviation are not always distinguishable from the numbers alone.
Quick Review
- The Hardy-Weinberg law predicts that allele and genotype frequencies stay constant in a large, randomly mating population with no selection, mutation, or migration.
- The two equations are p + q = 1 and p² + 2pq + q² = 1.
- If q = 0.3, then p = 0.7, AA = 0.49, Aa = 0.42, and aa = 0.09.
- The five assumptions are no selection, no mutation, no migration, infinite population size, and random mating.
- Deviations from equilibrium point to selection, drift, non-random mating, migration, mutation, or genotyping error.
- Heterozygote excess and heterozygote deficit have different likely causes, so the direction of the deviation matters.
- The model applies to a single locus with two alleles and serves as the null hypothesis in population and association genetics.
Frequently Asked Questions
What is the Hardy-Weinberg law in simple terms?
The Hardy-Weinberg law says that in a large, randomly mating population with no evolutionary forces acting, allele frequencies and genotype frequencies do not change from generation to generation. It provides the baseline against which real populations are compared.
What are the five assumptions of Hardy-Weinberg equilibrium?
The five assumptions are no selection, no mutation, no migration, infinite population size, and random mating. When any of these fails, genotype frequencies can depart from the prediction.
How do you calculate genotype frequencies from allele frequencies?
Use p + q = 1 to find the second allele frequency, then p² for one homozygote, 2pq for the heterozygote, and q² for the other homozygote. For q = 0.3, p = 0.7, so AA = 0.49, Aa = 0.42, and aa = 0.09.
What does it mean if a population is not in Hardy-Weinberg equilibrium?
A deviation means at least one assumption is violated. The cause could be selection, mutation, migration, genetic drift, non-random mating, population stratification, or a genotyping error. The direction of the deviation helps identify which.
Why is the Hardy-Weinberg principle useful in genetic studies?
It is used for quality control of genotype data, to estimate carrier frequencies for recessive diseases, to detect population stratification, and to test for association between markers and traits.
Does Hardy-Weinberg equilibrium mean a population is not evolving?
Yes, at that locus. Hardy-Weinberg equilibrium describes a population in which allele frequencies are stable, which means no evolution is occurring at that specific locus under the model's assumptions.
Related Articles
- Generalized Estimating Equations (GEE) in Life Sciences
- Single-Use Bioreactors: Principles, Applications, and Best Practices
- Nano-300 Nanodrop: Principle, Use, and Pitfalls for Students
- Ab Initio Protein Structure Prediction: Principles, Challenges, and When to Use It
- Veterinary Law: Legal Issues in Animal Health Practice
- Biosafety Cabinet Principles: How They Work and How to Use Them Effectively
- Atomic Absorption Spectroscopy: Principle and Uses
- Meclizine Side Effects and Uses in Pets
Sources
- Carrier frequency of autosomal recessive monogenic disorders in the peruvian population.
- Apolipoprotein E (APOE) Allele Frequencies and Genotypic Distribution in Huambo, Angola.
- Whole-exome characterization of host genetic variation in HIV-associated genes across the high-prevalence Mizo population, Northeast India.
- Calculation and use of the Hardy-Weinberg model in association studies.
- Assessing Hardy-Weinberg equilibrium in T2T-aligned 1000 genomes project.
- Implications of the Co-Dominance Model for Hardy-Weinberg Testing in Genetic Association Studies.
- Genetic Diversity and Population Structure of Zambian Indigenous Cattle.
- Clinically Relevant Pharmacogenomic Variant Frequencies in Kazakh, Russian, and Uzbek Population Groups Residing in Kazakhstan.
- Dissecting fluctuating selection: A unified population and quantitative genetics framework.