Hardy Weinberg calculator for allele and genotype frequencies
This Hardy Weinberg calculator uses the two equations from OpenStax Biology: p + q = 1 and p² + 2pq + q² = 1. Example from the book: 245 YY, 210 Yy and 45 yy pea plants give p = 0.7 and q = 0.3, and the expected genotype frequencies 0.49, 0.42 and 0.09.
Example: Start from: genotype counts (AA, Aa, aa) · Homozygous dominant AA 245 · Heterozygous Aa 210 · Homozygous recessive aa 45 → Allele frequencies: p = 0.7, q = 0.3 · heterozygous 42 %. Source: OpenStax Biology 2e, 19.1 Population Evolution: Hardy-Weinberg principle, p + q = 1 and p² + 2pq + q² = 1; example 500 pea plants (245 YY, 210 Yy, 45 yy) → p = 0.7, q = 0.3, genotype frequencies 0.49 / 0.42 / 0.09; assumes a very large population without mutation, migration or selection (read 10.10.2026). Updated: .
How it is calculated
p + q = 1 and p² + 2pq + q² = 1. In OpenStax Biology p stands for the frequency of the dominant allele and q for the recessive one. If alleles combine at random, p² of the population is homozygous dominant, 2pq heterozygous and q² homozygous recessive. The principle assumes a very large population with no mutation, migration or selection; real populations are compared against it.
The OpenStax example
A population of 500 pea plants has 245 YY, 210 Yy and 45 yy. Each plant carries two alleles, so the gene pool has 1000 alleles. Y alleles: 2 × 245 + 210 = 700, so p = 700 ÷ 1000 = 0.7; y alleles: 210 + 2 × 45 = 300, so q = 0.3. Expected frequencies: p² = 0.49, 2pq = 0.42, q² = 0.09 – exactly 245, 210 and 45 of 500 plants, so this population is in equilibrium.
From the recessive phenotype to carriers
| Recessive share q² | q | p | Carriers 2pq |
|---|---|---|---|
| 9 % | 0.3 | 0.7 | 42 % |
| 1 % | 0.1 | 0.9 | 18 % |
| 0.04 % (1 in 2500) | 0.02 | 0.98 | 3.92 % (about 1 in 25.5) |
Only the homozygous recessive genotype can be seen from the phenotype, as OpenStax notes; the calculation gives the rest. A rare recessive trait therefore has many more hidden carriers: at q² = 1 in 2500, almost 4 % of people carry the allele. Whether observed genotype counts fit the expected ones is tested with the chi-square test calculator; the basics of combining probabilities are in the probability calculator.
Frequently asked questions
What do p and q mean in Hardy-Weinberg?
p is the frequency of the dominant allele, q that of the recessive allele. With only two alleles, p + q = 1.
How do I find p and q from genotype counts?
Count the alleles: p = (2 × AA + Aa) ÷ (2 × total). For 245, 210 and 45 plants: (490 + 210) ÷ 1000 = 0.7, q = 0.3.
How do I get q from the recessive phenotype?
q = √q². If 9 % show the recessive trait, q = √0.09 = 0.3 and p = 0.7.
How many carriers are there?
Carriers are the heterozygotes, 2pq. With p = 0.7 and q = 0.3 that is 0.42, i.e. 42 %.
What are the conditions of Hardy-Weinberg equilibrium?
A very large population with no mutation, no migration and no selection for or against a genotype. No real population meets them completely.
How do I test whether a population is in equilibrium?
Compare the observed genotype counts with the expected ones (p², 2pq, q² times the population size), for example with a chi-square test.
Sources and legal basis
As of: · Editorial policy
Related tools
- Punnett square calculator with genotype and phenotype ratiosPunnett square calculator for monohybrid, dihybrid and trihybrid crosses: enter both parents (e.g. AaBb) and get gametes, grid and genotype/phenotype ratios.
- Chi Square Test CalculatorChi square test calculator for contingency tables and goodness of fit: chi², degrees of freedom, p-value, expected counts and Cramér’s V, with all steps.
- Probability calculatorProbability calculator: favourable over possible outcomes, two events, repeated trials (binomial) and drawing without replacement, like a lottery.
- Blood type calculator: which blood types can the child have?Blood type calculator for parents: possible ABO blood types and Rh factor of a child, with Punnett square percentages for every genotype combination.
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- CGPA calculator for Nigerian universities (5-point scale)CGPA calculator Nigeria: enter each course with its grade or score and credit units to get your GPA or CGPA on the 5.0 scale, the class of degree and the steps.
- 555 timer calculator: frequency, duty cycle and pulse width555 timer calculator for astable and monostable mode: frequency, period, high and low time and duty cycle from RA, RB and C, or the pulse width from R and C.
- NPSH calculator: NPSH available (NPSHA) and margin to NPSHRNPSH calculator for centrifugal pumps: NPSHA from tank pressure, vapour pressure, liquid level and suction losses, compared with the pump’s NPSHR.
- Lakh to Million and Crore to Million / Billion ConverterLakh to million converter: change lakh and crore into million, billion and trillion or back, with Indian commas (1,00,000), the number in words and a table.