FormatFlow

No tool matches “”

Try a format (“webp”, “mp3”) or a verb (“merge”, “compress”).

Loading index

↵to open

Biology Tools · Updated October 21, 2026 · Reviewed by FormatFlow Editorial

Hardy-Weinberg Calculator

You can calculate Hardy-Weinberg genotype frequencies from allele frequencies or from genotype counts, with p², 2pq and q², expected counts, an observed-versus-expected comparison and the model assumptions.

Runs in your browserFree · No sign-up · No watermark
ALLELES → HWERuns in your browser
Loading the tool…

Everything runs locally in this tab. No file is uploaded while the tool loads.

This tool runs in your tab. Nothing is uploaded and no copy is stored.

How files are handled

At a glance

Works with
ALLELES → HWE
Processing
In your browser
Price
Free, no account
Updated
October 21, 2026
All Biology Tools

About Hardy-Weinberg Calculator

The Hardy-Weinberg principle describes the genotype frequencies a population settles into when nothing is changing it: random mating, no selection, mutation, migration or drift, and a large population. Under those conditions allele frequencies stay constant and genotypes follow p², 2pq and q², which is why the model is used as a baseline for spotting evolution in action.

This calculator works in both directions. Give it allele frequencies p and q to get genotype frequencies and expected counts for a population size, or give it genotype counts to recover p and q and compare the observed counts with the Hardy-Weinberg expectation using a chi-square hint.

What this tool does

The details that matter when you use Hardy-Weinberg Calculator for real work.
  • Both input directions

    Start from allele frequencies p and q or from genotype counts and frequencies for AA, Aa and aa; each direction derives the other.

  • p², 2pq and q²

    Expected genotype frequencies are shown with the arithmetic written out, including the 2pq heterozygote term.

  • Expected counts for a population

    Add a population size N to turn the frequencies into expected genotype counts, or use the observed total when counts are entered.

  • Observed versus expected

    Genotype counts are compared side by side with expected counts, with a χ² statistic and p-value as a rough Hardy-Weinberg check.

  • Normalisation and validation

    Frequencies that do not sum to 1 are normalised with a note, and negative, non-numeric or impossible values are rejected with a clear message.

  • Assumptions listed

    The full assumption list is shown with the result, so it is clear what a deviation from the expectation would mean.

How to use Hardy-Weinberg Calculator

No account, no installation — the whole job happens in this browser tab.
  1. 01

    Choose the input mode

    Pick allele frequencies when you know p and q, or genotype data when you have counts or frequencies for AA, Aa and aa.

  2. 02

    Enter the frequencies or genotype data

    Allele frequencies must be between 0 and 1; genotype counts are whole numbers and genotype frequencies are proportions.

  3. 03

    Set a population size if you need counts

    N is optional in allele and frequency modes; in counts mode the observed total is used automatically.

  4. 04

    Read the expected frequencies and counts

    The table gives the Hardy-Weinberg frequency p², 2pq or q² and the matching expected count for each genotype.

  5. 05

    Compare observed with expected

    With genotype counts, check the observed column and the χ² hint, then confirm the assumptions before drawing a conclusion.

How this tool works

Works with
ALLELES → HWE
Processing
Client-side, in your browser. Nothing is uploaded.
Requirements
Chrome, Edge, Firefox or Safari · JavaScript enabled

Limitations worth knowing

  • Models a single locus with two alleles and assumes random mating, no selection, mutation, migration or drift, and a large population; multi-allelic and multi-locus cases are out of scope.
  • The chi-square hint is only reliable when expected counts are reasonably large; with small counts it is a rough indication and an exact test may be preferable.
  • Normalising frequencies that do not sum to 1 changes the values slightly, so entering correct proportions is always better than relying on normalisation.

Privacy and file handling

The allele frequencies and genotype counts you enter stay in this browser tab. The expected frequencies, counts and chi-square hint are calculated with JavaScript on your device, so nothing is uploaded, stored or logged, and closing the page discards the input.

Read the full privacy policy

Hardy-Weinberg Calculator FAQ

Short, direct answers to the questions people ask before using this tool.
What are p², 2pq and q²?
They are the Hardy-Weinberg expected genotype frequencies for a two-allele locus: p² for AA, 2pq for Aa and q² for aa, where p and q are the allele frequencies. The three terms always add up to 1 because the two alleles account for every copy of the gene.
How do I get p from genotype counts?
Count only the dominant alleles: every AA individual contributes two, every Aa individual contributes one, and aa contributes none, then divide by the total number of alleles. Equivalently, p is the AA frequency plus half the Aa frequency.
What does it mean if observed counts differ from Hardy-Weinberg?
It suggests that at least one assumption is not met, or that the sample is small enough for chance to matter. Selection, non-random mating, population structure and genotyping errors are common explanations; the comparison alone does not identify which one applies.
Does the calculator require a population size?
No. Without a population size it reports frequencies only, which is enough for the allele and genotype relationships. A population size is needed only to turn expected frequencies into expected genotype counts.
What happens if p and q do not add up to 1?
When both are supplied and the sum is not 1, the calculator divides both by the sum so they total 1 and notes that it normalised them. When only one value is supplied, the other is derived as 1 minus it.
Which chi-square test does the hint use?
It is a Pearson goodness-of-fit test of the observed genotype counts against the expected counts, with one degree of freedom for the three genotype classes. It is a rough hint: expected counts below about five make the p-value unreliable.
Can I use this calculator for more than two alleles?
No. The model here covers a single locus with two alleles, A and a, which is the version usually taught first. Multi-allelic loci need the general Hardy-Weinberg expansion and a different set of genotype counts.
Do the frequencies and counts I enter stay in my browser?
Yes. The frequencies, counts and χ² hint are all calculated with JavaScript in this browser tab, so nothing is uploaded, stored or logged, and closing the page discards the input and the result.

Background reading

Format guides that explain the trade-offs behind Hardy-Weinberg Calculator.