StatGardenREF. DESK
Calculators/Biology/Allele frequency from genotype counts
Biology

Allele frequency from genotype counts calculator

Direct-count allele frequencies for a two-allele gene from observed genotype numbers in a sample.

Published 8 August 2026 · Updated 24 September 2026

What this calculator does

Allele frequencies come from counting alleles rather than individuals. Each individual carries two, so a sample of N individuals holds 2N alleles. A homozygote contributes two of the same, a heterozygote one of each.

That gives p = (2 × AA + Aa) ÷ 2N and q = (2 × aa + Aa) ÷ 2N. This is a direct count from observed data, with no model assumed, which makes it the figure to calculate first and then compare against Hardy-Weinberg expectations rather than the other way round.

The formula

Formulap = (2·N_AA + N_Aa) / 2N; q = (2·N_aa + N_Aa) / 2N

The total allele count is twice the number of individuals. Dominant alleles are counted as two from each homozygous dominant individual plus one from each heterozygote, and the same logic applies to the recessive count. Each is divided by the total to give a frequency, and the two frequencies sum to one.

TermMeaning
pDominant allele frequency, counted directly from the genotypes observed.
qRecessive allele frequency. p + q = 1 for a locus with two alleles.
2NTotal alleles in the sample, twice the number of individuals since each is diploid.
Genotype countThe number of individuals of each of the three genotypes, which is the raw observation.

The inputs explained

FieldWhat to enter
Homozygous dominant count (AA)Number of homozygous dominant individuals (AA).
Heterozygous count (Aa)Number of heterozygous individuals (Aa).
Homozygous recessive count (aa)Number of homozygous recessive individuals (aa).

When to use it

Analysing genotyping results

Genotype counts are what a sequencing or typing run produces, and allele frequencies are what population genetics works in, so this conversion is the first step in almost any analysis.

Testing for Hardy-Weinberg equilibrium

Calculate the frequencies from the observed counts here, then feed q into the Hardy-Weinberg calculator to get expected genotype proportions and compare the two.

Tracking frequencies over time

Repeating the calculation on samples from successive generations shows whether an allele is rising or falling, which is the direct evidence of selection or drift.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

What allele frequencies do these genotype counts give?

Three genotype distributions, with the heterozygote and recessive counts held fixed while the homozygous dominant count changes.

Aa fixed at 40, aa fixed at 10
AA count (Aa held at 40, aa at 10)Dominant allele frequency (p)Recessive allele frequency (q)Individuals sampledAlleles sampled (2N)
500.70000.3000100200
250.60000.400075150
900.78570.2143140280
Only the AA count changes down the table, so the sample size grows with it, from 75 individuals to 140. Adding homozygous dominant individuals pushes p from 0.600 up to 0.786 and q down to match. The alleles column is twice the individuals column in every row, which is the check worth making on any allele count.

Questions

Why multiply the homozygote count by two?

Because each homozygous individual carries two copies of the same allele. A heterozygote carries one of each, so it contributes one to each count. Counting individuals rather than alleles is the most common error in these calculations.

Do p and q always add to one?

For a locus with exactly two alleles, yes, by construction. Loci with three or more alleles need a frequency for each and they sum to one collectively, which this two-allele calculator does not handle.

Is this the same as Hardy-Weinberg?

No, and the distinction matters. This counts what is actually there, assuming nothing. Hardy-Weinberg predicts what genotype frequencies should be given those allele frequencies if the population is in equilibrium. Calculating the first and comparing against the second is how equilibrium is tested.

How large a sample do I need?

Larger than is usually convenient, particularly for rare alleles. Estimating a frequency of 0.01 reliably needs hundreds of individuals simply to observe the allele more than once or twice. Small samples give frequencies with very wide confidence intervals.

For expected genotype frequencies from an allele frequency, see the Hardy-Weinberg calculator. For multi-gene cross probabilities, see the multi-gene cross calculator.