PublicSoftTools

Hardy-Weinberg Equilibrium Calculator

Calculate allele and genotype frequencies using the Hardy-Weinberg equation p² + 2pq + q² = 1. Enter allele frequency p directly or calculate from observed genotype counts. Includes visual bar chart and verification. No signup, runs entirely in your browser.

q = 1 − p = 0.4000

Hardy-Weinberg Revision Tips

Start from the recessive phenotype

Exam questions usually give you the frequency of the recessive phenotype (e.g. "1 in 10,000 have albinism"). That frequency is q². Take the square root to get q, then p = 1 − q, and calculate the rest.

Remember p + q = 1

This constraint is separate from the genotype equation. Since there are only two alleles (A and a), their frequencies must sum to 1. Always check: if p = 0.7, then q must be 0.3.

Carrier frequency

The heterozygote (carrier) frequency 2pq is often the key result. For a rare recessive allele (small q), the carrier frequency 2pq is much larger than the q² frequency of affected individuals — this matters for genetic screening.

Testing HWE in practice

Real populations rarely meet all five HWE conditions simultaneously. Chi-squared tests compare observed genotype frequencies to HWE-predicted frequencies to determine whether the deviation is statistically significant.

Frequently Asked Questions

What is Hardy-Weinberg equilibrium?

Hardy-Weinberg equilibrium describes a theoretical population where allele frequencies remain constant generation to generation in the absence of evolution. It requires: no mutation, no migration, random mating, very large population, and no natural selection.

What is the Hardy-Weinberg equation?

p² + 2pq + q² = 1, where p is the frequency of the dominant allele (A) and q is the frequency of the recessive allele (a). p² represents homozygous dominant (AA) frequency, 2pq represents heterozygous (Aa) frequency, and q² represents homozygous recessive (aa) frequency.

How do I find p if I only know q²?

If you know the frequency of the recessive phenotype, that equals q² (since only aa individuals express it). Take the square root to get q, then p = 1 − q. This is the most common exam calculation.

When is a population NOT in Hardy-Weinberg equilibrium?

A population deviates from HWE when any of the five conditions are violated: natural selection acts on the trait, there is non-random mating (inbreeding or assortative mating), mutations occur, individuals migrate in or out, or the population is small (genetic drift occurs).

What does the "from genotype counts" mode do?

Enter the observed counts of homozygous dominant (AA), heterozygous (Aa), and homozygous recessive (aa) individuals. The calculator computes allele frequencies from these counts and then applies the HWE equation. This lets you test whether an observed population matches HWE predictions.

Is my data sent anywhere?

No. All calculations are performed locally in your browser.