Free Genetics tool

Allele Frequency Calculator

The Allele Frequency Calculator determines dominant (p) and recessive (q) allele frequencies and expected genotype distributions from population sample counts. Allele frequency is the starting number of every population genetics calculation, and getting p and q right from raw counts is where most worksheets slip. Feed in genotype counts (or phenotype tallies when you cannot tell carriers apart) and this calculator returns p, q, the Hardy-Weinberg expectations, carrier risk and the fixation index in one pass.

Allele Frequency Calculator: result

Genotype mode: individuals you scored as AA.
Genotype mode: carriers you scored as Aa.
Genotype mode: individuals you scored as aa.
Phenotype mode: everyone showing the dominant trait (AA + Aa).
Phenotype mode: only aa individuals show the recessive trait.
Sample size100 individuals
Dominant allele frequency (p)0.7000p = (2 × 50 + 40) ÷ (2 × 100)
Recessive allele frequency (q)0.3000q = 1 − p
Heterozygotes: observed vs expected40% vs 42%
Fixation index F0.048non-zero: deviation from random-mating expectations
Carrier frequency among unaffected44.44%Hardy-Weinberg prediction: 46.15%
Observed vs Hardy-Weinberg expected
GenotypeObservedExpected (p², 2pq, q²)
AA5049
Aa4042
aa109
Reading F: F = 1 − (observed heterozygosity ÷ expected). F near 0 means the genotype counts match random mating; positive F means fewer heterozygotes than expected (inbreeding, hidden population structure), and negative F means an excess.

At a glance

  • What it does: Turns genotype or phenotype counts into allele frequencies p and q, plus Hardy-Weinberg expectations and the fixation index F.
  • Who it is for: Built for students and field biologists who have tallies from a sample and need the gene-pool numbers behind them.
  • Typical result: Returns observed and expected heterozygosity, carrier frequency among unaffected people, and a per-allele check.

How to use the allele frequency calculator

  1. Choose what you scored: genotype counts when a test tells AA from Aa from aa, or phenotype counts when you only see dominant vs recessive. prefill →
  2. Enter the three genotype counts (AA, Aa, aa) in genotype mode, or the two phenotype counts in phenotype mode: the other fields are ignored. prefill →
  3. Read p and q as the frequency of the dominant and recessive allele in the gene pool: each diploid individual contributes two alleles, which is the divide-by-2N step.
  4. Compare observed and expected heterozygotes and check F. That pairing tells you whether the population is behaving like a random-mating pool.
  5. Use the carrier frequency among unaffected people for counselling-style estimates, and remember phenotype mode can only estimate it through Hardy-Weinberg.

Allele Frequency: the formula & its source

Each individual carries two alleles, so the sample has 2N alleles in total. Counting the dominant allele A gives one copy per AA and one per Aa:

p = (2NAA + NAa) ÷ 2N  ·  q = (2Naa + NAa) ÷ 2N = 1 − p

Under random mating the genotype frequencies settle at p², 2pq and q², the Hardy-Weinberg proportions. Comparing the heterozygotes you observed with 2pq gives the fixation index F = 1 − (Hobs ÷ Hexp), and the carrier frequency among unaffected individuals (Aa ÷ AA + Aa) has the closed form 2q ÷ (1 + q). With phenotype data only aa is directly countable, so q = √(aa ÷ N).

Need to model a locus with three alleles? Calculate trinomial frequencies ($p, q, r$), expected genotype counts, and Chi-square equilibrium with our 3-allele Hardy-Weinberg calculator.

SymbolMeaningUnitTypical range
pfrequency of the dominant allele in the sampleproportion0 to 1
qfrequency of the recessive allele, one minus pproportion0 to 1
Nindividuals genotyped or scored in the tallycount20 to 10000
Ffixation index from observed against expected heterozygosityindex-1 to 1

Allele Frequency: worked example

Worked example: 50 AA, 40 Aa, 10 aa. N = 100, so p = (2 × 50 + 40) ÷ 200 = 0.70 and q = 0.30. Expected heterozygosity is 2pq = 0.42 against 40% observed, so F = 1 − 0.40 ÷ 0.42 = 0.048, a small deficit of carriers. Among the 90 unaffected individuals, 40/90 = 44.44% are observed carriers while Hardy-Weinberg predicts 2q/(1+q) = 46.15%.

Example B: phenotype counts only

Example B: phenotype counts only. Switch Data you have to Phenotype counts and enter 80 dominant against 20 recessive. Only aa shows the recessive trait, so q = sqrt(20 / 100) = 0.447 and p = 0.553, giving expected heterozygosity of 2pq near 0.494. Use this mode whenever a lab reports dominant and recessive tallies without genotypes, and remember the carrier figure and F rest on a Hardy-Weinberg assumption you cannot check with two numbers alone.

