How this instrument works
An allele frequency is the proportion of one version of a gene among all the gene copies present in a population or sample. For a single gene with two alleles — a dominant one and a recessive one — every diploid individual carries two copies at that locus, so a sample of n individuals contains 2n total allele copies. Counting how many of those copies are the dominant version and dividing by the total gives p, the dominant allele's frequency; the remainder, q = 1 − p, is the recessive allele's frequency, since the two must add to exactly 1.
This instrument performs that direct count: enter how many dominant allele copies were observed and how many allele copies exist in total, and it returns p and q. It does not assume the population is mating randomly, is free of selection, or is at Hardy-Weinberg equilibrium — those are separate assumptions layered on top, used to predict genotype frequencies (p², 2pq, q²) from allele frequencies. Direct counting works whether or not those assumptions hold; it is simply arithmetic on observed copies.
Where the numbers come from in practice varies by field. A genetics class might count phenotypes in a sample of pea plants and back-calculate allele copies; a conservation biologist might genotype captured animals at a marker locus; a lab course might tally colony counts on a selective plate. Whatever the source, the same two numbers — dominant copies and total copies — are all this calculator needs, because allele frequency is a count, not a model.
- Enter the number of dominant allele copies observed in your sample into Dominant allele count.
- Enter the total number of allele copies at that locus into Total alleles in the sample — for n diploid individuals genotyped at one gene, this is 2n.
- Read Dominant allele frequency (p) and Recessive allele frequency (q) — they are computed together and always sum to 1.
- If you only have genotype counts (AA, Aa, aa individuals), first convert to allele copies: dominant count = 2×(AA count) + (Aa count), total = 2×(total individuals).
- The instrument accepts any dominant count from 0 up to the total; entering a dominant count above the total is rejected, since a sample cannot contain more copies of an allele than it has copies overall.
Worked example — 70 dominant copies out of 100
A sample of 50 diploid individuals is genotyped at one gene, giving 100 total allele copies. Of those, 70 are the dominant allele. Enter 70 into Dominant allele count and 100 into Total alleles in the sample: p reads 0.7, meaning 70% of the allele copies in this sample are the dominant version.
Recessive allele frequency (q) follows automatically: q = 1 − 0.7 = 0.3. Together, 0.7 and 0.3 account for every one of the 100 allele copies in the sample — there is no third option at a two-allele locus, so the two frequencies always sum to exactly 1 regardless of how lopsided the split is.
Questions
What is the difference between allele frequency and genotype frequency?
Allele frequency counts individual gene copies (p and q, one per chromosome), while genotype frequency counts whole individuals by their pair of alleles (AA, Aa, aa). They are related but distinct: from p and q alone, Hardy-Weinberg equilibrium predicts genotype frequencies as p², 2pq and q² — but that prediction is a separate, additional assumption, not something this direct-count calculator applies. This page only computes p and q from observed allele copies.
Do I need Hardy-Weinberg equilibrium to use this calculator?
No. Direct counting — dividing the number of dominant allele copies by the total number of allele copies — works for any sample, in equilibrium or not, under selection or not, in a randomly mating population or not. Hardy-Weinberg equilibrium is a separate, additional assumption used only when you want to predict genotype frequencies from p and q; it plays no role in calculating p and q themselves.
How do I get allele counts if I only know how many individuals have each genotype?
Multiply and add: dominant allele count = 2×(homozygous dominant individuals) + (heterozygous individuals), and total alleles = 2×(total individuals sampled), since each diploid individual contributes two allele copies at the locus. For example, 20 AA, 40 Aa and 10 aa individuals give a dominant count of 2×20+40=80 out of a total of 2×70=140 alleles.
Can p or q ever be negative or greater than 1?
No — both are proportions of a fixed total, so they are always between 0 and 1 inclusive, and they always sum to exactly 1. If a calculation produces a value outside that range, the input counts were entered incorrectly, most often by entering a dominant count larger than the total allele count, which this instrument rejects.
Why does the calculator ask for allele copies instead of individuals?
Because allele frequency is defined at the level of gene copies, not organisms. A heterozygous individual (Aa) contributes one copy of each allele, so counting individuals directly would blur the dominant and recessive contributions together. Working in allele copies keeps the arithmetic exact: every copy is either dominant or recessive, and the two counts always add to the total.
Does this work for genes with more than two alleles?
Not directly — this calculator is built for the standard two-allele case (one dominant, one recessive frequency, p and q summing to 1). Genes with three or more alleles, such as the human ABO blood-group locus, need a separate frequency computed for each allele, with all of them summing to 1 rather than just two complementary values.