ToolNestr

Hardy-Weinberg Equilibrium Checker

Test whether a population is in Hardy-Weinberg equilibrium by comparing its observed genotype counts to the counts predicted from allele frequencies, using a chi-square goodness-of-fit test. Two 3D diagrams compare a population matching equilibrium expectations to one clearly deviating from them, and charts show observed vs. expected counts side by side.

Reviewed by the ToolNestr Editorial Team — July 2026

Disclaimer: This tool is provided for educational purposes to support learning in biology. It is not a substitute for professional laboratory, clinical, or diagnostic use.
Biology

Enter observed genotype counts

GenotypeObservedExpected
Chi-square (χ²)
Conclusion (critical value 3.841)

Matching vs. deviating from equilibrium

1. Matches equilibrium

Observed genotype mix closely resembles the Hardy-Weinberg-predicted proportions.

2. Deviates from equilibrium

A noticeable excess of homozygotes — a classic inbreeding signature.

Equilibrium test charts

Observed vs. expected genotype counts
Chi-square value vs. the 3.841 critical threshold

How it works

The core idea in one line: if a population's real genotype counts closely match what its own allele frequencies predict under random mating, that agreement is itself evidence that no major evolutionary force is currently disturbing that gene — and a chi-square test turns 'closely match' from a gut feeling into a precise, defensible number.

p = (2×AA + Aa) / (2N)

dominant allele frequency estimated from observed genotype counts

Expected: p²N, 2pqN, q²N

Hardy-Weinberg-predicted genotype counts, using the estimated p and q

χ² = Σ(O − E)² / E

chi-square statistic — compare to 3.841 (1 df, α=0.05) to test equilibrium

Hardy-Weinberg equilibrium makes a specific, testable prediction: given a population's allele frequencies, genotypes should appear in the ratio p²:2pq:q². Estimating p and q directly from the observed data, then using them to calculate exactly how many of each genotype equilibrium would predict, gives a clean expected value to compare against what was actually counted. The chi-square statistic quantifies exactly how far the real data strays from that prediction, and comparing it to a standard critical value turns that comparison into a formal yes-or-no test: does this population's genetic makeup look the way undisturbed random mating alone would produce, or does something else — selection, inbreeding, drift, migration — appear to be at work?

Worked example 1 — a population matching equilibrium

Given: A population of 100 individuals: 64 AA, 32 Aa, 4 aa.

Allele frequencies: p = (2×64+32)/200 = 0.8, q = 0.2
Expected counts: p²(100)=64, 2pq(100)=32, q²(100)=4 — identical to observed
Result: χ² = 0 — a perfect match, the population is in Hardy-Weinberg equilibrium

This population was deliberately constructed to match equilibrium exactly, giving a chi-square of zero — real data almost never lands this cleanly, but small deviations are expected and don't necessarily fail the test.

Worked example 2 — a population showing inbreeding

Given: A population of 100 individuals: 70 AA, 10 Aa, 20 aa (an excess of homozygotes, a classic sign of inbreeding).

Allele frequencies: p = (2×70+10)/200 = 0.75, q = 0.25
Expected counts: p²(100)=56.25, 2pq(100)=37.5, q²(100)=6.25
Result: χ² ≈ 53.78, far exceeding 3.841 — this population significantly deviates from equilibrium

The stark excess of homozygotes and deficit of heterozygotes compared to expectation is the textbook chi-square signature of inbreeding within a population.

Interpreting the chi-square result (1 degree of freedom, α=0.05)

Compare your calculated chi-square value to the standard critical value.

Chi-square valueConclusion
0 (exact match) ★Perfectly matches Hardy-Weinberg equilibrium
< 3.841No significant deviation — consistent with equilibrium
≥ 3.841Significant deviation — population is not in equilibrium
53.78 (worked example 2)Strongly rejects equilibrium — some evolutionary force is acting

★ Reference row (worked example 1). The critical value of 3.841 comes from the standard chi-square distribution table at 1 degree of freedom and the conventional 0.05 significance threshold.

Where the equilibrium test actually matters

🧬 Detecting non-random mating

A population significantly failing the Hardy-Weinberg test with excess homozygotes is a classic signature geneticists use to detect inbreeding or other forms of non-random mating.

🏥 Genetic disease screening and epidemiology

Comparing observed disease-allele genotype frequencies to Hardy-Weinberg expectations helps researchers spot data errors, selection effects, or population substructure in genetic association studies.

🦁 Conservation genetics

Testing small, at-risk wildlife populations for Hardy-Weinberg deviations helps conservation biologists detect the genetic drift and inbreeding effects that often accompany a shrinking population.

🌾 Plant and animal breeding programs

Breeders check whether a captive or cultivated population still matches Hardy-Weinberg expectations to monitor for unintended selection pressures introduced by breeding practices.

Common misconceptions

"A population failing the Hardy-Weinberg test must have a genotyping error."

A real, significant deviation is just as likely to reflect real evolutionary or demographic processes — selection, non-random mating, migration, or genetic drift — as it is to reflect a data or measurement error; both possibilities should be considered.

"Hardy-Weinberg equilibrium means a population isn't evolving at all."

Hardy-Weinberg equilibrium is specifically defined per-gene, per-generation — a population can be in equilibrium for one gene while actively evolving at many others, and can even be in equilibrium for a gene despite other evolutionary forces acting on unrelated traits.

"A small chi-square value always confirms with certainty the population isn't evolving."

Failing to detect a significant deviation doesn't prove a population is truly in equilibrium — it may simply mean the sample size was too small to detect a small real deviation, or that only one generation was sampled when longer-term monitoring is needed.

"This test can be used with any number of alleles or genotype categories."

