Hardy-Weinberg Calculator

BIOLOGY GENETICS HARDY-WEINBERG POPULATION
Share:

Hardy-Weinberg calculator — enter one allele frequency (p or q) and get both allele frequencies plus the expected genotype frequencies AA = p², Aa = 2pq and aa = q². For A-Level and IB population genetics. Runs in your browser.

RT-SCI-033 · Science

Hardy-Weinberg Calculator

p + q = 1  ·  p² + 2pq + q² = 1

Enter one allele frequency — p or q — as a value between 0 and 1, and leave the other blank. The calculator finds the other allele and all three genotype frequencies.

Advertisement
After tool · AD-W1Responsive
Tool information
Curriculum
English (global) — Cambridge International + IB
Built against
Cambridge International A-Level Biology 9700 + IB Diploma (2023–2025) — Population genetics
Unit system
SI primary; US/imperial readout below
First published
2 Jun 2026
Last updated
2 Jun 2026

How to Use the Hardy-Weinberg Calculator

Find one allele frequency

Often you start from the recessive phenotype: its frequency equals q² (aa), so q = √(aa). Enter that as q. If you already know p, enter that instead.

Enter p or q

Type one allele frequency between 0 and 1 and leave the other blank — the calculator uses p + q = 1 to find the missing one.

Read the genotype frequencies

The calculator returns AA = p², Aa = 2pq and aa = q², shown as decimals and percentages.

Check against your syllabus

The Tool Information block lists the syllabus this is built against, and the assumptions the equilibrium relies on.

Advertisement
After how-to · AD-W2Responsive

The Hardy-Weinberg Principle

Hardy-Weinberg

Example: In a population, the recessive condition (aa) affects 9% of people, so q² = 0.09. Find the allele and genotype frequencies.

q = √0.09 = 0.3, so p = 1 − 0.3 = 0.7. Then:

AA = 0.7² = 0.49  ·  Aa = 2(0.7)(0.3) = 0.42  ·  aa = 0.3² = 0.09

The Hardy-Weinberg principle describes a population that is not evolving: in the absence of selection, mutation, migration and genetic drift, and with random mating, allele and genotype frequencies stay constant from one generation to the next. For a gene with two alleles whose frequencies are p and q, two equations capture the whole model: p + q = 1 for the alleles, and p² + 2pq + q² = 1 for the genotypes. The three terms are the expected frequencies of the homozygous dominant (AA = p²), heterozygous (Aa = 2pq) and homozygous recessive (aa = q²) genotypes.

In practice you usually work backwards from what you can see. The recessive phenotype is the only genotype you can identify by sight, and its frequency equals q², so taking the square root gives the recessive allele frequency q; the dominant allele frequency is then p = 1 − q. From p and q you can predict how many carriers (heterozygotes) the population should contain — a number that is invisible to direct observation but important in genetic counselling. The principle is a null model: comparing observed genotype counts with these expected frequencies is how biologists detect that some evolutionary force is actually at work. All calculation happens in your browser — nothing you type is uploaded, and the tool works offline once loaded.

Hardy-Weinberg is the "nothing is happening" baseline of evolution — and departures from it are how we spot that something is.

10 Facts About Hardy-Weinberg

01

Allele equation: p + q = 1.

02

Genotype equation: p² + 2pq + q² = 1.

03

AA = p²,  Aa = 2pq,  aa = q².

04

The recessive allele frequency is q = √(aa).

05

Heterozygotes (carriers) have frequency 2pq.

06

Derived independently by Hardy and Weinberg in 1908.

07

It assumes no selection, mutation, migration or drift.

08

It also assumes random mating and a large population.

09

It is a null model — a baseline of no evolution.

10

This calculator runs in your browser — your working stays private.

Frequently Asked Questions

  • It states that in a large, randomly mating population with no selection, mutation, migration or genetic drift, allele and genotype frequencies remain constant across generations. It is captured by two equations: p + q = 1 for the two allele frequencies, and p² + 2pq + q² = 1 for the genotype frequencies.
  • p is the frequency of the dominant allele and q is the frequency of the recessive allele for a gene with two alleles. Because every allele in the population is one or the other, they must sum to one: p + q = 1. Enter either and the calculator finds the other.
  • The homozygous recessive genotype (aa) is the only one you can identify by phenotype, and its frequency equals q². So q is the square root of the proportion showing the recessive trait. For example, if 9% of a population is affected, q = √0.09 = 0.3.
  • 2pq is the expected frequency of heterozygotes — carriers who have one dominant and one recessive allele. The factor of two appears because a heterozygote can be formed in two ways (dominant from one parent and recessive from the other, or vice versa). Carriers are invisible to the eye, which is why the calculation matters in genetic counselling.
  • Yes. Enter whichever allele frequency you know, p or q, and leave the other blank. The calculator applies p + q = 1 to find the missing allele frequency and then computes all three genotype frequencies.
  • Hardy-Weinberg equilibrium assumes a large population, random mating, and no selection, no mutation, no migration and no genetic drift. Real populations rarely meet all of these perfectly, so the principle works as a baseline against which real data are compared rather than as a literal description.
  • Because it predicts what genotype frequencies would be if nothing were driving evolutionary change. When observed counts differ significantly from the Hardy-Weinberg expectation, that difference is evidence that one of the assumptions is broken — for instance that selection or non-random mating is occurring.
  • The Tool Information block lists the exact syllabus — Cambridge A-Level Biology 9700 and IB Diploma population genetics. It is a study aid for checking your working, not a substitute for your official syllabus or teacher.
  • No. Every calculation runs in your browser; nothing you type is uploaded. The tool works offline once the page has loaded.
  • Completely free, with no account or usage limit. It runs entirely in your browser, collects no data, and works offline once loaded.

Related News

You may be interested in these recent stories from our newsroom.

No related news yet for this tool. Our editorial team publishes new pieces every week.

Browse all news →
Advertisement
Pre-footer · AD-W3 728 × 90

75 more free tools

Calculators, converters, security tools — no signup.