Calculate allele and genotype frequencies using Hardy-Weinberg equilibrium. Supports observed counts, chi-square testing, and population genetics analysis.
The Hardy-Weinberg equilibrium (HWE) is the foundational model of population genetics. It predicts that allele and genotype frequencies in a population remain constant from generation to generation in the absence of evolutionary influences — no mutation, migration, selection, genetic drift, or non-random mating. While no real population satisfies all these conditions, HWE provides the null hypothesis against which evolution is measured.
For a gene with two alleles (A and a), if p = frequency of A and q = frequency of a, then p + q = 1 and the expected genotype frequencies are: p² (AA), 2pq (Aa), and q² (aa). This deceptively simple equation is the basis for calculating carrier frequencies of genetic diseases, predicting genotype frequencies from limited data, and testing whether a population is in equilibrium using chi-square analysis.
This calculator handles the three most common starting points: (1) known allele frequencies (p and q), (2) observed genotype counts, or (3) observed phenotype frequency of the recessive trait. It computes expected genotype frequencies, the chi-square statistic for HWE deviation, and carrier frequency — essential for genetic counseling, forensic genetics, and evolutionary biology coursework.
Understanding allele and genotype frequencies is essential for genetic counseling (carrier risk), evolutionary biology (detecting selection), forensic genetics (match probability), and conservation biology (monitoring genetic diversity). This calculator bridges the gap between raw population data and meaningful genetics analysis. This allele frequency calculator helps you compare outcomes quickly and reduce avoidable mistakes when making day-to-day care decisions. Use the estimate as a planning baseline and confirm final decisions with a qualified professional when risk is high.
p + q = 1 (allele frequencies). p² + 2pq + q² = 1 (genotype frequencies). Hardy-Weinberg expected: AA = p²N, Aa = 2pqN, aa = q²N. Chi-square = Σ[(O - E)² / E] with 1 degree of freedom (df = genotypes - alleles = 3 - 2 = 1).
Result: p = 0.60, q = 0.40, χ² = 208.3 (NOT in HWE)
p = (2×500 + 200) / (2×1000) = 0.60. Expected: AA = 0.36×1000 = 360, Aa = 0.48×1000 = 480, aa = 0.16×1000 = 160. χ² = (500-360)²/360 + (200-480)²/480 + (300-160)²/160 = 208.3 >> 3.84 critical value. Population departs significantly from HWE.
Genetic counselors use HWE daily. When a couple with no family history of cystic fibrosis asks about carrier risk, the counselor calculates: CF incidence ~1/2500 → q² = 0.0004 → q = 0.02 → carrier frequency 2pq ≈ 1/25. Each partner has a ~4% chance of being a carrier. The probability both are carriers: (1/25)² = 1/625. If both are carriers, 1/4 of children are affected: final risk = 1/2500 — which matches the population incidence, confirming the model's internal consistency. This reasoning extends to any autosomal recessive disease with known population frequency.
When observed genotype frequencies deviate significantly from HWE expectations, natural selection may be at work. Classic examples: the sickle cell allele (HbS) in malaria-endemic regions shows excess heterozygotes — heterozygote advantage maintains both alleles at frequencies far from what neutral drift would predict. Similarly, MHC/HLA genes show extreme heterozygote excess due to balancing selection. Comparing observed vs HWE-expected frequencies at multiple loci across the genome identifies loci under selection — a technique called genome-wide HWE scanning.
HWE assumes infinite population size, but real populations are finite and subject to genetic drift. The smaller the population, the more genotype frequencies fluctuate around HWE expectations by chance alone. For N < 50, random fluctuations can produce "significant" chi-square deviations even without selection or other evolutionary forces. In conservation genetics, departures from HWE in small populations are expected and inform management strategies: translocations to restore gene flow, genetic rescue programs, and minimum viable population estimates.
It means one or more evolutionary forces are acting: natural selection against certain genotypes, non-random mating (inbreeding or assortative mating), genetic drift (in small populations), gene flow from other populations, or mutation. The chi-square test identifies departure but not the specific cause — additional analysis is needed.
For autosomal recessive diseases, disease incidence = q² (frequency of homozygous recessive). Take the square root to get q, then p = 1 - q. Carrier frequency = 2pq. Example: cystic fibrosis affects ~1/2500 Caucasians, so q² = 0.0004, q = 0.02, p = 0.98, carrier frequency = 2(0.98)(0.02) = 0.0392 or ~1 in 25.
For a standard biallelic HWE test with 1 degree of freedom, the critical value at α = 0.05 is 3.84. A chi-square statistic above 3.84 means the population significantly departs from HWE at the 5% significance level. At α = 0.01, the critical value is 6.63.
Yes. For three alleles (p + q + r = 1), genotype frequencies expand to six genotypes. The ABO blood group system with alleles IA, IB, and i uses this multiallelic extension. This calculator focuses on the two-allele case which covers most genetics applications.
Inbreeding increases homozygosity and decreases heterozygosity. With inbreeding coefficient F, genotype frequencies become: AA = p² + Fpq, Aa = 2pq(1-F), aa = q² + Fpq. A positive F indicates excess homozygotes — a common deviation from HWE in small or isolated populations.
Forensic DNA profiling uses HWE to calculate the probability of a random match. The match probability for each locus depends on genotype frequency (p² for homozygotes, 2pq for heterozygotes), assumed under HWE. If a population isn't in HWE, match probabilities may be inaccurate.