The standard 1-degree-of-freedom critical value applies specifically to a simple two-allele, three-genotype case — testing genes with more alleles or genotype categories requires recalculating the appropriate degrees of freedom and critical value.

Formula sources & further reading

The formulas here are standard, traceable to:

  • OpenStax, Biology 2e — Chapter 20, "Evolution" (free, peer-reviewed). openstax.org
  • Hartl & Clark, Principles of Population Genetics — Testing for Hardy-Weinberg equilibrium chapter.
  • Pearson (1900) — foundational chi-square goodness-of-fit test paper, Philosophical Magazine.

χ²=Σ(O−E)²/E, compared to 3.841 (1 df, α=0.05). Assumes a simple two-allele gene. Results are rounded for display.

How to use this calculator

1

Enter observed genotype counts

The number of AA, Aa, and aa individuals actually observed.

2

Review calculated expectations

Allele frequencies and Hardy-Weinberg-expected counts are computed automatically.

3

Read the equilibrium conclusion

Chi-square value and pass/fail result against the standard critical value.

Related tools

Frequently asked questions

What does it mean for a population to be "in Hardy-Weinberg equilibrium"?

It means the population's observed genotype counts closely match what's predicted from its allele frequencies under p²+2pq+q²=1 — a signal that the population isn't currently experiencing significant evolutionary forces like selection, non-random mating, or genetic drift for that gene.

How is the chi-square test used here?

The test compares each genotype's observed count to its Hardy-Weinberg-expected count using χ² = Σ(O−E)²/E, then compares that total to a critical value (3.841 for 1 degree of freedom at the standard 0.05 significance level) — exceeding it means the population significantly deviates from equilibrium.

Why does this test use 1 degree of freedom?

There are 3 genotype categories, giving 2 degrees of freedom initially, but 1 is used up estimating the allele frequency from the data itself — leaving 1 degree of freedom for the final test.

What does it mean if a population fails the equilibrium test?

A significant deviation suggests one of the Hardy-Weinberg assumptions is being violated — commonly non-random mating (like inbreeding, which increases homozygotes), natural selection, genetic drift in a small population, migration, or new mutation.

How is this different from the Hardy-Weinberg Allele Frequency Calculator?

That calculator solves for expected equilibrium frequencies given an assumed allele frequency. This tool instead takes real observed genotype counts and statistically tests whether they actually match Hardy-Weinberg expectations — a genuine hypothesis test, not just a prediction.

All tool categories

🧬 Biology (50 tools)
🔳 Punnett Square Calculator✖️ Dihybrid Cross Calculator⚖️ Hardy-Weinberg Allele Frequency Calculator🐄 Codominance Calculator🌸 Incomplete Dominance Calculator📊 Chi-Square Goodness of Fit Calculator (Genetics)🔗 Recombination Frequency Calculator🔬 Sex-Linked Trait Punnett Calculator📜 DNA to mRNA Transcription Tool🧩 mRNA to Protein Translation Tool📐 GC Content Calculator🌡️ DNA Melting Temperature (Tm) Calculator🔄 Reverse Complement Sequence Tool🧫 PCR Primer Annealing Temperature Calculator📦 Surface Area-to-Volume Ratio Calculator (Cell Size)📈 Exponential Population Growth Calculator🌱 Logistic Growth / Carrying Capacity Calculator🌍 Population Density Calculator🦋 Shannon Diversity Index Calculator🔑 Michaelis-Menten Enzyme Kinetics Calculator🔺 Trihybrid Cross Calculator🧮 Genotype Frequency Calculator🪢 DNA/RNA Base-Pairing Calculator📖 Codon Usage Calculator✂️ Restriction Enzyme Cut-Site Finder💧 DNA Concentration (A260) Calculator🔎 Microscope Magnification Calculator⏱️ Bacterial Growth Rate Calculator⏳ Generation (Doubling) Time Calculator🌊 Serial Dilution Calculator🥼 CFU per mL Calculator📉 Microbial Growth Curve Plotter⚡ Energy Pyramid / 10% Rule Calculator🏷️ Mark-Recapture Population Estimator🪵 Biomass Calculator💦 Osmosis/Tonicity Predictor🔁 Cell Doubling Time Calculator🌿 Speciation Rate Estimator📋 Hardy-Weinberg Equilibrium Checker🦎 Natural Selection Simulator🐺 Predator-Prey (Lotka-Volterra) Simulator⚗️ Protein Molecular Weight Calculator🧵 Amino Acid Sequence Analyzer🧴 pH-Enzyme Activity Simulator☀️ Photosynthesis Rate Calculator🫁 Cellular Respiration Equation Balancer🎲 Genetic Drift Simulator🔀 Mitosis Stage Identifier🌳 Pedigree Chart Analyzer🌲 Simple Phylogenetic Tree Builder
🌐 Networking & IP Tools (36 tools)
🧮 Everyday (26 tools)
💪 Health & Fitness (30 tools)
💰 Finance (34 tools)
🔢 Math (23 tools)
📄 PDF Tools (10 tools)
🎨 Creators (12 tools)
💻 Developers (24 tools)
⚡ Engineering & Science (24 tools)
⚛️ Physics (48 tools)
🧪 Chemistry (50 tools)
🏠 Construction & Home Improvement (105 tools)
👗 Clothing & Garment Tools (68 tools)
🍳 Cooking & Baking (9 tools)
🚗 Automotive (26 tools)
🖼️ Image Tools (13 tools)
🔐 Security & Hash (15 tools)
📝 Text Tools (15 tools)
🔍 SEO Tools (11 tools)
🔄 Converters (69 tools)
🕐 Time & Date (15 tools)
📊 Chart Generators (11 tools)
🕌 Islamic Tools (16 tools)