Hardy–Weinberg Calculator
Explore allele balance. Compare observed and expected genotypes.
Two alleles · Diploid autosomal model · Population-level estimates
Population & Inputs
Result
Estimated allele frequencies
From observed genotypes · p + q = 1
Expected genotype frequencies (HWE)
Expected genotype frequencies under HWE.
Equilibrium test
df = 1 · α = 0.05
This result does not identify its cause.
Minimum expected count: 12.96
Heterozygosity & test definition
Ho = 0.3200 · He = 0.4608 · F = 1 − Ho/He = 0.3056. F is a descriptive sample deficit/excess, not proof of individual inbreeding.
The exact HWE test conditions on observed allele counts and sums configurations no more probable than the observed one. It is two-sided and probability-ordered, with no mid-P adjustment. It is not Fisher’s 2×2 test. Pearson χ² uses df = 1 because one allele frequency is estimated from the sample. A monomorphic sample is not informative for this comparison.
Observed vs Expected Genotypes
| Genotype | Observed n | Expected n | Observed % | Expected % | χ² contribution |
|---|---|---|---|---|---|
| AA | — | — | — | — | — |
| Aa | — | — | — | — | — |
| aa | — | — | — | — | — |
| Total | 100 | 100.00 | 100.00% | 100.00% | 9.336 |
Expected counts remain fractional; values are rounded for display.
Genotype Distribution
Observed and expected percentages of individuals.
Allele balance
From alleles to a population
Conceptual genotype symbols; not chromosome anatomy or a sampled population image.
Explore Recessive Carrier Frequency
Separate illustrative example · Carrier Estimate mode
Assumes HWE and matching population prevalence; not an individual diagnosis.
This simplified example also assumes full penetrance and an effectively biallelic model. Different populations, multiple disease-causing alleles or incomplete penetrance can invalidate prevalence-based estimates.
Understanding the model
The Hardy–Weinberg principle describes genotype frequencies in a population under certain assumptions.
p² + 2pq + q² = 1
Assumptions (at the modeled locus)
- Random mating.
- Sufficiently large population.
- Negligible selection, migration and mutation.
A nonsignificant test does not prove equilibrium. A significant result does not identify why the sample differs from expectations.
Frequently asked questions
Why use df = 1?
For three genotypes, the total count imposes one constraint and estimating one allele frequency from the same counts uses another parameter: 3 − 1 − 1 = 1 degree of freedom. This implementation tests only observed counts with internally estimated allele frequencies.
When is an exact test preferable?
The χ² approximation can be unreliable with sparse expected counts or rare alleles, even when total N looks large. The two-sided exact test conditions on allele counts. Here, an expected count below 5 triggers a reminder. The browser exact calculation is limited to 200,000 minor-allele copies; larger datasets should use dedicated genetics software.
Can this predict an individual’s disease risk?
No. Carrier frequency is a population-level model based on the supplied prevalence and assumptions. Individual risk depends on genotype, family history, ancestry, variant interpretation and other factors. Discuss clinical questions with a qualified genetics professional.
Does a low P-value prove selection or mutation?
No. Genotyping error, population structure, relatedness, nonrandom sampling and other departures from assumptions can produce a signal. A single test does not identify a mechanism or demonstrate changes over time.
Why are expected counts fractional?
They are model expectations, not observed people. Multiplying N by p², 2pq and q² naturally produces fractional values. Statistics use unrounded expectations, and the table rounds only for display.
Can allele frequencies alone test equilibrium?
No. Allele frequencies generate theoretical genotype expectations. Testing requires observed genotypes and an appropriate sampling design. This calculator does not invent observations from expected values.
What happens at p = 0 or p = 1?
Only one allele is present in the sample or model. HWE expectations remain defined, but the sample contains no informative one-degree-of-freedom genotype comparison. A conditional exact P-value of 1 in a monomorphic sample does not verify equilibrium.
Are my sample data saved?
This module does not store or send sample labels or counts to a server. Copy and Download create a timestamped report only when requested. The separate carrier example is explicitly labeled and is not merged into the main sample analysis.
About this calculator
Hardy–Weinberg proportions assume random mating and the absence of major evolutionary forces. Observed populations may deviate.
Sources & References
Statistical methods: Wigginton et al. · HWE exact testing. Sources checked October 15, 2026. References do not imply review or endorsement.
Calculate expected genotype frequencies from an allele frequency under Hardy–Weinberg equilibrium.