Free, forever – no sign-up, calculations stay in your browser. About me →
Biology · Genetics

Allele frequency calculator.

Find allele frequencies from genotype counts. Enter how many individuals are homozygous dominant, heterozygous and homozygous recessive to get p, q and the Hardy-Weinberg expected frequencies.

By Jean Borg · Founder & developerfreecalculators.pro · Malta · Updated June 2026
Allele frequencies p and q Hardy-Weinberg expected Your data stays private

Genotype counts

Live

p is the dominant allele frequency, q the recessive, and p + q = 1. The expected genotype frequencies assume Hardy-Weinberg equilibrium.

Dominant allele (p)

0.714

frequency of the dominant allele

Recessive allele (q)0.286
Expected AA (p2)0.510
Expected Aa (2pq)0.408
Expected aa (q2)0.082

Assumes Hardy-Weinberg equilibrium. For education and lab estimates. Calculations run in your browser; nothing you enter is stored.

How it works

Counting alleles

Allele frequency is the share of all gene copies in a population that are a given allele. Each individual carries two copies, so you count alleles, not people. The dominant allele frequency p is twice the homozygous dominant count plus the heterozygous count, divided by twice the total.

With 80 AA, 40 Aa and 20 aa, that is (160 + 40) over 280, which is p = 0.714, so q is 0.286. From those, Hardy-Weinberg predicts the genotype frequencies as p squared, 2pq and q squared.

Reference

Dominant allele to affected.

Under Hardy-Weinberg, the frequency of the recessive (affected) genotype is q squared.

Dominant allele pAffected q2
0.950.0025
0.900.0100
0.700.0900
0.500.2500
0.300.4900

The full guide

The complete guide to allele frequency.

What allele frequency is, how to count it, and how Hardy-Weinberg links alleles to genotypes.

What is allele frequency?

Allele frequency is how common an allele is in a population, written as a proportion between 0 and 1. Because everyone carries two copies of a gene, you work in alleles: a population of 100 has 200 copies. The two frequencies, p and q, always add to 1.

It is the foundation of population genetics, used to track how common a trait or variant is and whether it is changing over generations.

How to count alleles

Each homozygous dominant individual contributes two dominant alleles, each heterozygote one dominant and one recessive, and each homozygous recessive two recessive. So p is twice the AA count plus the Aa count, all over twice the total number of individuals.

The recessive frequency q is simply 1 minus p, or you can count it the same way from the recessive alleles.

Hardy-Weinberg equilibrium

The Hardy-Weinberg principle says that in a large, randomly mating population with no selection, mutation or migration, allele frequencies stay constant and the genotype frequencies are p squared for homozygous dominant, 2pq for heterozygous and q squared for homozygous recessive.

Comparing these expected frequencies with what you actually observe shows whether a population is in equilibrium or whether some force is acting on it.

Using the numbers

A common use is estimating carrier frequency for a recessive condition: if q squared is the frequency of affected individuals, then q is its square root and 2pq estimates the carriers. This is how genetic counsellors gauge risk in a population.

Enter your counts above to get p, q and all three expected genotype frequencies at once.

The formula

Count the
alleles.

p is (2 times AA plus Aa) over twice the total. Hardy-Weinberg then gives p squared, 2pq and q squared.

Try Punnett squares ›
allele_freq
# Allele frequencies
p = (2·AA + Aa) / (2·total)
q = 1 − p

# Hardy-Weinberg genotypes
AA = p^2   Aa = 2pq   aa = q^2

Questions

Allele questions.

How do I calculate allele frequency?

+

Count alleles, not people. The dominant frequency p is twice the homozygous dominant count plus the heterozygous count, divided by twice the total individuals. The recessive frequency q is 1 minus p.

What is p and q?

+

p is the frequency of the dominant allele and q the frequency of the recessive allele. They always add up to 1, since every gene copy is one or the other.

What are the Hardy-Weinberg frequencies?

+

Under equilibrium the genotype frequencies are p squared for homozygous dominant, 2pq for heterozygous and q squared for homozygous recessive, and these add up to 1.

How do I find carrier frequency?

+

If q squared is the frequency of affected individuals, take its square root to get q, then 2pq gives the carrier frequency. This is common in genetic counselling.

Is this allele frequency calculator free?

+

Yes. It is completely free with no sign-up, and every calculation runs locally in your browser, so nothing you enter is stored or sent anywhere.

About the developer

Jean Borg

Jean builds and maintains every calculator on freecalculators.pro from Malta, with a focus on tools that are fast, free and show their working. The allele frequency calculator uses Hardy-Weinberg genetics and is for education and lab estimates.