HomeCalculatorsBiologyHardy-Weinberg Equilibrium Calculator

Hardy-Weinberg Equilibrium Calculator

Biology

Calculate genotype frequencies from allele frequency using the Hardy-Weinberg equation p² + 2pq + q² = 1. Get AA, Aa, and aa frequencies instantly.

0100

Heterozygous (Aa) — 2pq

48.00%
Recessive Allele Frequency (q)
40.00%
Homozygous Dominant (AA) — p²
36.00%
Homozygous Recessive (aa) — q²
16.00%

This calculator computes your Heterozygous (Aa) — 2pq, Recessive Allele Frequency (q), Homozygous Dominant (AA) — p², Homozygous Recessive (aa) — q² from the values you enter.

Inputs
Dominant Allele Frequency (p)
Outputs
Heterozygous (Aa) — 2pqRecessive Allele Frequency (q)Homozygous Dominant (AA) — p²Homozygous Recessive (aa) — q²

What is a Hardy-Weinberg?

The Hardy-Weinberg Equilibrium Calculator computes expected genotype frequencies from a given dominant allele frequency, using the classic population genetics equation p² + 2pq + q² = 1. Enter the dominant allele frequency (p), and the calculator instantly returns the recessive allele frequency (q) along with the homozygous dominant (p²), heterozygous (2pq), and homozygous recessive (q²) genotype frequencies.

This equation, developed independently by G.H. Hardy and Wilhelm Weinberg in 1908, is a cornerstone of population genetics — used both to predict genotype distributions in an idealized population and as a baseline to detect real evolutionary change. For predicting the outcome of a specific cross between two known parents, see the Punnett Square Calculator.

How to use this Hardy-Weinberg calculator

  1. Enter the dominant allele frequency (p) — as a percentage, representing the proportion of dominant alleles in the population's gene pool.

  2. Read the recessive allele frequency (q) — automatically computed as 1 − p.

  3. Read the genotype frequencies — homozygous dominant (p²), heterozygous (2pq), and homozygous recessive (q²), all expressed as percentages.

  4. Check the step-by-step breakdown — expand the calculation steps to see exactly how each frequency was derived from p.

Formula & Methodology

Hardy-Weinberg equation:
p² + 2pq + q² = 1, where p + q = 1

Variable definitions:
- p — frequency of the dominant allele (0 to 1)
- q — frequency of the recessive allele (1 − p)
-  — expected frequency of homozygous dominant genotype (AA)
- 2pq — expected frequency of heterozygous genotype (Aa)
-  — expected frequency of homozygous recessive genotype (aa)

Worked example:

If the dominant allele frequency p = 0.6 (60%):

q = 1 − 0.6 = 0.4 (40%)

p² = 0.6² = 0.36 (36% homozygous dominant)

2pq = 2 × 0.6 × 0.4 = 0.48 (48% heterozygous)

q² = 0.4² = 0.16 (16% homozygous recessive)

Note: This calculator assumes the five core Hardy-Weinberg conditions hold (no mutation, no migration, random mating, infinite population size, no natural selection). Real populations rarely satisfy all of these perfectly, so these results represent a theoretical equilibrium baseline rather than a guaranteed real-world outcome.

Frequently Asked Questions

The Hardy-Weinberg equation is p² + 2pq + q² = 1, where p is the frequency of the dominant allele and q is the frequency of the recessive allele in a population (p + q = 1). The three terms represent the expected frequencies of homozygous dominant (p²), heterozygous (2pq), and homozygous recessive (q²) genotypes at equilibrium.
A population is in Hardy-Weinberg equilibrium when allele and genotype frequencies remain constant across generations, which requires no mutation, no migration, random mating, an infinitely large population, and no natural selection. It serves as a theoretical baseline for detecting when evolution is (or isn't) occurring in a real population.
Since p and q are the only two alleles for this gene and must sum to 1, q = 1 − p. If the dominant allele frequency (p) is 0.6 (60%), then the recessive allele frequency (q) is 0.4 (40%) — this calculator computes q automatically from your entered p value.
2pq represents the heterozygous (carrier) frequency — individuals who carry one copy of the recessive allele without showing the recessive trait themselves. This is especially important in genetic counseling and public health, since carriers can still pass a recessive allele (e.g., for a genetic condition) to their offspring.
Allele frequency (p) is the proportion of all gene copies in the population that are the dominant allele, while genotype frequency (p²) is the proportion of individuals who are homozygous dominant (carry two copies). Squaring the allele frequency to get genotype frequency assumes random mating, a core Hardy-Weinberg assumption.
Yes — if you know the frequency of an observable recessive condition (q², the affected population percentage), you can take its square root to find q, then use 1 − q to find p, and finally 2pq to estimate what percentage of the population are unaffected carriers, a common application in medical genetics.
Deviations occur when any of the five key assumptions are violated: natural selection favoring certain genotypes, non-random mating (like assortative mating), genetic drift in small populations, migration introducing new alleles, or new mutations arising. Detecting such deviations is often the actual research goal when applying this equation to real populations.
No real population perfectly satisfies all five assumptions (infinite size, no mutation, no migration, random mating, no selection), so Hardy-Weinberg equilibrium is a theoretical idealization. It's most useful as a null hypothesis — a baseline to compare real population data against, to detect and quantify evolutionary forces at work.
A Punnett square predicts offspring outcomes for one specific cross between two known-genotype parents, while Hardy-Weinberg predicts genotype frequencies across an entire population based on allele frequencies. Try the [Punnett Square Calculator](/punnett-square-calculator/) for individual cross predictions.
Yes, though this calculator handles the standard two-allele case (p + q = 1). For genes with three or more alleles, the equilibrium equation expands to include cross-terms for every possible pairing, following the same underlying logic of squaring and cross-multiplying allele frequencies.
A classic example is estimating carrier frequency for cystic fibrosis: if about 1 in 2,500 people (0.04%) show the recessive phenotype, then q² = 0.0004, so q ≈ 0.02 and p ≈ 0.98, giving a heterozygous carrier frequency of 2pq ≈ 3.9% — far higher than the affected population percentage alone would suggest.
Comparing observed genotype frequencies in a real population against Hardy-Weinberg predicted frequencies is one of the most fundamental tests in population genetics — a significant deviation signals that evolutionary forces (selection, drift, migration, or non-random mating) are actively shaping that population's gene pool.
Also known as
p2 + 2pq + q2 calculatorallele frequency calculatorgenotype frequency calculatorHWE calculator