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
Allele frequency is the share of one gene version among all gene copies in a population. Enter the number of individuals and the number of allele copies. A homozygous individual contributes 2 copies, a heterozygous individual contributes 1.
Population Data
Results
Calculation Formula
f = 50 / (100 × 2) = 0.2500
Allele Frequency Visualization
Allele Pool (one dot per gene copy)
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:
- is the allele frequency, a value between 0 and 1
- is the number of copies of the allele found in the population
- is the number of individuals
- 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.
Both fields take whole numbers. The tool divides the instance count by twice the population size and shows the result as a decimal between 0 and 1, rounded to four places. It reports an error for a fraction in either field, for a negative instance count, for a population of zero or fewer, and for an instance count above 2N, since that many copies cannot exist in a diploid population of that size. No frequency is shown while a field is empty or in error.
Below the result the tool draws a dot grid of the allele pool. One dot stands for one gene copy, so the grid holds 2N dots, and the coloured dots are the copies of the allele being studied. For populations larger than 50 individuals the grid caps at 100 dots and shows the same proportion.
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 people are homozygous for allele A and are heterozygous, out of N total people:
From genotype frequencies. If the proportions of each genotype are already known:
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):
- Triploid (3 copies):
- Tetraploid (4 copies):
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). A frequency above 0.5 means the allele is the more common version at that spot in the genome. Geneticists often quote the minor allele frequency instead, which is the frequency of the rarer version: for two alleles it is the smaller of f and 1 - f.
Rough guides used in genetics:
- Below 0.05: a rare allele. Many rare variants are recent mutations, or are kept rare by natural selection.
- 0.05 to 0.95: a common variant, present in a noticeable share of the population.
- 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:
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 .
References
- Hardy, G. H. (1908). Mendelian proportions in a mixed population. Science, 28(706), 49–50.
- Hartl, D. L., & Clark, A. G. (2007). Principles of Population Genetics (4th ed.). Sinauer Associates.
- The 1000 Genomes Project Consortium. (2015). A global reference for human genetic variation. Nature, 526(7571), 68–74.
- gnomAD (Genome Aggregation Database). https://gnomad.broadinstitute.org/
- National Human Genome Research Institute. https://www.genome.gov/