🔬
🔬 Science & engineering

Allele Frequency Calculator (2 or 3 alleles from genotype counts, heterozygosity)

Results update as you type.

Your numbers

Understanding the allele frequency calculator — concept and principle

Allele frequency is the share of all gene copies in a population that carry a particular variant. This calculator counts alleles directly from the numbers of each genotype for a gene with up to three alleles, and compares observed and expected heterozygosity.

Counting allele copies in 120 individualsCounting allele copies in 120 individualsCounting allele copies in 120 individualsA1140 / 240 = 0.583A260 / 240 = 0.25A340 / 240 = 0.167Observed het. 0.50 vs expected 0.569
Homozygotes add two copies and heterozygotes one: A1 has 140 of 240 copies, p = 0.5833.

How it is calculated

The principle

Each homozygote carries two copies of the same allele and each heterozygote carries one copy of each of its two alleles. Adding up copies and dividing by the total gives each allele's frequency exactly, as long as every genotype can be told apart (codominant markers or DNA genotyping). Under Hardy–Weinberg proportions, the chance that an individual inherits two different alleles is 1 minus the chance of two identical ones, which gives He. A large shortfall of observed heterozygotes can indicate inbreeding or population structure.

Worked example

Default inputs: A1A1 45, A2A2 10, A3A3 5, A1A2 30, A1A3 20, A2A3 10.

  1. N = 120 individuals; 2N = 240 allele copies.
  2. p = (2 × 45 + 30 + 20) ÷ 240 = 140 ÷ 240 ≈ 0.5833.
  3. q = (2 × 10 + 30 + 10) ÷ 240 = 60 ÷ 240 = 0.25; r = (2 × 5 + 20 + 10) ÷ 240 = 40 ÷ 240 ≈ 0.1667.
  4. Observed heterozygosity = (30 + 20 + 10) ÷ 120 = 0.5.
  5. Expected heterozygosity = 1 − (0.3403 + 0.0625 + 0.0278) ≈ 0.5694.
How Frequency of A₁ (p) changes with A₁A₃ individualsHow Frequency of A₁ changes with A₁A₃ in…0.570.5750.580.5850.590.5950.65101520253040Example: 0.5833A₁A₃ individuals
Each point is the calculator re-run with only “A₁A₃ individuals” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
A₁A₃ individualsFrequency of A₁ (p)
50.5952
100.5909
150.587
200.5833
250.58
300.5769
400.5714

How to read the result

Here Ho (0.50) is somewhat below He (0.57). Whether that difference is meaningful needs a statistical test, because sampling alone produces deviations. Allele frequencies track how populations change through selection, drift, migration and mutation.

Common mistakes

Keep in mind: The calculation assumes accurate genotyping and a diploid organism. Population-genetic inferences need appropriate statistical tests.

Frequently asked questions

How do you calculate allele frequency?

Count the copies of the allele (two per homozygote, one per heterozygote) and divide by twice the number of individuals.

What is expected heterozygosity?

The share of heterozygotes predicted under random mating: 1 − Σ pi².

What does low observed heterozygosity mean?

It can point to inbreeding, population subdivision or genotyping errors; a formal test is needed.

Sources: Hartl, D. L. & Clark, A. G., Principles of Population Genetics, 4th ed. Sinauer · Nei, M. (1973). Analysis of Gene Diversity in Subdivided Populations. PNAS, 70(12).

Checked 9 Nov 2026. Standard population-genetics gene-counting estimator of allele frequencies and expected heterozygosity (gene diversity) H = 1 − Σpi² (M. Nei, 1973), as taught with the Hardy–Weinberg principle in introductory biology texts (e.g. OpenStax Biology 2e, §19.1).

🔬 All science & engineering tools →🌍 Calculators by country →