Hardy-Weinberg Allele Frequency Calculator
Enter an allele frequency or an observed genotype frequency to solve the Hardy-Weinberg equations p+q=1 and p²+2pq+q²=1 for the rest. Two 3D diagrams compare a population near equilibrium to one with a rare recessive allele, and charts show how genotype frequencies shift as allele frequency changes.
Reviewed by the ToolNestr Editorial Team — July 2026
Allele pools compared
1. Both alleles common (p≈q≈0.5)
Dominant (indigo) and recessive (amber) alleles are roughly balanced in the population pool.
2. Recessive allele rare (q small)
Very few recessive alleles (amber) among a majority of dominant alleles (indigo) — most copies of the recessive allele exist in heterozygous carriers.
Hardy-Weinberg graphs
How it works
The core idea in one line: if a population's mating is truly random and no evolutionary forces are acting on a gene, the frequencies of its genotypes settle into a fixed, predictable relationship with the underlying allele frequencies — any real deviation from that prediction is a signal that evolution is actually happening.
p + q = 1
allele frequencies for a two-allele gene must sum to 1
p² + 2pq + q² = 1
genotype frequencies — p²=homozygous dominant, 2pq=heterozygous, q²=homozygous recessive
Since every individual carries exactly two alleles for a gene, and p and q are simply the overall population-wide frequencies of each allele, p+q=1 must hold by definition. Expanding (p+q)² algebraically gives p²+2pq+q²=1 — and because random mating means any two gametes combine independently, this expansion exactly predicts the frequency of each genotype: p² for homozygous dominant, 2pq for heterozygous (the cross term counts both possible parental origins), and q² for homozygous recessive.
Worked example 1 — finding carrier frequency for a recessive condition
Given: A recessive genetic condition appears in 9% of a population (q² = 0.09). Find the allele frequencies and the carrier (heterozygous) frequency.
Notice that carriers (42%) far outnumber affected individuals (9%) — a common and important insight when counseling families about recessive genetic conditions.
Worked example 2 — starting from a known allele frequency
Given: In a population, the recessive allele frequency is known to be q = 0.1. Find all genotype frequencies.
These three genotype frequencies (0.81+0.18+0.01) sum to exactly 1.00, confirming the calculation is internally consistent.
How carrier frequency changes with allele rarity
As the recessive allele becomes rarer, the gap between carrier frequency (2pq) and affected frequency (q²) grows dramatically.
| q (recessive allele) | Affected (q²) | Carriers (2pq) |
|---|---|---|
| 0.5 | 25% | 50% |
| 0.3 ★ | 9% | 42% |
| 0.1 | 1% | 18% |
| 0.01 | 0.01% | ~2% |
★ Reference row (worked example 1). For rare recessive conditions, carriers vastly outnumber affected individuals — this is why many genetic diseases seem to "skip generations."
Where Hardy-Weinberg calculations actually matter
🧬 Estimating carrier rates for genetic diseases
Public health researchers use Hardy-Weinberg calculations to estimate how many people in a population carry one copy of a disease allele, informing genetic screening program design.
🐄 Conservation genetics
Conservation biologists use deviations from Hardy-Weinberg equilibrium to detect inbreeding, genetic drift, or selection pressure in small or endangered populations.
🔬 Detecting natural selection
When a population's observed genotype frequencies significantly deviate from Hardy-Weinberg predictions, it signals that real evolutionary forces — like selection against a particular genotype — are actively at work.
📊 Population genetics research baseline
Hardy-Weinberg equilibrium serves as the fundamental null model against which every real population genetics study is compared, making it foundational to the entire field.
Common misconceptions
"A population in Hardy-Weinberg equilibrium is not evolving and never will."
Hardy-Weinberg equilibrium describes a snapshot under specific idealized conditions (no mutation, migration, drift, selection, random mating) — real populations rarely meet all these conditions perfectly, which is exactly why deviations from the prediction are used to detect real evolutionary change.
"If a disease affects 1% of a population, only 1% of people carry the allele."
For a recessive condition, the affected frequency is q² (only 1% in this example), but the carrier frequency 2pq is typically much higher — for q²=0.01, carriers make up about 18% of the population, far more than the affected 1%.
"p and q refer to two different genes."
p and q are the two allele frequencies for the SAME gene (one gene, two alternate alleles) — not two separate genes. Genes with more than two alleles require an extended version of the Hardy-Weinberg math.
"Hardy-Weinberg calculations require actually counting every individual's genotype."
One of the most useful features of Hardy-Weinberg math is that you only need to observe ONE genotype frequency (usually the recessive phenotype, since it directly reveals q²) to calculate every other allele and genotype frequency in the population.
Formula sources & further reading
The formulas here are standard, traceable to:
- • OpenStax, Biology 2e — Chapter 19, "Population and Community Ecology" / Chapter 20, "Evolution" (free, peer-reviewed). openstax.org
- • Klug, Cummings & Spencer, Concepts of Genetics — Chapter 25, Population Genetics.
- • Campbell & Reece, Biology — Chapter 23, The Evolution of Populations.
p+q=1; p²+2pq+q²=1. Assumes the five Hardy-Weinberg conditions (no mutation, migration, drift, selection; random mating). Results are rounded for display.
How to use this calculator
Pick your known value
Enter either an allele frequency (p or q) or an observed recessive phenotype frequency (q²).
Read all frequencies
Both allele frequencies and all three genotype frequencies solve instantly.
Interpret carrier rate
The 2pq value shows how common heterozygous carriers are, often surprisingly higher than the affected frequency.
Related tools
Frequently asked questions
What is the Hardy-Weinberg principle?
The Hardy-Weinberg principle describes allele and genotype frequencies in a population that is not evolving — one with no mutation, migration, genetic drift, or selection, and random mating. It provides a baseline (p²+2pq+q²=1) to detect when a population is actually evolving.
What do p and q represent?
p is the frequency of the dominant allele in the population, and q is the frequency of the recessive allele, where p+q=1 (they must add up to the whole population's alleles for that gene).
How do I find allele frequency from a recessive phenotype frequency?
Since only the homozygous recessive genotype (qq) shows the recessive phenotype, the observed frequency of that phenotype equals q² directly — take the square root to find q, then p=1−q.
What does 2pq represent?
2pq is the frequency of heterozygous individuals (carriers) in the population — they carry one copy of each allele but show the dominant phenotype since they're not homozygous recessive.
Why is the Hardy-Weinberg principle useful if real populations rarely meet all its assumptions?
It serves as a null hypothesis — by comparing predicted Hardy-Weinberg frequencies to actually observed frequencies, biologists can detect and measure real evolutionary forces (like selection or drift) acting on a population.