Allele Frequency Calculator

Calculate allele and genotype frequencies using Hardy-Weinberg equilibrium. Supports observed counts, chi-square testing, and population genetics analysis.

q = 1 - p
p (dominant allele)
0.6000
Frequency of A
q (recessive allele)
0.4000
Frequency of a
Carrier Frequency (2pq)
48.00%
~1 in 2
AA Frequency (p²)
36.00%
Homozygous dominant
Aa Frequency (2pq)
48.00%
Heterozygous
aa Frequency (q²)
16.00%
Homozygous recessive

Genotype Distribution

AA (p²)
36.0%
Aa (2pq)
48.0%
aa (q²)
16.0%

Frequency Table (q from 0.05 to 1.00)

Show full allele frequency table
qpAA (p²)Aa (2pq)aa (q²)
0.050.9590.3%9.5%0.3%
0.100.9081.0%18.0%1.0%
0.150.8572.2%25.5%2.3%
0.200.8064.0%32.0%4.0%
0.250.7556.3%37.5%6.3%
0.300.7049.0%42.0%9.0%
0.350.6542.2%45.5%12.3%
0.400.6036.0%48.0%16.0%
0.450.5530.3%49.5%20.3%
0.500.5025.0%50.0%25.0%
0.550.4520.2%49.5%30.3%
0.600.4016.0%48.0%36.0%
0.650.3512.2%45.5%42.3%
0.700.309.0%42.0%49.0%
0.750.256.3%37.5%56.3%
0.800.204.0%32.0%64.0%
0.850.152.2%25.5%72.3%
0.900.101.0%18.0%81.0%
0.950.050.2%9.5%90.3%
1.000.000.0%0.0%100.0%
Planning notes, formulas, and examples

About the Allele Frequency Calculator

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.

When This Page Helps

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.

How to Use the Inputs

  1. Choose input mode: allele frequencies, genotype counts, or recessive phenotype frequency
  2. Enter the known values for your population data
  3. Review calculated allele frequencies (p and q)
  4. Check predicted genotype frequencies under HWE
  5. Compare observed vs expected with the chi-square test
  6. Use the carrier frequency for genetic counseling scenarios
  7. Explore the population size effect on drift deviations
Formula used
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).

Example Calculation

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.

Tips & Best Practices

  • The recessive phenotype frequency directly gives q² — the easiest entry point when genotyping data is unavailable
  • A significant chi-square doesn't mean HWE is "wrong" — it means your population has evolutionary forces at work
  • Small sample sizes (<50) make chi-square unreliable — use exact tests or increase sample size
  • For X-linked genes, male frequencies equal allele frequencies (hemizygous) while females follow HWE
  • Carrier frequency (2pq) peaks at p = q = 0.5 — its maximum value is 0.50 or 50%
  • Check for genotyping errors if HWE deviation is due to heterozygote deficit — null alleles are common culprits

Applications in Genetic Counseling

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.

Detecting Natural Selection

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.

Extensions and Limitations

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.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • 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.