Allele frequency worked counting scheme showing raw genotype counts, allele pooling into 2N total alleles, and derivation of p and q.
Three-step allele frequency calculation architecture. Starting with observed diploid counts (48 AA, 32 Aa, 20 aa), the algorithm calculates 2N total alleles (200), assigns two copies per homozygote and one per heterozygote, and computes gametic frequencies p = 0.64 and q = 0.36.

Counting alleles, not people

An allele frequency describes the gene pool, so the arithmetic counts gene copies rather than individuals. Every diploid contributes two, which makes the sample 2N alleles wide. Each AA adds two dominant copies, each Aa adds one dominant and one recessive, and each aa adds two recessive copies; dividing those totals by 2N gives p and q directly.

Phenotype mode covers the common situation where a recessive genotype is invisible. Only aa shows the recessive trait, so its share of the sample is q squared, and taking the square root recovers q. That shortcut needs the recessive phenotype to map cleanly onto aa, which is why incomplete dominance and codominance push you back into genotype mode.

The arithmetic has no use for a grid. A Punnett square predicts the offspring of one mating, while a frequency describes the pool those gametes came from, and confusing the two is the usual source of wrong answers. Work through the defaults: 50 AA, 40 Aa and 10 aa means 200 gene copies in the sample, of which 140 are A, so p = 0.70 and q = 0.30. Each individual you score fills two slots in that count, which is the whole of the divide-by-2N step that worksheets most often get wrong. Phenotype mode follows the same logic with one fewer visible class, since only aa is unambiguous about which two copies it carries.

From frequencies to carrier risk

Square p and q and the Hardy-Weinberg proportions follow: p squared for homozygous dominant, 2pq for heterozygous, q squared for homozygous recessive. Those three numbers are the bridge from a sample to the next generation. With q at 0.30, about 9% of newborns will be aa even though only 10% of the scored sample was.

Counselling questions usually ask a narrower thing: among people who do not show the condition, how many carry one copy? That denominator excludes aa, and the ratio of heterozygotes to all unaffected individuals simplifies to 2q / (1 + q). At q = 0.30 it reads about 46%, a little higher than the whole-population figure of 2pq, and it climbs steeply as q grows.

Lining up observed against expected heterozygosity gives one more useful readout: 2pq is what random mating would produce, and the gap from your observed carrier count is what F reports. In the default data the expectation is 0.42 against 40% observed, a small carrier deficit worth stating next to the index rather than on its own. Screening programmes lean on the same figure when they ask how many unaffected people in a population carry one copy of a recessive allele, which is why the calculator prints carrier frequency alongside p and q instead of making you square them by hand.

Reading the fixation index

F compares what you observed with what random mating predicts: F = 1 minus (H observed divided by H expected), where the expectation is 2pq. A value near zero says the sample behaves like a single random-mating pool. A positive value flags a heterozygote deficit, the signature of inbreeding or of subdivided groups being pooled together. A negative value means more heterozygotes than expected.

Read F with the sample size in hand. A hundred individuals carry real sampling error, so the third decimal is noise rather than signal. The index also responds to things other than mating: null alleles hide heterozygotes from a genotyping assay and inflate F on their own, and structured populations inflate it without any inbreeding at all.

Choosing what you actually scored

Genotype mode is the direct route whenever a test separates AA from Aa from aa: enter three tallies, and every figure downstream is arithmetic rather than inference. Phenotype mode fits field counts and classroom exercises where the heterozygote looks identical to the dominant homozygote, because then only two classes are visible and one of them is unambiguous.

The two modes also fail in opposite directions. Phenotype mode cannot see carriers at all, so its carrier and F figures are model-based. Genotype mode depends on a scoring method that actually distinguishes the classes, and a misread heterozygote shifts both p and F. Pick the mode that matches the evidence in front of you, and say which one you used when you report the numbers.

Two-allele arithmetic also has a multi-allelic cousin for systems such as ABO: compute one frequency per allele instead of a single p and q, using the same rule of copies divided by 2N. The modes here stay narrow on purpose so every printed figure, including F, keeps a single interpretation and can be compared with the chi-square page that follows on from it.

What your allele frequency result means

p and q describe the gene pool, not individuals. Nobody is 0.70 of an allele. Squaring them gives genotype odds for the next generation: with q = 0.30, about 9% of newborns will be aa even though only 10% of this sample was.

