Allele frequency formula
Each individual carries two alleles, so the dominant allele count is 2×(AA) + (Aa). Dividing by the total number of alleles (2×total individuals) gives p = (2·AA + Aa) ÷ (2·total). The recessive frequency is simply q = 1 − p.
The derivation is pure counting. Homozygous recessives contribute no dominant alleles, which is why the aa count never appears in the numerator — it only enlarges the denominator through the total. To see how two parental genotypes combine in the next generation, use the Punnett square calculator.
How to use this calculator
Enter how many individuals have each genotype: homozygous dominant (AA), heterozygous (Aa), and homozygous recessive (aa). The tool sums them, counts alleles, and returns p and q. Feed p into the Hardy-Weinberg calculator to predict genotype frequencies.
Use whole individuals, not percentages. A common error is forgetting that heterozygotes count on both sides: a population of only Aa individuals has p = q = 0.5, not p = 1.
Worked example
For 30 AA, 40 Aa and 30 aa individuals, the total is 100. Dominant alleles = 2×30 + 40 = 100, out of 200 total alleles, so p = 0.5 and q = 1 − 0.5 = 0.5.
A p of 0.5 means half of all copies of that gene are the dominant form. Repeating the count in a later generation shows whether selection, drift or migration is shifting the frequency. Frequencies are proportions, so the percentage calculator converts them into the percentages most reports quote.
Frequently asked questions
- How do I count alleles from genotypes?
- Each AA individual contributes two dominant alleles, each Aa contributes one dominant and one recessive, and each aa contributes two recessive alleles.
- Why divide by 2 times the total?
- Every individual has two alleles, so a population of N individuals carries 2N alleles. Dividing by 2N converts a count into a frequency.
- What if my counts give p over 1?
- That cannot happen with valid counts. If it does, recheck your AA, Aa and aa numbers — one value is likely entered incorrectly.
- Do p and q always add to 1?
- Yes, for a two-allele gene. Once you compute p, the recessive frequency is always q = 1 − p.
- Can I use this for a gene with three or more alleles?
- No — this tool assumes a single gene with exactly two alleles, so that q = 1 − p holds. With three alleles you must count each allele separately and divide every count by 2N, and the frequencies then sum to 1 across all three.