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.

Reviewed by the thecalcu.com team · Last updated July 27, 2026

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.

Why Use a Hardy-Weinberg Calculator?

Manually computing q, p², 2pq, and q² from a single allele frequency involves several dependent calculations, and errors compound quickly if any intermediate value is mistyped.

This calculator computes all four values instantly and consistently from a single input, and the step-by-step breakdown shows exactly how each genotype frequency was derived, useful for checking population genetics homework or estimating carrier frequencies for recessive genetic conditions.

Because the heterozygous (carrier) frequency 2pq is often the least intuitive of the three genotype frequencies, having it computed automatically avoids common errors like forgetting the factor of 2 in the cross term.

Who Should Use This Calculator?

Biology and genetics students verifying Hardy-Weinberg homework problems and population genetics coursework.

Public health and genetic counseling students estimating carrier frequencies for recessive genetic conditions from observed disease prevalence.

Ecology and evolutionary biology researchers establishing a theoretical baseline before testing real population data for signs of selection or drift.

Teachers demonstrating how allele frequencies translate into genotype frequencies under idealized conditions.

Science writers needing accurate reference figures for population genetics content.

What Insights Does This Calculator Give You?

Heterozygous (carrier) frequency (2pq), the primary result, often the most practically important figure since carriers can pass a recessive allele to offspring without showing the trait themselves.

Recessive allele frequency (q), automatically derived from the dominant allele frequency, since p + q must equal 1 in a two-allele system.

Full genotype distribution, seeing p², 2pq, and q² together (which must sum to 100%) makes it easy to verify your inputs and understand how allele frequency translates into population-level genotype composition.

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.

Show formula & methodology ↓Show less ↑

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

What is the Hardy-Weinberg equation?
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.
What does Hardy-Weinberg equilibrium actually mean?
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.
How do I find q if I know p?
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.
Why is 2pq often the most interesting result?
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.
How is allele frequency (p) different from genotype frequency (p²)?
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.
Can Hardy-Weinberg be used to estimate carrier frequency for genetic diseases?
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.
What causes a population to deviate from Hardy-Weinberg equilibrium?
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.
Is Hardy-Weinberg equilibrium ever perfectly true in nature?
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.
How does this relate to a Punnett square?
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.
Can Hardy-Weinberg be extended to more than two alleles?
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.
What's a real-world example of using Hardy-Weinberg?
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.
Why do population geneticists care about equilibrium versus disequilibrium?
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