Home/Calculators/Biology/Hardy-Weinberg Calculator

Hardy-Weinberg Calculator

Find the three genotype frequencies of a population in Hardy-Weinberg equilibrium from a single allele frequency.

hardy-weinberg-calculator
Result
—
In summary: Hardy-Weinberg equilibrium predicts genotype frequencies as p² + 2pq + q² = 1, where q = 1 − p. With p = 0.6, the homozygous dominant frequency p² = 0.36, heterozygous 2pq = 0.48, and homozygous recessive q² = 0.16.

The Hardy-Weinberg equation

For a gene with two alleles, the Hardy-Weinberg principle states p² + 2pq + q² = 1, where p is the dominant allele frequency and q = 1 − p is the recessive allele frequency. The three terms give the expected frequencies of the homozygous dominant, heterozygous, and homozygous recessive genotypes when a population is not evolving. The squared terms are just the probabilities of independent events combining, as the probability calculator sets out.

How to use this calculator

Enter the dominant allele frequency p as a decimal between 0 and 1. The tool computes q, then returns p², 2pq and q². If you only know genotype counts, find p first with the allele frequency calculator.

Worked example

Suppose p = 0.6, so q = 0.4. Then p² = 0.36, 2pq = 2 × 0.6 × 0.4 = 0.48, and q² = 0.16. These sum to 1.00, confirming the population is at equilibrium.

The heterozygote term peaks when p = q = 0.5, where 2pq reaches 0.5 — no population at equilibrium can be more than half heterozygous for a two-allele gene. For a single mating rather than a whole population, use the Punnett square calculator.

Frequently asked questions

What does Hardy-Weinberg equilibrium mean?
It describes a non-evolving population where allele and genotype frequencies stay constant across generations, assuming no selection, mutation, migration, drift, or non-random mating.
What are p and q?
p is the frequency of the dominant allele and q is the frequency of the recessive allele. Because there are only two alleles, p + q = 1.
What does 2pq represent?
2pq is the expected frequency of heterozygous individuals (one dominant and one recessive allele) in the population.
Do the three frequencies always add to 1?
Yes. p² + 2pq + q² is the expansion of (p + q)², and since p + q = 1, the genotype frequencies always total 1.
What if the observed genotypes do not match the prediction?
A mismatch is evidence that at least one equilibrium assumption is violated — selection, non-random mating, migration or drift may be acting. Biologists test this formally with a chi-square goodness-of-fit comparison between observed and expected counts.
How this tool works

The formula behind this tool is written out in full in the sections above, so you can check the maths yourself. Every calculator on Calculorium is verified against worked examples with automated tests before it is published, and pages are reviewed as formulas or standards change. Nothing you type is sent anywhere — the calculation runs entirely in your browser. Read how we build and check these tools.

Last updated: July 27, 2026 · Calculations run in your browser. Estimates for information only.