Skip to content

Allele Frequency Calculator | Population Genetics

Calculate allele frequency for a population of any size. Enter individuals and allele counts to get the frequency, formula, and a worked example instantly.

Allele Frequency Calculator

Calculate allele frequency in your population by entering the total number of individuals and counting allele instances. Remember: homozygous individuals contribute 2 alleles, heterozygous contribute 1.

Population Data

Results

Allele Frequency
0.2500

Calculation Formula

f = 50 / (100 × 2) = 0.2500

Allele Frequency Visualization

Allele Frequency
Allele frequency chart showing target allele at 25.0% and other alleles at 75.0%25.0%75.0%100.0%

Population Representation

Target Allele
Other Alleles
Loading calculator...
📚

Documentation

What is allele frequency?

Allele frequency is the proportion of one version of a gene, called an allele, among all copies of that gene in a population. It is one of the basic measurements in population genetics, the study of how genes vary and change across groups of organisms.

Most animals and plants, including humans, are diploid. Each individual carries two copies of every gene, one from each parent. A population of N individuals therefore holds 2N copies of each gene. Allele frequency counts how many of those 2N copies are the specific variant being studied.

Allele frequency formula

The formula for a diploid population is:

f=nA2Nf = \frac{n_A}{2N}

  • ff is the allele frequency, a value between 0 and 1
  • nAn_A is the number of copies of the allele found in the population
  • NN is the number of individuals
  • 2N2N is the total number of gene copies, since each individual has two

For example, a population of 100 individuals has 200 copies of any given gene. If 50 of those copies are the allele being studied, the frequency is 50 ÷ 200 = 0.25, or 25%.

How to calculate allele frequency with this tool

The calculator needs two numbers.

Total individuals (N). Count every member of the population under study. Enter this as a positive whole number.

Allele instances. Count copies of the allele, not people. An individual who is homozygous (carries two copies of the allele) contributes 2 to this count. An individual who is heterozygous (carries one copy) contributes 1. Someone with neither copy contributes 0.

The tool then divides the instance count by twice the population size and shows the result as a decimal between 0 and 1. It will reject an instance count above 2N, since that many copies cannot exist in a diploid population of that size, and it will reject negative numbers or a population of zero or fewer.

Worked example

Suppose a study looks at 100 people. Of these, 10 are homozygous for the allele and 30 are heterozygous.

Allele copies = (10 × 2) + (30 × 1) = 50

Population copies = 100 × 2 = 200

Allele frequency = 50 ÷ 200 = 0.25

The allele is present in a quarter of all gene copies in this population.

Calculating from genotype data

Researchers often start with genotype counts instead of a raw tally of allele copies. Two related formulas cover this.

From genotype counts. If nAAn_{AA} people are homozygous for allele A and nABn_{AB} are heterozygous, out of N total people:

fA=2×nAA+nAB2Nf_A = \frac{2 \times n_{AA} + n_{AB}}{2N}

From genotype frequencies. If the proportions of each genotype are already known:

fA=fAA+fAB2f_A = f_{AA} + \frac{f_{AB}}{2}

For instance, in a group where 25% are AA, 50% are Aa, and 25% are aa, the frequency of A is 0.25 + (0.50 ÷ 2) = 0.50.

Different ploidy levels

The calculator is built for diploid organisms, but the same idea extends to organisms with a different number of gene copies:

  • Haploid (1 copy): f=nA/Nf = n_A / N
  • Triploid (3 copies): f=nA/3Nf = n_A / 3N
  • Tetraploid (4 copies): f=nA/4Nf = n_A / 4N

Bacteria and some fungi are haploid. Some plants, such as certain potatoes and wheat varieties, are triploid or tetraploid.

Interpreting the result

The result is a decimal from 0 (the allele is absent) to 1 (every gene copy in the population is that allele). Rough guides used in genetics:

  • Below 0.05: a rare allele, often a recent mutation or a variant kept rare by natural selection.
  • 0.05 to 0.50: a moderate frequency, common for variants under balancing selection or recent population change.
  • Above 0.95: near fixation, meaning the allele is close to being the only version left in the population.

Sample size affects how much a frequency can be trusted. An estimate from 20 people carries far more uncertainty than the same figure from 2,000 people, especially for rare alleles.

Allele frequency and Hardy-Weinberg equilibrium

The Hardy-Weinberg principle, described independently by G. H. Hardy and Wilhelm Weinberg in 1908, predicts genotype frequencies from allele frequencies in a population that is not evolving. If allele A has frequency p and allele a has frequency q, with p + q = 1, the expected genotype frequencies are:

  • AA: p²
  • Aa: 2pq
  • aa: q²

