Hardy–Weinberg Calculator
Compute p, q and expected genotype frequencies for a two-allele diploid locus. Choose the information you have and see each substitution.
Enter your values or load an example. Calculations stay in this browser.
What p and q mean
p and q describe allele frequencies, with p + q = 1. Under equilibrium, p², 2pq and q² describe the expected genotype frequencies.
Starting from a recessive genotype
The square-root step q = √q² assumes equilibrium. A phenotype frequency only equals q² when the biological model makes that correspondence valid.
Starting from genotype counts
Count AA, Aa and aa individuals. The allele-count calculation uses two copies per individual; it does not itself test whether observed counts fit equilibrium.
Interpret expected counts
Expected counts need not be whole numbers. A mismatch with observations needs an appropriate statistical test, sampling context and a check of the genetic model.
References
Related free tools
Frequently Asked Questions
Can this test equilibrium?
No. It computes expectations and allele frequencies. It does not provide a significance test or claim the assumptions hold.
Are p and q percentages?
Enter fractions from zero to one. The result also shows genotype percentages.
Does it support more than two alleles?
No. This calculator covers a single diploid locus with two alleles.
Can I use this for personal medical risk?
No. It is a population-genetics teaching tool, not a clinical or individual risk assessment.
