Biology · Population genetics

Allele frequency calculator.

Enter how many individuals have each genotype and get allele frequencies, genotype frequencies and heterozygosity for two to four alleles.

2 to 4 allelesGenotype frequenciesHeterozygosity and FChecked 8 October 2026

Advertisement

Inputs

Allele and genotype frequencies

Enter genotype counts.

Counting alleles

Every diploid individual carries two copies of a gene, so a sample of N individuals has 2N gene copies. A homozygote contributes two copies of one allele and a heterozygote one copy each of two alleles. An allele's frequency is its number of copies divided by 2N (Wikipedia, Allele frequency). Observed heterozygosity is the share of heterozygotes in the sample. Expected heterozygosity is 1 minus the sum of squared allele frequencies, which is 2pq for two alleles, and the inbreeding coefficient is F = 1 − observed / expected heterozygosity (Wikipedia, Hardy-Weinberg principle).

Worked example. Wikipedia samples 10 individuals with 6 AA, 3 AB and 1 BB. There are 6 × 2 + 3 = 15 copies of A and 1 × 2 + 3 = 5 of B among 20 gene copies, so p = 0.75 and q = 0.25. The observed heterozygosity is 0.30, the expected 2pq = 0.375 and F = 0.20.

Frequently asked questions

How do I calculate allele frequency from genotype counts?

Add two copies for each homozygote and one for each heterozygote carrying the allele, then divide by twice the number of individuals.

What is the difference between allele frequency and genotype frequency?

Allele frequency counts gene copies (for example how many A copies in the population); genotype frequency counts individuals with a given genotype (for example how many AB).

What does a positive F mean?

F = 1 - observed / expected heterozygosity. Positive values mean fewer heterozygotes than Hardy-Weinberg proportions predict.

Can I enter phenotype counts instead?

Only if each phenotype maps to one genotype, as with codominant markers. For dominant and recessive phenotypes, use the Hardy-Weinberg calculator's q squared mode.

Can I use it for X-linked genes?

No. Males carry one X copy, so the counting differs. This tool is for autosomal genes.

Sources

Checked

Runs entirely in your browser. Nothing you type is sent or stored.

Teaching model, not advice

Descriptive statistics for a sample. Small samples give uncertain estimates of population frequencies.

Advertisement
Advertisement