This prediction only holds when the population meets several conditions: no selection, no new mutations, no migration, random mating, and a very large population. Real populations often break one or more of these rules, so measured genotype frequencies can differ from the Hardy-Weinberg prediction. A frequency of 0.30 for allele A does not automatically mean 9% of the population (0.30²) is homozygous AA; that figure only holds if the population is in equilibrium.

Example: carrier screening for Tay-Sachs disease

Allele frequency data guides real screening programs. Tay-Sachs disease is a severe inherited disorder caused by a recessive allele. A person needs two copies of the allele, one from each parent, to be affected.

In Ashkenazi Jewish populations, roughly 1 in 30 people (about 3.3%) carries one copy of the allele. In the general population, roughly 1 in 300 people (about 0.33%) is a carrier. Carriers are healthy; the allele only causes disease in someone who inherits it from both parents.

If two unrelated Ashkenazi Jewish carriers have a child, the chance the child is affected is 1/4, the standard ratio for a recessive condition when both parents carry one copy. Combined with the chance that two random parents from this population are both carriers, (1/30) × (1/30) × 1/4, the overall risk works out to about 1 in 3,600 births.

In the general population the same calculation, (1/300) × (1/300) × 1/4, gives roughly 1 in 360,000 births. The tenfold difference in carrier frequency between the two populations is why carrier screening is routinely offered to people of Ashkenazi Jewish descent.

Common mistakes

Counting people instead of alleles. Ten people who are homozygous for an allele represent 20 allele copies, not 10.

Assuming Hardy-Weinberg equilibrium without checking. Real populations can deviate from it due to inbreeding, selection, or population structure.

Mixing separate populations. Combining samples from two groups with different allele frequencies produces a pooled number that describes neither group accurately, and can create an apparent excess of homozygotes known as the Wahlund effect.

Using the diploid formula for X-linked genes. Because males carry one X chromosome and females carry two, X-linked allele frequency needs its own formula:

f(XA)=2×(females with XAXA)+females with XAXa+males with XA2×number of females+number of malesf(X^A) = \frac{2 \times (\text{females with } X^AX^A) + \text{females with } X^AX^a + \text{males with } X^A}{2 \times \text{number of females} + \text{number of males}}

Frequently asked questions

What is the difference between an allele and a gene? A gene is a hereditary unit that affects a trait. An allele is one specific version of that gene. The gene for ABO blood type has three common alleles, A, B, and O, and each person carries two of them, one from each parent.

What is the difference between allele frequency and genotype frequency? Allele frequency counts individual gene copies across the population. Genotype frequency counts people by which pair of alleles they carry. In a group of 100 people with 25 AA, 50 Aa, and 25 aa individuals, the AA genotype frequency is 0.25, but the frequency of allele A is 0.50, since it counts every A copy across all three groups.

Why does allele frequency matter in medicine? Diseases caused by recessive alleles are more common in populations where the allele frequency is higher. Knowing the frequency in a specific population lets health services target carrier screening and genetic counseling where they will help the most people.

How many people need to be sampled for a reliable estimate? It depends on how rare the allele is. A common allele, with a frequency between 0.20 and 0.80, can usually be estimated well from 100 to 200 people. A rare allele needs a much larger sample, often several hundred people, because too few copies show up in a small sample to produce a stable estimate.

Can allele frequency change over time? Yes. Natural selection, random genetic drift, migration between populations, and new mutations all shift allele frequencies across generations. Genetic drift has the largest effect in small populations, where chance events can raise or lower a frequency sharply from one generation to the next.

How is allele frequency calculated from genotype counts? Add up all the copies of the allele: each homozygous individual contributes two, each heterozygous individual contributes one. Divide by twice the total number of individuals. The formula is fA=(2nAA+nAB)/2Nf_A = (2n_{AA} + n_{AB}) / 2N.

References

  1. Hardy, G. H. (1908). Mendelian proportions in a mixed population. Science, 28(706), 49–50.
  2. Hartl, D. L., & Clark, A. G. (2007). Principles of Population Genetics (4th ed.). Sinauer Associates.
  3. The 1000 Genomes Project Consortium. (2015). A global reference for human genetic variation. Nature, 526(7571), 68–74.
  4. gnomAD (Genome Aggregation Database). https://gnomad.broadinstitute.org/
  5. National Human Genome Research Institute. https://www.genome.gov/