Allele Frequency Calculator

Calculate allele frequencies (p and q) from population genotype data or allele counts.

Input Data

Formulas

p = freq(A) = (2*AA + Aa) / 2N

q = freq(a) = (2*aa + Aa) / 2N

p + q = 1

Allele Frequencies

p (dominant A)
0.6000
60.00%
q (recessive a)
0.4000
40.00%

Population Statistics

Total Individuals1,000
Total Alleles (2N)2,000
A Allele Count1,200
a Allele Count800

Expected Genotype Frequencies (HW Equilibrium)

AA (p²)0.3600 (36.00%)
Aa (2pq)0.4800 (48.00%)
aa (q²)0.1600 (16.00%)

Allele Frequency Calculator: Overview

The allele frequency calculator determines the relative proportions of two alleles at a single genetic locus within a population. Allele frequency is one of the most fundamental measurements in population genetics, because evolution at the simplest level is nothing more than a change in allele frequencies over generations. Whether you are working through a Hardy-Weinberg homework problem, analysing field data from a wild population, or checking a teaching dataset, this calculator converts raw counts into the two key parameters geneticists call p and q.

This tool accepts data in two formats. In From Genotypes mode you enter the number of homozygous dominant (AA), heterozygous (Aa), and homozygous recessive (aa) individuals, and the calculator counts every allele each genotype contributes. In From Allele Counts mode you enter the raw number of dominant (A) and recessive (a) alleles directly, which is convenient when you already have gene-level data such as sequencing reads or pooled allele tallies. Both modes return p (the frequency of the dominant allele A) and q (the frequency of the recessive allele a), along with population totals and the expected genotype frequencies under Hardy-Weinberg equilibrium.

Because every diploid individual carries two copies of each gene, a population of N individuals contains 2N alleles at the locus. The allele frequency calculator divides the count of each allele by this total to express it as a proportion between 0 and 1. By definition the two frequencies always sum to one (p + q = 1), so the calculator effectively summarises the entire genetic state of a biallelic locus in a single number.

How the Allele Frequency Calculation Works

The core of the allele frequency calculation is straightforward allele counting. Each homozygous dominant (AA) individual contributes two A alleles. Each heterozygous (Aa) individual contributes one A and one a. Each homozygous recessive (aa) individual contributes two a alleles. Summing these contributions gives the total number of A alleles and a alleles in the gene pool, and dividing by the total allele count (2N) gives p and q.

The calculator implements exactly this logic. In genotype mode it computes the A allele count as 2 × AA + Aa and the a allele count as 2 × aa + Aa, then divides each by the total number of alleles, which equals the number of individuals multiplied by two. In allele-count mode the inputs are already gene-level counts, so the calculator simply divides each allele count by their sum. The result is identical in spirit: the proportion of the gene pool occupied by each allele.

Once p and q are known, the calculator also reports the expected genotype frequencies predicted by the Hardy-Weinberg principle: p² for AA, 2pq for Aa, and q² for aa. These expected values describe what the genotype proportions would be if the population were mating randomly with no selection, mutation, migration, or genetic drift. Comparing the observed genotype frequencies (in genotype mode) with these expected values is the first step in testing whether a population is in equilibrium.

Allele Frequency Formulas

p = (2 × AA + Aa) / 2N q = (2 × aa + Aa) / 2N p + q = 1

Where:

  • p= Frequency of the dominant allele A (between 0 and 1)
  • q= Frequency of the recessive allele a (between 0 and 1)
  • AA= Number of homozygous dominant individuals
  • Aa= Number of heterozygous individuals
  • aa= Number of homozygous recessive individuals
  • N= Total number of diploid individuals; 2N is the total allele count

Interpreting p, q, and Genotype Frequencies

The two headline outputs of the allele frequency calculator are p and q, displayed both as decimal frequencies (four decimal places) and as percentages. A value of p = 0.6 means that 60% of the alleles at this locus are the dominant form A, while q = 0.4 means 40% are the recessive form a. Because the two must total one, knowing either value immediately gives you the other.

The calculator also reports the supporting counts so you can audit the math: total individuals, total alleles (2N), the A allele count, and the a allele count. These intermediate numbers are useful for lab reports and for catching data-entry errors, since the allele counts should always add up to 2N.

