Expected Heterozygosity Calculator

Expected heterozygosity (He), also known as gene diversity, measures the genetic variation at a locus. It is the probability that two alleles sampled at random from the population are different. Under the Hardy-Weinberg model with two alleles at frequencies p and q, He equals 1 minus the sum of the squared frequencies, which simplifies to 2pq. This calculator takes the frequency of the first allele, derives the second, and reports expected heterozygosity, homozygosity, and the 2pq value so you can quantify diversity at a single biallelic locus.

0.00
0.00
0.00
0.00

Expected heterozygosity formula

q = 1 - p
Homozygosity = p^2 + q^2
He = 1 - (p^2 + q^2)
For two alleles: He = 2pq

Allele frequencies are proportions between 0 and 1. With only two alleles, the second frequency q is fixed once p is known. Expected heterozygosity reaches its maximum of 0.5 when both alleles are equally common (p = q = 0.5).

Population genetics context

  • Expected heterozygosity is widely used to compare genetic diversity across populations and species.
  • He ranges from 0 (one allele fixed) to a maximum that depends on the number of alleles; for two alleles the maximum is 0.5.
  • The 2pq term is also the Hardy-Weinberg expected proportion of heterozygous genotypes.
  • Comparing observed heterozygosity to expected heterozygosity can reveal inbreeding (Ho below He) or other departures from equilibrium.
  • For loci with more than two alleles, sum the squared frequencies of all alleles and subtract from 1.

Expected heterozygosity: frequently asked questions

What is expected heterozygosity?

Expected heterozygosity (He), also called gene diversity, is the probability that two alleles drawn at random from a population are different. For a locus it equals 1 minus the sum of the squared allele frequencies. It is a standard measure of genetic diversity used in population genetics.

What is the formula for expected heterozygosity?

For a locus with allele frequencies p1, p2, ... pk, expected heterozygosity He = 1 minus the sum of pi squared. For two alleles with frequencies p and q (where p plus q equals 1), this simplifies to He = 1 minus (p squared plus q squared), which also equals 2pq.

What is homozygosity?

Homozygosity is the complement of heterozygosity: the probability that two randomly drawn alleles are identical. It equals the sum of the squared allele frequencies. Homozygosity plus heterozygosity always equals 1.

Do the allele frequencies need to sum to 1?

Yes. Allele frequencies at a single locus are proportions and must sum to 1. This calculator uses two alleles, so it derives q as 1 minus p when you enter p, and you can confirm both values. If your entered frequencies do not sum to 1, recheck your allele counts.

Is this the same as observed heterozygosity?

No. Observed heterozygosity (Ho) is the actual proportion of heterozygous individuals counted in a sample. Expected heterozygosity (He) is what Hardy-Weinberg equilibrium predicts from allele frequencies. Comparing Ho and He helps detect inbreeding or other departures from equilibrium.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.