Hardy-Weinberg Calculator: Allele & Genotype Frequencies

Free Hardy-Weinberg calculator: allele frequencies p and q, genotype frequencies p², 2pq and q², carrier numbers, and a chi-square test from genotype counts.

Solve Hardy-Weinberg problems step by step. Start from the frequency of the recessive phenotype (q²), from an allele frequency, or from observed genotype counts, and get p, q, p², 2pq, q², the number of carriers, and a chi-square test for equilibrium.

Advertisement

Hardy-Weinberg equations

Allele frequencies p + q = 1 Genotype frequencies p² + 2pq + q² = 1 From recessive phenotype q = √(q²), p = 1 − q From counts p = (2 × AA + Aa) / (2 × N) Chi-square χ² = Σ (O − E)² / E, df = 1, critical value 3.841

Worked example: cystic fibrosis carriers

About 1 in 2,500 babies of European descent has cystic fibrosis, so q² = 0.0004 and q = √0.0004 = 0.02. Then p = 0.98 and the carrier frequency is 2pq = 2 × 0.98 × 0.02 = 0.0392, about 1 person in 25.

From counts: 360 AA, 480 Aa and 160 aa (N = 1,000) give p = (720 + 480) / 2,000 = 0.6. The expected numbers are 360, 480 and 160, so χ² = 0 and the population is in equilibrium.

Assumptions of Hardy-Weinberg equilibrium

AssumptionWhat breaks it
Large populationGenetic drift in small populations
Random matingInbreeding, assortative mating
No mutationNew alleles appearing
No migrationGene flow in or out
No natural selectionSome genotypes surviving or breeding better
Advertisement

Frequently asked questions

What do p and q stand for?

p is the frequency of the dominant allele and q is the frequency of the recessive allele. Together they add up to 1.

How do I find q from the recessive phenotype?

The recessive phenotype frequency equals q², so take its square root. If 4% show the trait, q = √0.04 = 0.2.

How do I calculate the frequency of carriers?

Carriers are heterozygotes, so their frequency is 2pq. Multiply by the population size for the number of carriers.

How do I test for Hardy-Weinberg equilibrium?

Enter the observed genotype counts. The calculator compares them with p²N, 2pqN and q²N using chi-square with 1 degree of freedom.

Why is there only 1 degree of freedom?

There are 3 genotype classes, minus 1 because the total is fixed, minus 1 because p was estimated from the data.

Related tools

Free educational tool by HawkInc. Results are calculated in your browser and rounded for display; check critical work by hand or with a second method.