QwikCalculator

Hardy-Weinberg Calculator

Allele frequencies

Choose what you know and enter its value as a decimal between 0 and 1.

Assumes a large population with random mating, no mutation, no migration and no selection. Frequencies are decimals, so 4% is 0.04.

About the Hardy-Weinberg Calculator

The Hardy-Weinberg principle describes what happens to gene frequencies in a population that isn’t evolving. If you know how common one trait is, the equation lets you work out how common each allele and genotype is, including carriers who show no sign of the trait.

This Hardy-Weinberg calculator starts from whichever value you know: the frequency of the recessive phenotype (q²), the recessive allele (q), the dominant allele (p) or the dominant homozygotes (p²). It finds p, q and the three genotype frequencies, and if you add a population size, the expected number of each genotype.

How to use the Hardy-Weinberg Calculator

  1. Choose which frequency you know.
  2. Enter it as a decimal between 0 and 1. For 4%, enter 0.04.
  3. Optionally enter a population size.
  4. Read p and q, the genotype frequencies and the expected counts.

Hardy-Weinberg equations

  • p + q = 1
  • p² + 2pq + q² = 1
  • q = √(q²) when the recessive phenotype frequency is known
  • p² = AA, 2pq = Aa (carriers), q² = aa

p is the frequency of the dominant allele and q is the frequency of the recessive allele.

Hardy-Weinberg examples

If 4% of a population shows a recessive trait, q² = 0.04, so q = 0.2 and p = 0.8. Then p² = 0.64 (64% AA), 2pq = 0.32 (32% carriers) and q² = 0.04 (4% aa). In a population of 1,000 that is 640 AA, 320 Aa and 40 aa.

A recessive condition affecting 1 in 2,500 people has q² = 0.0004, so q = 0.02. The carrier frequency 2pq is 3.92%, which is about 1 in 26 people.

The five assumptions

  • A very large population, so chance changes in frequency (genetic drift) are tiny.
  • Random mating, with no preference for certain genotypes.
  • No mutation changing one allele into another.
  • No migration of individuals in or out of the population.
  • No natural selection favouring any genotype.
  • If a population’s genotype counts differ a lot from Hardy-Weinberg predictions, one of these assumptions is probably being broken, which is evidence that evolution is happening.

Frequently asked questions

What is the Hardy-Weinberg equation?

p² + 2pq + q² = 1, where p and q are the frequencies of the two alleles and p + q = 1.

How do I find the carrier frequency?

Work out q from the frequency of the recessive phenotype (q = √q²), then p = 1 − q, and carriers are 2pq.

Why start from the recessive phenotype?

Because only aa individuals show the recessive trait, their frequency q² is the one you can count directly. The carriers are hidden.

Should I enter a percentage or a decimal?

A decimal between 0 and 1. For 4%, enter 0.04.

Does it work for genes with more than two alleles?

Not with this calculator. It models one gene with a dominant and a recessive allele.