The expected genotype frequencies panel applies the Hardy-Weinberg equation p² + 2pq + q² = 1. Reading a high q² value tells you the recessive phenotype should be common; a high 2pq value indicates many carriers. When working from a known recessive phenotype frequency, you can reverse the logic: take the square root of q² to estimate q, then compute p and the predicted carrier (heterozygote) frequency. This carrier-estimation use is one of the most common reasons students and genetic counsellors reach for an allele frequency calculator.

Keep in mind that the expected genotype frequencies are predictions under equilibrium assumptions. If your observed counts differ substantially from the predicted p², 2pq, and q², the population may be experiencing selection, non-random mating, or other evolutionary forces, and a formal chi-square test of Hardy-Weinberg equilibrium is warranted.

Applications in Population Genetics

Allele frequencies underpin nearly every quantitative question in population genetics and evolutionary biology. Conservation biologists track allele frequencies over time to detect loss of genetic diversity in small or fragmented populations. Plant and animal breeders use them to monitor how selective breeding shifts the frequency of desirable alleles. Human geneticists use allele frequencies to estimate the prevalence of carriers for recessive disorders such as cystic fibrosis or sickle-cell trait.

  • Carrier frequency estimation: From the incidence of a recessive disease (q²), derive q and the heterozygote carrier frequency 2pq.
  • Hardy-Weinberg testing: Compare observed genotype counts with the expected p², 2pq, q² distribution to detect evolutionary forces.
  • Tracking microevolution: Measure how allele frequencies change between generations under selection, drift, or migration.
  • Forensics and ancestry: Population allele frequencies are the basis for calculating the probability of a DNA profile match.

This allele frequency calculator gives you the starting point for all of these analyses by reducing genotype or allele data to clean p and q values, ready to feed into downstream calculations such as fixation indices, effective population size, or chi-square genetics tests.

Assumptions and Limitations

The allele frequency itself is a simple, assumption-free descriptive statistic: it is just a count divided by a total, so it is always valid for the data you enter. The expected genotype frequencies reported alongside p and q, however, rest on the Hardy-Weinberg assumptions of a large, randomly mating population with no mutation, migration, or natural selection acting on the locus. When these conditions are violated, observed and expected genotype counts will diverge.

This calculator handles a single biallelic, autosomal locus. It does not directly model loci with three or more alleles (such as the ABO blood-group system), sex-linked genes whose allele counts differ between males and females, or linked loci. For multi-allele systems you would extend the same counting principle across each allele, while sex-linked loci require weighting by the number of X chromosomes rather than simply 2N.

Finally, remember that allele frequency estimates from small samples carry sampling error. A sample of twenty individuals gives only forty alleles, so a single rare genotype can swing the estimate substantially. Larger samples produce more reliable frequencies, and reporting confidence intervals is good practice for research-grade work. Use this allele frequency calculator for teaching, quick estimates, and data checking, and pair it with formal statistical software for publication-quality analysis.

Worked Examples

Allele Frequencies from Genotype Counts

Problem:

A population contains 360 AA individuals, 480 Aa individuals, and 160 aa individuals. Find p and q.

Solution Steps:

  1. 1Total individuals N = 360 + 480 + 160 = 1000, so total alleles 2N = 2000.
  2. 2A allele count = (2 × 360) + 480 = 720 + 480 = 1200.
  3. 3a allele count = (2 × 160) + 480 = 320 + 480 = 800.
  4. 4p = 1200 / 2000 = 0.6000 and q = 800 / 2000 = 0.4000.

Result:

p = 0.6000 (60%), q = 0.4000 (40%). Expected genotypes: AA = 0.36, Aa = 0.48, aa = 0.16.

Allele Frequencies from Direct Allele Counts

Problem:

Sequencing of a pooled sample yields 1200 dominant (A) alleles and 800 recessive (a) alleles. Find p and q.

Solution Steps:

  1. 1Total alleles = 1200 + 800 = 2000.
  2. 2p = freq(A) = 1200 / 2000 = 0.6000.
  3. 3q = freq(a) = 800 / 2000 = 0.4000.
  4. 4Implied diploid individuals = 2000 / 2 = 1000.

Result:

p = 0.6000, q = 0.4000, confirming p + q = 1.

Estimating Carrier Frequency from a Recessive Phenotype

