Hardy-Weinberg Equilibrium Calculator
Enter any single known value, the dominant allele frequency p, the recessive allele frequency q, the AA genotype frequency or the aa genotype frequency, and this calculator returns the full set of Hardy-Weinberg genotype frequencies. It assumes p plus q equals 1, then reports AA (p squared), Aa (2pq) and aa (q squared), which always sum to 1. All math runs in your browser.
How to use the Hardy-Weinberg calculator
- Open the I know menu and choose which value you have: p, q, the AA frequency or the aa frequency.
- Type that single value into the Value box as a frequency between 0 and 1.
- Read the derived allele frequencies p and q in the first two cells.
- Read the AA, Aa and aa genotype frequencies in the highlighted cells.
- Check the line below confirming the three genotype frequencies sum to 1, then click Copy.
Examples
From the dominant allele frequency
I know p = 0.6
p = 0.6, q = 0.4, AA = 0.36, Aa = 0.48, aa = 0.16
From the recessive genotype frequency
I know aa = 0.16
p = 0.6, q = 0.4, AA = 0.36, Aa = 0.48, aa = 0.16
From the homozygous dominant genotype
I know AA = 0.49
p = 0.7, q = 0.3, AA = 0.49, Aa = 0.42, aa = 0.09
Frequently asked questions
What is the Hardy-Weinberg equation?
It is p squared plus 2pq plus q squared equals 1, where p is the dominant allele frequency and q is the recessive allele frequency. The three terms are the expected frequencies of the AA, Aa and aa genotypes when a population is in equilibrium at a single two-allele locus.
How does the calculator work from just one value?
The model assumes p plus q equals 1, so knowing one allele frequency fixes the other. If you enter p it sets q to 1 minus p; if you enter q it sets p to 1 minus q. From those it computes AA as p squared, Aa as 2pq and aa as q squared.
How do I find p and q from genotype frequencies?
Take the square root of the AA frequency to recover p, or the square root of the aa frequency to recover q. The other allele frequency is one minus that result. This works because AA equals p squared and aa equals q squared, so p equals sqrt(AA) and q equals sqrt(aa).
Why do the three genotype frequencies add up to one?
Because p plus q equals 1, squaring both sides expands (p + q) squared into p squared plus 2pq plus q squared, which therefore also equals 1. The three genotypes AA, Aa and aa are mutually exclusive and cover every individual, so their frequencies must total 1.
What assumptions does Hardy-Weinberg make?
It assumes an infinitely large, randomly mating population with no mutation, no migration, no natural selection and no genetic drift. It also assumes non-overlapping generations and equal allele frequencies in both sexes. Real populations only approximate these conditions, so the equilibrium is a null model rather than an exact description.
Why can I only enter one value at a time?
The equilibrium is fully determined by a single allele or genotype frequency, so supplying more than one could be contradictory. The tool accepts exactly one input, and the underlying engine rejects a request that provides two or more values at once.
Can I use percentages instead of decimals?
Enter every value as a decimal frequency between 0 and 1. A genotype seen in 16 percent of a population is 0.16, so type 0.16 rather than 16. Values outside 0 to 1 are rejected because a frequency cannot be negative or exceed the whole population.
How can I tell if a population is actually in equilibrium?
This calculator gives the expected frequencies, not a statistical test. To decide whether real counts fit, compare the observed genotype numbers with these expected numbers using a chi-square goodness-of-fit test. A large deviation suggests selection, non-random mating or another force is acting on the locus.
Is my data kept private?
Yes. The calculation is pure arithmetic performed locally in your browser, and no allele or genotype value is uploaded to a server. Nothing you enter leaves your device.
Learn more
- Estimating carrier frequency with Hardy-Weinberg
How to turn the frequency of a recessive disease into carrier and allele frequencies using the Hardy-Weinberg equation, with a worked example.
Related tools
Punnett Square Calculator
Build a monohybrid Punnett square from two parent genotypes. See the 2x2 cross grid, genotype ratios like 1:2:1 and the dominant to recessive split.
Allele Frequency Calculator
Find allele frequencies from genotype counts. Enter the number of AA, Aa and aa individuals to get the A and a allele frequencies and allele totals.
DNA to mRNA Converter
Transcribe a DNA sequence into mRNA online. Pick the coding or template strand, get the base for base RNA result, and view the complementary DNA strand.
555 Timer Calculator
Calculate 555 timer astable frequency, period, high and low times and duty cycle from R1, R2 and the timing capacitor. Free oscillator design helper.
Absolute Humidity Calculator
Calculate absolute humidity in grams of water vapor per cubic meter from air temperature and relative humidity. Fast, free and works in your browser.
Angular Acceleration Calculator
Find angular acceleration from a change in angular velocity over time, and the torque from a moment of inertia. Enter start and end rad/s and the time.