Allele frequency tells you how common a gene variant (an allele) is in a population. This article shows the exact formulas to convert genotype counts into allele frequencies, and the calculator computes p and q (and checks totals) from your data.
You’ll learn how to handle homozygotes and heterozygotes, what each symbol means, and what to do when your counts don’t add up cleanly.
What an Allele Frequency Calculator Computes
Allele frequency is the proportion of all gene copies in a population that are a particular allele. If a gene has two alleles, we usually label them A and a, with frequencies p and q.
For diploid organisms (two copies per individual), each individual contributes 2 alleles to the total. The calculator converts genotype counts into allele counts, then divides by the total number of alleles.
Key Definitions (Simple and Exact)
- AA: homozygote with two copies of allele A
- Aa: heterozygote with one copy of allele A and one copy of allele a
- aa: homozygote with two copies of allele a
- N: total number of individuals, where N = AA + Aa + aa
- Total alleles: 2N for diploid organisms
Core Formulas for Allele Frequencies
Start by turning genotype counts into allele counts.
| Genotype | Allele contribution | Allele count (A) | Allele count (a) |
|---|---|---|---|
| AA | 2 copies of A | 2·AA | 0 |
| Aa | 1 copy of A and 1 copy of a | 1·Aa | 1·Aa |
| aa | 2 copies of a | 0 | 2·aa |
Allele frequency for A (p)
p is the fraction of all alleles that are A:
p = (2·AA + Aa) / (2N)
Allele frequency for a (q)
q is the fraction of all alleles that are a:
q = (2·aa + Aa) / (2N)
Sanity check: p + q
When counts are valid and the organism is diploid, the frequencies satisfy:
p + q = 1
If your inputs are correct, the calculator will show totals that match this rule (allowing for rounding).
How to Use the Allele Frequency Calculator
Enter the number of individuals for each genotype: AA, Aa, and aa. Then choose the output format: proportion (0 to 1) or percent (0% to 100%).
- If you only have allele counts instead of genotypes, use genotype counts instead because the standard calculator is built for AA/Aa/aa.
- All inputs must be non-negative numbers. The calculator rejects negative values and handles zero totals.
- If N = 0 (all counts are 0), the calculator cannot compute frequencies and will show an error.
Worked Example (Manual Calculation)
Imagine a sample of 100 diploid individuals with the following genotype counts:
- AA = 36
- Aa = 48
- aa = 16
First compute the total individuals: N = 36 + 48 + 16 = 100. Total alleles = 2N = 200.
Now compute:
- p = (2·AA + Aa) / (2N) = (2·36 + 48) / 200 = (72 + 48) / 200 = 120/200 = 0.60
- q = (2·aa + Aa) / (2N) = (2·16 + 48) / 200 = (32 + 48) / 200 = 80/200 = 0.40
Check: p + q = 0.60 + 0.40 = 1.00.
Practical Examples: When Allele Frequencies Matter
Example 1: Tracking a variant in a breeding population
Breeders often genotype animals and want to know how quickly a favorable allele spreads. After genotyping, you count AA, Aa, and aa, then compute p (allele A frequency) and q (allele a frequency). Comparing p across generations shows whether selection is working.
Example 2: Comparing populations in a study
Researchers may sample multiple populations and compare allele frequencies to detect drift, migration, or selection. Allele frequencies are the starting point for many downstream analyses, including Hardy–Weinberg checks and tests of population differentiation.
Common Mistakes (and How to Avoid Them)
- Mixing diploid vs. haploid logic: the formulas above assume diploid organisms (2 alleles per individual).
- Forgetting the “2” in 2N: each AA contributes two A alleles; each aa contributes two a alleles.
- Using total genotypes instead of individuals: AA/Aa/aa counts should be individuals, not allele copies.
- Rounding too early: compute p and q from raw counts, then round for reporting.
Frequently Asked Questions
What is allele frequency, in plain language?
Allele frequency is the fraction of all gene copies in a population that are a specific allele. For diploid organisms, each person contributes two alleles, so you compute allele counts from genotype counts and divide by 2N.
How do you calculate allele frequency from AA, Aa, and aa?
Use p = (2·AA + Aa) / (2N) for allele A and q = (2·aa + Aa) / (2N) for allele a, where N = AA + Aa + aa. These formulas count allele copies and convert them to proportions.
Why should p + q equal 1?
With two alleles in a diploid organism, every gene copy is either A or a. If your genotype counts are correct and N is the total number of individuals, then the allele counts must sum to 2N, making p + q = 1.
Can allele frequencies be negative or above 1?
No, valid allele frequencies must fall between 0 and 1 (or 0% to 100%). If your calculator shows values outside that range, your inputs are likely inconsistent, negative, or not counts of individuals.
Do allele frequencies require Hardy–Weinberg assumptions?
No. Allele frequency from observed genotype counts is direct and does not require Hardy–Weinberg equilibrium. Hardy–Weinberg is used for expected genotype proportions, but allele frequency calculation is purely based on counts.