The carrier frequency is the number genetic counsellors actually quote: among people who do not show a recessive condition, roughly 2q/(1+q) still carry one copy. That figure climbs steeply as q grows. At q = 0.30 it is already 46%.

How to read the output:
Result rangeWhat it meansWhat to do next
p = 0.70, q = 0.30dominant allele common in the poolRecessive outcomes stay rare, about q squared
F close to 0observed carriers match 2pqRandom mating fits this sample
F above 0fewer carriers than expectedCheck inbreeding and pooled subgroups
F below 0more carriers than expectedCheck sampling and genotyping errors

Common mistakes with the allele frequency

  • Dividing counts by N instead of 2N: Alleles come in pairs per individual, so halve again: p is (2AA + Aa) over twice the sample size.
  • Using phenotype mode when the heterozygote is visible: Incomplete dominance and codominance put Aa in its own class, so genotype counts are required instead.
  • Quoting an F value to three decimals from a sample of eighty: Sampling error swamps the third decimal; report F to one or two digits alongside the sample size.
  • Expecting carrier risk among unaffected people to equal 2pq: That denominator excludes aa, so the correct figure is 2q / (1 + q), which runs slightly higher.

Limits of the allele frequency calculator

The formulas assume a single locus with two alleles and unbiased sampling. Structured populations (a Wahlund effect) inflate F without any inbreeding, null alleles hide heterozygotes and inflate F the same way, and a sample of 100 carries real sampling error. Treat the third decimal of F as noise.

Phenotype mode can only work when the recessive phenotype maps cleanly to aa: incomplete dominance or codominance break that mapping, because the heterozygote has its own visible phenotype instead of hiding inside the dominant class.

Research note from Dr. Dinesh A. Nagegowda, PhD: Calculating population allele frequencies (p and q) from phenotypic counts assumes random mating and representative sampling across the entire population. In our plant population genetics studies, micro-geographical clustering and localized seed dispersal frequently cause localized inbreeding (Wahlund effect), which inflates apparent homozygosity. We recommend sampling across multiple geographic transects and verifying counts with co-dominant molecular markers.

Sources

  1. Hardy (1908), Mendelian proportions in a mixed population, Science 28:49-50 (used for: p squared, 2pq and q squared as the random-mating expectation)
  2. 1000 Genomes Project Consortium (2015), a global reference for human genetic variation (used for: population-scale allele frequency estimates of the kind this calculator reproduces on a sample)
  3. Ioannou et al. (2014), population-based carrier screening for cystic fibrosis (used for: why carrier frequency among unaffected people is the quoted counselling figure)
  4. Allison (1954), protection afforded by sickle-cell trait, BMJ (used for: worked example of allele frequencies tracked in a real population)

Cite This Calculator

For laboratory course reports, academic papers, or institutional protocols (APA format):

Bonk, C. (2026). Allele Frequency Calculator. Biology Calculator. https://biologycalculator.org/genetics/allele-frequency-calculator/

Allele Frequency: frequently asked questions

How do I calculate allele frequency from a Punnett-square result?

Count alleles directly: every AA contributes two dominant alleles, every Aa one of each, every aa two recessive ones, then divide by 2N. The Punnett square predicts offspring; allele frequency describes the pool the offspring come from.

What does F = 0 mean?

Observed heterozygosity exactly matches the Hardy-Weinberg expectation of 2pq, which is what random mating in a large panmictic pool produces. Positive F signals a heterozygote deficit (inbreeding or population subdivision); negative F an excess.

Can I use this for blood type or other multi-allelic genes?

The two-allele mode fits traits like Aa vs aa. Multi-allelic systems such as ABO need allele-by-allele counts; the arithmetic (copies ÷ 2N) is the same, but you compute one frequency per allele rather than a single p and q.

Why is the carrier rate not just 2pq?

2pq is the share of the whole population. Counselling questions ask about carriers among people who are unaffected: that denominator excludes aa, which simplifies to 2q/(1+q), a slightly higher number than 2pq.

Found a number that does not match its source? Report a mistake. Corrections are published in place and the page date is updated.

Editorial check by Dr. Dinesh A. Nagegowda, PhD, Plant & Molecular Biology Editor

Something on this page not matching its cited source? Report it.

Dinesh Nagegowda, Biotechnology Researcher

Dr. Dinesh A. Nagegowda, PhD: Plant & Molecular Biology Editor

Dinesh is a plant molecular biologist and Chief Scientist at CSIR-CIMAP whose research runs through functional genomics, transcriptomics, metabolomics, and biosynthetic pathways in plants. He writes and…

About Dr. Dinesh A. Nagegowda, PhD →