Chemistry & Biology

Allele Frequency Calculator

Count the genotypes, weigh the gene pool: p and q from a census, and the heterozygosity the pool should show if mating were random.

Allele Frequency Calculator

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

The census
The gene pool
—
The heterozygosity ledger—
The census doors—
The frequency doctrine—

What this result does not account for

  • Single autosomal locus, two alleles
  • No X-linked or multi-allelic weighting
● Zero-Server Execution Updated 11 Aug 2026 Reviewed by Dr. Ayesha Rahman IEEE-754 Double Precision

In short: A census of 40 AA, 40 Aa and 20 aa counts 200 alleles in 100 individuals: the A allele holds p = 0.600000, the a allele q = 0.400000. Random mating would then supply 2pq = 0.480000 heterozygotes — but the census observes only 0.400000: the pool runs 0.080000 short on het, evolution’s fingerprint in one subtraction. Feed it 100 AA and nothing else and the page says honestly: q = 0, the a allele is extinct here.

Formula

p = (2·AA + Aa) / 2N · q = 1 − p · het expected = 2pq, het observed = Aa/N

Every individual carries two alleles, so the pool holds 2N cards: p is the share that are A — both alleles of each AA plus one from every Aa — and q is simply the rest. The frequency, not the genotype counts, is what inheritance shuffles: random mating would rebuild genotype proportions p², 2pq, q² from it every generation. Observed heterozygosity falling short of 2pq is the classic signature of inbreeding or structure.

Worked Example

  1. Count the three genotypes in the sample.
  2. Read p and q — the pool’s two bank accounts.
  3. Compare observed heterozygosity with 2pq.
  4. Follow the link to test the equilibrium itself.

Defaults: 40/40/20 → p 0.600000, q 0.400000, expected het 0.480000 vs observed 0.400000 (short 0.080000). All-dominant (100/0/0) → p 1.000000, q 0.000000, expected het 0.000000 — an extinct allele said out loud.

Strengths & Limits Of This Model

Where this engine is strong

  • The pool and its het ledger from one census
  • Extinct alleles said out loud

Where it stops

  • No sampling confidence intervals
  • No chi-square machinery here

Risk & accuracy notice. Frequency estimates inherit every sampling bias in the census — who was counted, and who avoided being counted. Population conclusions deserve replicate samples and, where they guide policy, a population geneticist.

Practical Use Cases

Population genetics

p and q from field counts

Conservation

heterozygosity tracked over time

Teaching

the pool behind the punnett

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.


Allele Frequency Calculator — 8 Expert FAQs

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

Why multiply the whole census by two?

Because individuals are diploid: every organism carries two alleles, so a sample of N people is a pool of 2N allele cards. The AA genotype contributes two A cards, the heterozygote one of each — hence p = (2·AA + Aa)/2N. Forgetting the factor of two is the classic first-week error, and the page’s hero card prints the allele total so the arithmetic stays visible.

What does heterozygosity actually measure?

Genetic variety in action: the fraction of individuals carrying one of each allele. Random mating supplies 2pq of them from the pool’s frequencies; a census that finds LESS than that is telling on itself — inbreeding, population structure, or selection against heterozygotes. The ledger prints both numbers and the gap, because the gap is the information.

My sample has only homozygotes. Is q really zero?

In the sample, yes: zero a-alleles counted means q = 0.000000 and the page says the allele is extinct HERE. The caution is sample size — a rare allele can hide in a small census and appear the moment the sample grows. Frequency estimates carry sampling error the arithmetic cannot remove; the confidence comes from the count, not the formula.

Can this tell me if the population is in Hardy–Weinberg equilibrium?

It hands you the raw materials — observed genotype shares and the expected p², 2pq, q² the frequencies imply — and the Hardy–Weinberg page does the formal comparison. The shortcut reading: when observed heterozygosity matches 2pq, the pool looks random-mating; when it runs short (as the default does, 0.400000 against 0.480000), something non-random is structuring the genotypes.

Why is q defined as 1 − p instead of counted?

For two alleles they are the same statement: every allele that is not A is a. Counting q directly from the genotypes — (2·aa + Aa)/2N — gives the identical number, and doing both is the classic sanity check: if p plus counted-q is not exactly 1, a count slipped. Multi-allelic systems are where the 1 − p shortcut dies and every allele needs its own count.

What moves p over generations?

The four evolutionary forces: selection (some genotypes reproduce more), mutation (A leaks to a), migration (the pool trades alleles with neighbors) and drift (sampling noise, strongest when the population is small). Random mating shuffles the deck but never changes p — that neutrality is precisely what makes any CHANGE in p a detection of evolution, and the frequency card the instrument that catches it.

Is the X chromosome counted the same way?

Not quite — males carry one X, females two, so X-linked loci need a weighted pool (roughly 2/3 female alleles, 1/3 male). This page prices the clean diploid, autosomal case; applying it to X-linked counts needs that weighting first. The doctrine rather than the formula is the transferable part: count the cards, divide the pool.

Why do conservation biologists watch heterozygosity so closely?

Because it is the fuel bank: heterozygous pools carry the variation selection will need when the environment turns, and small inbred populations spend that bank through drift. A pool whose observed het runs persistently short of 2pq is already structured or inbred — the ledger’s gap is an early-warning instrument, one census at a time.

Related Chemistry & Biology Engines