Allele Frequency Calculator — Hardy–Weinberg Equilibrium
Given the frequency of the dominant allele (p) for a two-allele gene locus, this calculator applies the Hardy–Weinberg principle to derive the recessive allele frequency q = 1 − p and the expected frequencies of all three genotypes (AA, Aa, aa) in an idealized population at equilibrium.
q = 1 − p; p + q = 1 at Hardy–Weinberg equilibrium
- 1
Recessive allele frequency (q)
1 − 0.7 = 0.3 - 2
Homozygous dominant (AA = p²)
0.7² = 49 % - 3
Heterozygous (Aa = 2pq)
2 × 0.7 × 0.3 = 42 % - 4
Homozygous recessive (aa = q²)
0.3² = 9 %The square root of this frequency gives q, the carrier frequency for a recessive disease.
How does this calculator work?
Under Hardy–Weinberg equilibrium, if the dominant allele has frequency p, the recessive allele has q = 1 − p. Expected genotype frequencies are p² (AA homozygous dominant), 2pq (Aa heterozygous), and q² (aa homozygous recessive), with all three summing to 1. Useful for estimating genetic disease carrier rates from observed recessive-phenotype frequencies.
Formula
How this is calculated
The Hardy–Weinberg principle (independently proposed by G. H. Hardy and Wilhelm Weinberg in 1908) states that in a large, randomly mating population with no mutation, migration, natural selection, or genetic drift, allele and genotype frequencies remain constant from generation to generation. For a single locus with two alleles — a dominant allele A at frequency p and a recessive allele a at frequency q — the constraint p + q = 1 holds, and random mating produces three genotypes in predictable proportions: p² for homozygous dominant (AA), 2pq for heterozygous (Aa), and q² for homozygous recessive (aa), with p² + 2pq + q² = 1.
These predicted frequencies serve as a null hypothesis in population genetics. If observed genotype counts deviate significantly from Hardy–Weinberg expectations (tested with a chi-square test), it suggests one or more equilibrium assumptions are violated — non-random mating, natural selection favouring or disfavouring one genotype, recent population bottleneck, or immigration from populations with different allele frequencies.
Practical uses include estimating the frequency of genetic disease carriers: if the observed frequency of a recessive genetic disorder is q² (homozygous recessive), the carrier frequency is 2pq = 2q(1−q). For example, cystic fibrosis affects ~1 in 2500 northern Europeans, so q² ≈ 0.0004, q ≈ 0.02, and the carrier frequency 2pq ≈ 0.039, or about 1 in 25. This calculator assumes a simple two-allele diploid locus; multi-allele extensions require a generalised Hardy–Weinberg model.
Frequently asked questions
If the recessive phenotype frequency is q², then q = √(q²) and p = 1 − q. For example, if 4% of a population shows the recessive trait, q = √0.04 = 0.2 and p = 0.8. This only works under Hardy–Weinberg assumptions.
Under ideal Hardy–Weinberg conditions they stay constant indefinitely. In reality, genetic drift (especially in small populations), natural selection, mutation, and migration all shift allele frequencies over time. Hardy–Weinberg gives the baseline to detect these evolutionary forces.
No — the two-allele model is the standard introductory case. With three alleles (p, q, r where p+q+r=1), genotype frequencies are p², q², r², 2pq, 2pr, and 2qr. Extended calculators and bioinformatics tools handle multi-allele loci, but the two-allele Hardy–Weinberg model covers most textbook and carrier-frequency problems.
Also known as
TG we-Calculate Editorial Team. (2026). Allele Frequency Calculator — Hardy–Weinberg Equilibrium [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/allele-frequency-calculator
TG we-Calculate Editorial Team. "Allele Frequency Calculator — Hardy–Weinberg Equilibrium." TG we-Calculate. 2026. https://we-calculate.com/calculator/allele-frequency-calculator.
TG we-Calculate Editorial Team, "Allele Frequency Calculator — Hardy–Weinberg Equilibrium," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/allele-frequency-calculator
@misc{wecalculate_allele_frequency_calculator, title = {Allele Frequency Calculator — Hardy–Weinberg Equilibrium}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/allele-frequency-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
