Hardy-Weinberg Equilibrium Calculator
Calculate genotype frequencies from allele frequency.
The Hardy-Weinberg Population Genetics Calculator computes expected genotype frequencies from observed allele frequencies (and vice versa) for two-allele genetic loci, performing a Chi-square (χ²) goodness-of-fit test for genetic equilibrium.
Free, runs in your browser. Nothing you enter is uploaded.
How to use it
- Enter allele frequency (p or q).
- Genotype frequencies are calculated automatically.
What you enter
- Observed counts of individuals with genotype AA, Aa, and aa in a surveyed population sample
- Minimum sample size: N >= 20 individuals
What you get
- Dominant (p) and Recessive (q) Allele Frequencies
- Expected Hardy-Weinberg Genotype Proportions and Counts
- Chi-Square Test Statistic (χ²), p-value, and Equilibrium Determination (Equilibrium vs Disequilibrium)
Formula
p + q = 1 | p^2 (AA) + 2pq (Aa) + q^2 (aa) = 1 | χ^2 = Σ [ (Observed - Expected)^2 / Expected ]
Determines population genetic equilibrium for biallelic loci. Calculates allele frequencies: p = (2*N_AA + N_Aa) / (2*N_total) and q = 1 - p. Compares observed and expected counts via Chi-Square goodness-of-fit with 1 degree of freedom (critical value χ² = 3.841 at α = 0.05).
Example: Survey of 500 Animals for Coat Color Locus
Input: Observed Counts: AA = 320, Aa = 160, aa = 20 (Total N = 500)
Result: p(A) = 0.80 | q(a) = 0.20 | Expected: AA = 320, Aa = 160, aa = 20 | χ^2 = 0.000 (p = 1.00)
Observed genotype proportions perfectly match Hardy-Weinberg expectations (p=1.00). The locus is in genetic equilibrium with no evidence of selection or assortative mating.
Limitations
- Assumes a large, randomly mating diploid population with negligible mutation, migration (gene flow), and natural selection.
- Does not directly model sex-linked (X-linked) inheritance or polyallelic systems (>2 alleles) without locus parameter expansion.
References
- Hardy GH (1908) Science 28(706):49-50.
- Weinberg W (1908) Jahreshefte des Vereins für vaterländische Naturkunde in Württemberg 64:368-382.
Related reading
- Hardy-Weinberg Equilibrium in Population Genetics
- Phasing Accuracy & Haplotype Structure
- Sanger Sequencing Validation of Somatic Variants
More Genetics
- Punnett Square Calculator
- Horse Coat Color Calculator
- Hardy-Weinberg Calculator
- Blood Type Calculator
- Eye Color Calculator
All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.