Allele Frequency from Genotypes Calculator
Compute allele frequencies p and q from observed genotype counts, and compare the observed genotype frequencies against the Hardy-Weinberg expectation.
How it works
p = (2·AA + Aa) ÷ (2·N) · q = (2·aa + Aa) ÷ (2·N) · N = AA + Aa + aa · expected: AA = p², Aa = 2pq, aa = q²
Each individual carries two alleles, so counting alleles directly gives allele frequencies: every AA contributes two dominant alleles, every heterozygote one of each, and every aa two recessive alleles. Dividing the dominant-allele count by the total number of alleles (2N) gives p, and the recessive count gives q, with p + q = 1. Comparing the observed genotype frequencies against the Hardy-Weinberg predictions p², 2pq and q² is the first step in testing whether a population is evolving at that locus.
Worked example
With 320 AA, 160 Aa and 20 aa (500 individuals, 1000 alleles): p = (640 + 160) ÷ 1000 = 0.80 and q = (40 + 160) ÷ 1000 = 0.20. The Hardy-Weinberg expectation is AA = 0.64, Aa = 0.32, aa = 0.04 — close to the observed 0.64 / 0.32 / 0.04.
Sources: Allele frequency — Wikipedia
Frequently asked questions
Why multiply by 2 in the formula?
Because every individual has two alleles at the locus, the total number of alleles in the population is twice the number of individuals (2N). Counting how many of those alleles are dominant and dividing by 2N gives p.
How do I test for Hardy-Weinberg equilibrium?
Compare the observed genotype counts with the expected counts (p²·N, 2pq·N, q²·N) using a chi-square goodness-of-fit test. Close agreement is consistent with equilibrium; a large deviation suggests selection, migration or non-random mating.
What if I only know the recessive count?
Then you cannot separate AA from Aa directly and must assume equilibrium to estimate q as √(aa/N). Use the Hardy-Weinberg equilibrium calculator for that case; this tool needs all three genotype counts.
Related calculators
Educational estimate, not medical or laboratory advice — verify formulas, units and assumptions for your specific protocol.