🔬
🔬 Science & engineering

Hardy-Weinberg Equilibrium Calculator

Results update as you type.

Your numbers

Understanding the Hardy-Weinberg equilibrium calculator — concept and principle

The Hardy-Weinberg principle predicts genotype frequencies in a population from its allele frequencies, assuming no evolutionary forces are acting. This calculator takes observed counts of the three genotypes AA, Aa and aa at one locus with two alleles, estimates the allele frequencies p and q, calculates the expected counts, and runs a chi-square goodness-of-fit test.

Hardy-Weinberg: allele frequencies predict genotype countsCounts of 360 AA, 480 Aa and 160 aa give 1,200 A alleles out of 2,000, so p = 0.6 and q = 0.4. Squaring gives expected shares 0.36, 0.48 and 0.16, exactly the observed 360, 480 and 160.From genotypes to allele shares and backAA360Aa480aa160Alleles: 2 × 360 + 480 = 1,200 A of 2,000p = 0.6q = 0.4A 0.6a 0.4AA0.36Aa0.24aA0.24aa0.16p² × 1,000AA 3602pq × 1,000Aa 480q² × 1,000aa 160Expected = observed → χ² = 0p-value 1: a perfect fit to equilibrium
p = 0.6 and q = 0.4 predict 360 : 480 : 160 — the same as observed, so χ² = 0.

How it is calculated

The principle

In a large, randomly mating population with no mutation, migration or selection, gametes combine like independent random draws. The chance of drawing A twice is p × p = p², of drawing a twice is q², and of drawing one of each is 2pq because it can happen in two orders. Since p + q = 1, the three frequencies add up to (p + q)² = 1. After one generation of random mating these proportions stay constant, which is the "equilibrium".

Worked example

  1. Counts: AA = 360, Aa = 480, aa = 160, so N = 1,000.
  2. p = (2 × 360 + 480) ÷ 2,000 = 1,200 ÷ 2,000 = 0.6; q = 0.4.
  3. Expected AA = 0.6² × 1,000 = 360; Aa = 2 × 0.6 × 0.4 × 1,000 = 480; aa = 0.4² × 1,000 = 160, giving 360, 480, 160.
  4. Every observed count equals its expected count, so χ² = 0.
  5. p-value = 1: the data fit Hardy-Weinberg proportions perfectly.
How p (A) changes with Count AAHow p changes with Count AA0.40.50.60.70.890180270360450540720Example: 0.6Count AA
Each point is the calculator re-run with only “Count AA” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Count AAp (A)
900.4520547945
1800.512195122
2700.5604395604
3600.6
4500.6330275229
5400.6610169492
7200.7058823529

How to read the result

With 1 degree of freedom, χ² above 3.84 corresponds to p < 0.05, and above 6.63 to p < 0.01. A small p-value means the genotype counts depart from expectation. An excess of homozygotes (fewer Aa than 2pqN) can point to inbreeding, population substructure or genotyping errors such as allele dropout; an excess of heterozygotes can point to selection or sample mixing. A large p-value does not prove equilibrium; it only means no departure was detected.

Common mistakes

Keep in mind: The model assumes one autosomal locus with two alleles, a large randomly mating population and no selection, mutation or migration.

Frequently asked questions

How do I get carrier frequency from disease incidence?

For a recessive condition, q ≈ √(incidence) and carrier frequency 2pq ≈ 2q when q is small.

Does Hardy-Weinberg mean allele frequencies never change?

It describes the null case without evolutionary forces. Real populations change; the test detects departures.

Why do GWAS pipelines filter SNPs on this test?

Strong departures in controls often signal genotyping errors, so those markers are removed.

Sources: G. H. Hardy, "Mendelian proportions in a mixed population", Science 28, 49–50 (1908) · J. E. Wigginton, D. J. Cutler and G. R. Abecasis, American Journal of Human Genetics 76, 887–893 (2005)

Checked 8 Nov 2026. Standard textbook formulas in SI units, computed in your browser. For learning and estimates — real designs must follow your local codes and be checked by a qualified engineer.

🔬 All science & engineering tools →🌍 Calculators by country →