Hardy-Weinberg Calculator
Enter the dominant allele frequency p and the calculator returns the three genotype frequencies — p², 2pq and q² — that a population in Hardy-Weinberg equilibrium should show.
All three genotypes at once
Enter the dominant allele frequency p and the calculator returns the homozygous dominant (p²), heterozygous (2pq) and homozygous recessive (q²) frequencies together.
Use a value 0 to 1
p is a frequency, not a percentage — enter 0.6, not 60. The recessive allele frequency is then q = 1 − p, and the three genotypes always add up to 1.
What is the Hardy-Weinberg equilibrium?
From allele frequencies to genotype frequencies
The Hardy-Weinberg calculator predicts how a single gene's two alleles distribute across the three possible genotypes in an idealised population. Given the dominant allele frequency p, the recessive allele frequency is q = 1 − p, and the genotype frequencies are p² for homozygous dominant, 2pq for heterozygous, and q² for homozygous recessive. The principle, stated independently by G. H. Hardy and Wilhelm Weinberg in 1908, says these frequencies stay constant from one generation to the next as long as no evolutionary force disturbs them. It is the baseline against which real populations are compared to detect selection, drift, or non-random mating.
Enter the dominant allele frequency p as a value between 0 and 1 to get the three genotype frequencies (p², 2pq, q²) instantly.
The recessive allele frequency is one minus p, and each genotype frequency comes from squaring or multiplying the two allele frequencies.
p² + 2pq + q² = 1Here p is the dominant allele frequency and q = 1 − p is the recessive allele frequency. Squaring p gives the homozygous dominant frequency, the cross term 2pq gives the heterozygous frequency, and squaring q gives the homozygous recessive frequency. Because the three terms are the full expansion of (p + q)², they always sum to exactly 1.
Suppose the dominant allele frequency in a population is p = 0.6.
Find the recessive allele frequency
q = 1 − 0.6 = 0.4 — the frequency of the recessive allele.
Homozygous dominant and recessive
p² = 0.6² = 0.36 and q² = 0.4² = 0.16 — the two homozygous frequencies.
Heterozygous and check the sum
2pq = 2 × 0.6 × 0.4 = 0.48, and 0.36 + 0.48 + 0.16 = 1, confirming the frequencies are consistent.
The three frequencies answer different biological questions. The homozygous recessive frequency q² is usually the most useful starting point, because for a recessive trait it equals the proportion of individuals who actually show the phenotype — affected individuals. With p = 0.6 above, q² = 0.16 means 16% of the population displays the recessive trait. The heterozygous frequency 2pq = 0.48 counts the carriers: individuals who carry one recessive allele but do not show the trait, which matters enormously for recessive genetic conditions because carriers vastly outnumber affected individuals when the recessive allele is rare. The homozygous dominant frequency p² = 0.36 rounds out the population. A common workflow runs the calculation backwards in practice: you observe the affected fraction q², take its square root to get q, and then read off how many people are silent carriers — a number that is invisible from the phenotypes alone.
The equation is exact, but it describes an idealised population that real populations only approximate.
The equilibrium assumes no evolution is happening
Hardy-Weinberg frequencies hold only when five conditions are met: random mating, no natural selection, no migration in or out, no new mutations, and a large enough population that genetic drift is negligible. Real populations break these assumptions to some degree, so the calculator gives the expected frequencies for an undisturbed population rather than a guaranteed snapshot of any specific one. It also covers a single gene with two alleles and simple dominance — multiple alleles, linked genes, or sex-linked traits need extended models.