Problem:

A recessive disorder affects 1 in 2500 newborns (q² = 0.0004). Estimate the allele frequencies and the carrier (Aa) frequency.

Solution Steps:

  1. 1q = √(q²) = √0.0004 = 0.02 (the recessive allele frequency).
  2. 2p = 1 − q = 1 − 0.02 = 0.98.
  3. 3Carrier frequency = 2pq = 2 × 0.98 × 0.02 = 0.0392.
  4. 4Convert to a ratio: 0.0392 ≈ 1 in 25.5 people are carriers.

Result:

q = 0.02, p = 0.98, carrier frequency 2pq ≈ 0.0392 (about 3.92%).

A Locus Near Fixation

Problem:

A small population has 950 AA, 48 Aa, and 2 aa individuals. Find q for the recessive allele.

Solution Steps:

  1. 1Total individuals N = 950 + 48 + 2 = 1000, so 2N = 2000 alleles.
  2. 2a allele count = (2 × 2) + 48 = 4 + 48 = 52.
  3. 3q = 52 / 2000 = 0.0260.
  4. 4p = 1 − 0.0260 = 0.9740, showing the dominant allele is approaching fixation.

Result:

q = 0.0260 (2.6%), p = 0.9740 (97.4%).

Tips & Best Practices

  • Always confirm that your A and a allele counts add up to 2N before trusting the result.
  • Use From Genotypes mode for classic AA/Aa/aa survey data and From Allele Counts mode for pooled or sequencing data.
  • Heterozygotes contribute one copy of each allele, so they count toward both p and q.
  • To estimate carriers, take the square root of the recessive phenotype frequency to find q, then compute 2pq.
  • Larger sample sizes give more reliable frequency estimates; small samples are sensitive to a single rare genotype.
  • Remember that allele frequencies are always between 0 and 1 and must sum to one for a two-allele locus.
  • Compare observed genotype frequencies with the expected p², 2pq, q² values to spot deviations from equilibrium.
  • For multi-allele systems like ABO blood groups, apply the same counting logic to each allele separately.

Frequently Asked Questions

Allele frequency is the proportion of a particular allele among all copies of that gene in a population. It is calculated by counting how many copies of the allele are present and dividing by the total number of alleles at that locus, which is twice the number of diploid individuals. The result is a value between 0 and 1, and the frequencies of all alleles at a locus always sum to one.
Count the alleles each genotype contributes: homozygous dominant individuals give two A alleles each, heterozygotes give one A and one a, and homozygous recessives give two a alleles each. The frequency of A is p = (2 × AA + Aa) / 2N and the frequency of a is q = (2 × aa + Aa) / 2N, where N is the number of individuals. The calculator performs this counting automatically when you use the From Genotypes mode.
Allele frequency measures the proportion of individual gene copies (A or a) in the gene pool, while genotype frequency measures the proportion of individuals carrying a particular pairing such as AA, Aa, or aa. You can compute allele frequencies directly from genotype counts, and under Hardy-Weinberg equilibrium you can predict genotype frequencies from allele frequencies using p², 2pq, and q².
At a locus with only two alleles, every gene copy in the population is either A or a, so the two frequencies together account for 100% of the alleles. Mathematically this means p + q = 1. If you know one frequency you can always find the other by subtraction, which is why questions often give you one value and ask for the rest.
Yes. If you know the frequency of a recessive phenotype, that value equals q² under Hardy-Weinberg equilibrium. Take its square root to get q, subtract from one to get p, and the heterozygous carrier frequency is 2pq. This is a standard method in genetic counselling for estimating how many people carry a recessive disease allele without showing symptoms.
The allele frequencies p and q themselves are simple descriptive counts and require no assumptions. The expected genotype frequencies (p², 2pq, q²) shown alongside them do assume Hardy-Weinberg equilibrium, meaning random mating and no selection, mutation, migration, or drift. Comparing observed genotype counts to these expected values helps you judge whether the population is actually in equilibrium.

Sources & References

Last updated: 2026-06-05

💡

Help us improve!

How would you rate the Allele Frequency Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Standard Mathematical References

by Various

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.

Privacy choices

MyCalcBuddy uses necessary storage for the site to work. Optional analytics, notifications, and future advertising features stay off unless you allow them.