Allele Frequency Calculator

BIOLOGY GENETICS ALLELE FREQUENCY CHI-SQUARED
Share:

Allele frequency calculator — enter the observed counts of the three genotypes (AA, Aa, aa) and get the allele frequencies p and q, the Hardy-Weinberg expected counts, and a χ² goodness-of-fit statistic. For A-Level and IB population genetics. Runs in your browser.

RT-SCI-034 · Science

Allele Frequency Calculator

p = (2·AA + Aa) ÷ 2N  ·  q = (2·aa + Aa) ÷ 2N

Enter the observed counts of all three genotypes. The calculator returns the allele frequencies p and q, the Hardy-Weinberg expected counts, and a χ² statistic.

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 & the χ² test
Unit system
SI primary; US/imperial readout below
First published
2 Jun 2026
Last updated
2 Jun 2026

How to Use the Allele Frequency Calculator

Count each genotype

From your data, count how many individuals are homozygous dominant (AA), heterozygous (Aa) and homozygous recessive (aa).

Enter the three counts

Type each count into its box. The total population size N is worked out for you by adding them.

Read p and q

The calculator counts alleles directly: p = (2·AA + Aa) ÷ 2N and q = (2·aa + Aa) ÷ 2N. These are the observed allele frequencies.

Compare with Hardy-Weinberg

The expected counts under Hardy-Weinberg and a χ² statistic (df = 1) are shown, so you can test whether the population is in equilibrium.

Advertisement
After how-to · AD-W2Responsive

Allele Frequencies & Testing Hardy-Weinberg

Allele Frequency

Example: A sample of 100 individuals contains 60 AA, 30 Aa and 10 aa. Find the allele frequencies.

Counting alleles: p = (2×60 + 30) ÷ (2×100) = 150 ÷ 200 = 0.75, and q = (2×10 + 30) ÷ 200 = 0.25.

p = 0.75  ·  q = 0.25  ·  χ² ≈ 4.0 (df = 1)

Allele frequencies are found by counting alleles directly from genotype data, which is the most reliable approach when you can identify every genotype. Each homozygote carries two copies of one allele and each heterozygote carries one of each, so for a gene with two alleles the dominant allele frequency is p = (2·AA + Aa) ÷ 2N and the recessive allele frequency is q = (2·aa + Aa) ÷ 2N, where N is the number of individuals and 2N is the total number of alleles. By construction p and q add to one. This counting method does not assume the population is in equilibrium — it simply measures what is actually there.

Once you have p and q, you can ask whether the population is in Hardy-Weinberg equilibrium by comparing the observed genotype counts with the counts you would expect from p² , 2pq and q² multiplied by N. The χ² goodness-of-fit test quantifies the mismatch: a small χ² means the observed and expected counts are close, while a large one signals a departure from equilibrium. With three genotype classes and two allele frequencies estimated from the data, the test has one degree of freedom, for which the 5% critical value is 3.84 — a χ² above that is conventionally taken as significant evidence against Hardy-Weinberg. All calculation happens in your browser, so nothing you type is uploaded and the tool works offline once loaded.

Counting alleles measures a population as it is; the χ² test then asks whether it is sitting still or being pushed by evolution.

10 Facts About Allele Frequencies

01

p = (2·AA + Aa) ÷ 2N,  q = (2·aa + Aa) ÷ 2N.

02

There are 2N alleles in N diploid individuals.

03

Counting alleles makes no equilibrium assumption.

04

p and q always sum to one.

05

Expected counts use p², 2pq, q² × N.

06

The χ² test compares observed with expected.

07

Here the test has 1 degree of freedom.

08

The 5% critical value at df = 1 is 3.84.

09

A large χ² is evidence against Hardy-Weinberg.

10

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

Frequently Asked Questions

  • By counting alleles directly. Each AA individual carries two dominant alleles, each Aa carries one of each, and each aa carries two recessive alleles. So p = (2·AA + Aa) ÷ 2N and q = (2·aa + Aa) ÷ 2N, where N is the total number of individuals and 2N is the total number of alleles.
  • Because each individual is diploid and therefore carries two alleles at the locus. A sample of N individuals contains 2N alleles in total, so dividing the count of a given allele by 2N converts it into a frequency between 0 and 1.
  • No. Counting alleles from observed genotypes measures the population as it actually is, with no assumptions. The Hardy-Weinberg expectation is only used afterwards, as a comparison, when you want to test whether the population is in equilibrium.
  • It is a goodness-of-fit measure of how far the observed genotype counts are from the counts expected under Hardy-Weinberg (p²N, 2pqN, q²N). It is the sum over the three genotypes of (observed − expected)² ÷ expected. A small value means a good fit; a large value means the observed data depart from equilibrium.
  • There are three genotype classes, which would give two degrees of freedom, but one more is subtracted because the allele frequency was estimated from the same data. Three classes minus one for the total minus one for the estimated frequency leaves one degree of freedom.
  • Compare it with the critical value for df = 1, which is 3.84 at the 5% significance level. If your χ² is below 3.84, the data are consistent with Hardy-Weinberg; if it is above 3.84, the departure is statistically significant and something — selection, non-random mating, drift or migration — may be acting.
  • A zero count is allowed and simply means that genotype was not observed. The calculator still works, although a zero expected count is skipped in the χ² sum to avoid dividing by zero. Very small samples make the χ² test unreliable, so larger counts are preferable.
  • The Tool Information block lists the exact syllabus — Cambridge A-Level Biology 9700 and IB Diploma population genetics, including the χ² test. 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.