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.
The tool then divides the instance count by twice the population size. It shows the result as a decimal between 0 and 1, rounded to four decimal places. It rejects an instance count above 2N, since that many copies cannot exist in a diploid population of that size. It also rejects negative numbers, decimals that are not whole numbers, and 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 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. Many crop plants carry more than two copies of each chromosome.
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 value close to 0 marks a rare allele. A value close to 1 means the allele is near fixation: it 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, stated by English mathematician Godfrey Hardy and German physician Wilhelm Weinberg, 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 of the HEXA gene. A person needs two copies of the allele, one from each parent, to be affected. Carriers have one copy and are healthy.
Among people of Ashkenazi Jewish descent, the carrier frequency is about 1 in 25. If two carriers have a child, the chance the child is affected is 1/4, the standard ratio for a recessive condition. For two parents picked at random from this group, the risk is (1/25) × (1/25) × 1/4, or about 1 in 2,500 births.
The same study reports a Tay-Sachs incidence of one in 3,900 births in Jewish people, compared with one in 320,000 births in the general population. Hardy-Weinberg turns the general-population figure into an allele frequency. If q² = 1/320,000, then q ≈ 0.0018. The carrier frequency 2pq is then about 0.0035, or roughly 1 in 280 people. This gap in allele frequency between groups 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 can be estimated fairly well from a modest sample. A rare allele needs a much larger sample, 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
- OpenStax. Biology 2e, 19.1 Population Evolution. Population evolution — definition of allele frequency, the Hardy-Weinberg principle (p + q = 1; p², 2pq, q²) and its assumptions.
- Lew, R. et al. Tay-Sachs disease preconception screening in Australia. Journal of Community Genetics. Tay-Sachs screening in Australia — carrier frequency of about 1:25 in Ashkenazi Jewish people; incidence of one in 3,900 births in Jewish people versus one in 320,000 in the general population.