← All calculators

Hardy–Weinberg Calculator

Genotype counts → allele frequencies, expected counts and a chi-square equilibrium test; plus carrier frequency from the recessive phenotype frequency. The same math as the Excel workbook, live in your browser.

What this is for: Allele frequencies, expected genotype counts and a chi-square equilibrium test from genotype counts; carrier frequency from a recessive phenotype frequency.

The formula: p = (2×AA + Aa) ÷ 2N; expected AA = p²N, Aa = 2pqN, aa = q²N

How to use:

  1. In section A, enter the observed counts for AA, Aa and aa.
  2. Read N, p and q, and the expected AA, Aa and aa counts under equilibrium.
  3. Read the chi-square statistic, its p-value and the verdict — consistent with equilibrium only if p > 0.05.
  4. Optionally, in section B enter the recessive phenotype frequency (q²) to get q, p, the carrier frequency 2pq and the homozygous dominant frequency p², which assume equilibrium and do not test it.

A. From Genotype Counts

Enter observed genotype counts; allele frequencies, expected counts and a chi-square test (1 degree of freedom, legacy CHIDIST upper tail) follow.

Total individuals N
Allele frequency p (A)
Allele frequency q (a)
Expected AA under H–W
Expected Aa under H–W
Expected aa under H–W
Chi-square statistic (df = 1)
p-value
Verdict

B. From Recessive Phenotype Frequency

Starts from the recessive phenotype frequency (q²) and infers allele and carrier frequencies — this section assumes equilibrium.

q = sqrt(q²)
p = 1 − q
Carrier frequency 2pq
Homozygous dominant frequency p²
Prefer to work offline or keep a copy? The download link is right below.
Download the Hardy–Weinberg Calculator workbook (.xlsx)
Notes & limits (from the workbook): Section B ASSUMES equilibrium — it infers allele frequencies from one phenotype, so it cannot test anything. The test in Section A has df = 1 because p is estimated from the same data. Hardy–Weinberg assumes random mating, no selection/migration/mutation and large N.