Chemistry & Biology

Hardy Weinberg Calculator

From one allele frequency to the genotype mix a random-mating population should carry — p², 2pq, q², the counts behind them, and the carrier door for rare recessives.

Hardy Weinberg Calculator

Results recalculate instantly on every keystroke. Nothing you type is transmitted.

The pool
The population
The expected genotypes
—
The expected counts—
The carrier door—
The equilibrium doctrine—

What this result does not account for

  • Two-allele autosomal locus
  • Infinite-population theory translated to counts
● Zero-Server Execution Updated 11 Aug 2026 Reviewed by Dr. Ayesha Rahman IEEE-754 Double Precision

In short: At p = 0.600000 (q = 0.400000), random mating should stock a population with p² = 0.360000 AA, 2pq = 0.480000 Aa and q² = 0.160000 aa — frequencies summing to 1.000000 exactly. In a population of 1,000 that is 360, 480 and 160 individuals. The carrier door: at q² = 0.000400 (the cystic-fibrosis ballpark, 1 in 2,500 — approximate), carriers run 2pq = 0.039200, about 1 in 25.5 — most copies of a rare recessive allele hide in healthy carriers.

Formula

AA = p² · Aa = 2pq · aa = q² · p + q = 1

If mating is random and no force stirs the pool, each generation’s genotypes are just the binomial square of the allele frequencies: p² homozygous dominant, 2pq heterozygous, q² homozygous recessive — summing to one because p + q does. Stated by G. H. Hardy and Wilhelm Weinberg in 1908, it is the null model of population genetics: not because populations meet its conditions, but because departures from it are how evolution is detected.

Worked Example

  1. Enter the allele frequency p (q follows as 1 − p).
  2. Enter the population size for expected counts.
  3. Read p², 2pq and q² — the equilibrium mix.
  4. Use the carrier door for rare-recessive counseling math.

Defaults: p 0.6, N 1,000 → 0.360000 / 0.480000 / 0.160000 and 360 / 480 / 160 individuals. p = 0.5 → the flat 0.250000 / 0.500000 / 0.250000. The CF-scale drive (p = 0.98) → q² 0.000400, carriers 0.039200 ≈ 1 in 25.510204.

Strengths & Limits Of This Model

Where this engine is strong

  • Frequencies, counts and carriers from one p
  • The carrier door does counseling arithmetic

Where it stops

  • No chi-square test built in
  • No multi-allelic expansion

Risk & accuracy notice. Carrier-risk arithmetic is population-level probability, not personal diagnosis: family history and actual testing supersede any frequency. Genetic counseling decisions belong with professionals and real assays.

Practical Use Cases

Genetics teaching

the binomial square, alive

Counseling math

carrier risk for rare recessives

Population audits

expected counts before the chi-square

Methodology & Editorial Standards

Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.

This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.

Dr. Ayesha Rahman Clinical & Life Sciences Lead · ApexConverter

Analytical chemistry and molecular biology quantitation. Last reviewed: 11 August 2026.

Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.


Hardy Weinberg Calculator — 8 Expert FAQs

8 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.

Why does p + q = 1 force the genotype sum to 1?

Because the square of one is one: (p + q)² = p² + 2pq + q². If every allele in the pool is either A or a, then the three genotype frequencies — the binomial expansion of randomly drawing two alleles — must tile the whole population between them. The hero card prints the sum so the tiling is visible; if it ever read anything but 1.000000, the arithmetic would be lying somewhere.

What are the five conditions, and does anything satisfy them?

Infinite population (no drift), random mating (no assorting), no selection, no mutation, no migration. No real population meets them all — and that is the point: the equilibrium is a null model, valuable precisely because real populations deviate from it in measurable, interpretable ways. A chi-square of observed counts against these expected frequencies is the formal test the allele frequency page feeds.

Why do rare recessive alleles hide in carriers?

Binomial arithmetic: at q = 0.02, affected homozygotes are q² = 0.000400 (1 in 2,500 — the cystic-fibrosis ballpark, approximate) while carriers are 2pq ≈ 0.039200, 1 in 25.5. The ratio 2pq/q² grows as q shrinks — at rarity, the overwhelming majority of copies of a recessive allele sit in healthy carriers, which is why carrier screening works and why recessives sneak through generations unnoticed.

Does the equilibrium change the allele frequencies?

No — that is its neutrality and its power: one generation of random mating restores the p², 2pq, q² proportions and then holds them, with p and q untouched. Only selection, mutation, migration and drift move the frequencies themselves. So ‘in Hardy–Weinberg proportions’ says nothing about whether evolution is happening globally — it says mating is random HERE and now.

What does an observed excess of heterozygotes mean?

Usually structure in reverse: the sample mixes two populations whose q values differ — the Wahlund effect goes both ways — or heterozygotes enjoy a fitness advantage at this locus. Deficits point at inbreeding or null alleles; excesses at mixing or balancing selection. The direction of the departure is diagnostic, which is why the allele frequency page prints the het gap with its sign.

Why is q = 1 − p legitimate here?

Two alleles per locus: every allele is one or the other, so the shares must sum to one. Enter p and the page derives q; enter p = 0.98 and q = 0.02 is exact, not rounded. Multi-allelic loci (three or more) break the shortcut — each allele needs its own measured frequency, and the genotype square becomes a multinomial. The two-allele model is the teaching core.

Can I use this for X-linked loci?

Not directly — males carry one X, so male genotype frequencies follow q directly rather than q², and the pool weights females two thirds, males one third. Affected-male frequencies equal q, which is why X-linked recessive disease shows sex bias. Weight the census first, then apply the square to the female side; the page’s arithmetic is the autosomal case.

How big must the population be for these counts?

The formula is infinite-population theory; the counts card translates it to whatever N you name. Real populations deviate from the expectation by sampling noise alone — in a pool of 100, expected 0.480000 het is 48 individuals, and counting 44 or 52 is unremarkable. That is why the formal test is a chi-square with its degrees of freedom, and why small samples excuse soft departures.

Related Chemistry & Biology Engines