Free AI-Assisted

Hardy-Weinberg Calculator

Test Hardy-Weinberg for 2–6 alleles with De Finetti plots and simulation—free, no account. Built-in AI agent assistant support.

Need help with bioinfo analysis? See our bioinformatics services.

Key facts

Key facts about Hardy-Weinberg Calculator
FactValue
Inputs (Calculator)Genotype counts (default), allele frequencies (expected genotypes only), or carrier incidence (biallelic: 1 in N, proportion q², or percent)
Allele range2–6 alleles; genotype grid auto-generates
Statistical testsChi-square (χ², df, p); Guo-Thompson exact or exhaustive exact; F (inbreeding); primary test auto-selected when expected counts < 5
ChartsDe Finetti plot for 2–3 alleles; observed vs expected bar chart for 4+
Simulator1–10,000 generations; N_e 10–10,000; selection, mutation, migration sliders
ExportsPNG, SVG, CSV, copy methods text (Calculator); PNG, SVG, CSV (Simulator)
Runs in browserYes — no install
Account requiredNo
Data uploadLocal only — paste tab-separated counts into genotype grid

What it does

Hand-built chi-square tables and biallelic-only web calculators break on microsatellite, MHC, and triallelic SNP data—one transposed genotype count throws off every expected frequency. The Hardy-Weinberg Calculator accepts observed genotype counts for 2–6 alleles, runs equilibrium tests, and returns plain-language verdicts with publication-ready charts and exports in one browser session.

Open the Calculator tab. Set Allele count (2–6). Choose Genotype counts, Allele frequencies, or Carrier incidence (biallelic only). Enter counts in the auto-generated grid—or paste tab-separated values from a spreadsheet. For carrier risk, pick 1 in N, Proportion (q²), or Percent (%) and enter disease incidence. Click Analyze for chi-square and exact test p-values, F statistic, heterozygosity, observed-vs-expected table, dynamic Hardy-Weinberg equation, verdict badge, and a De Finetti plot (2–3 alleles) or bar chart (4+). Use Export PNG, Export SVG, Export CSV, or Copy methods text.

Switch to the Simulator tab to model Wright-Fisher allele frequency change across generations. Set initial frequencies, Generations, N_e (drift), and Evolutionary forces sliders (selection per allele, mutation rate, migration rate with migrant population frequencies). Click Run for an animated trajectory chart; export PNG, SVG, or CSV.

Why researchers use it

  • Test microsatellite and MHC loci beyond two alleles
  • Avoid hand-built chi-square and exact test spreadsheets
  • Spot inbreeding or genotyping errors with plain verdicts
  • Export De Finetti plots and methods text for papers
  • Estimate carrier frequency from disease incidence
  • Simulate drift and selection without deprecated Flash apps

Best for

  • Microsatellite and multiallelic SNP QC checks
  • Population genetics teaching and problem sets
  • MN blood group and classic HWE textbook examples
  • Estimating carrier risk from recessive disease incidence
  • Modeling when equilibrium breaks down over generations
  • Quick methods-text and figure export before manuscript submission

When to use this vs alternatives

Choose this tool when a single locus needs multiallelic HWE testing, De Finetti visualization, plain-language interpretation, and optional drift simulation in one free browser page. Use R packages like HardyWeinberg or PLINK when you need scripted batch testing across thousands of variants. Science Primer and similar calculators fit quick frequency exploration but lack exact tests, export, and simulation. For Mendelian inheritance crosses—not population allele frequencies—use the Mendelian Cross Solver.

What makes it different

Most alternatives handle one piece—multiallelic math, statistical testing, visualization, or simulation—but not all four with export in a free browser workflow. R HardyWeinberg covers multiallelic tests and ternary plots but requires scripting. PLINK batch-tests genome-wide data but offers no single-locus visualization. Science Primer explores multiallelic frequencies but lacks statistical tests, export, and simulation.

This calculator combines single-locus HWE testing (chi-square and Guo-Thompson exact), F statistic, De Finetti plots, plain-language verdicts, and a Wright-Fisher simulator with evolutionary forces—in one browser page, free, with PNG/SVG/CSV export and copy-ready methods text. Researchers switch when biallelic calculators cannot handle their locus, spreadsheet tables risk transcription errors, or they need a citable De Finetti figure without installing software.

How to get started

  1. Open the workspace and stay on the Calculator tab.
  2. Set Allele count (2–6) and choose Genotype counts, Allele frequencies, or Carrier incidence.
  3. Enter genotype counts in the grid—or paste tab-separated counts from a spreadsheet.
  4. Click Analyze and review chi-square, exact test, F statistic, verdict badge, and chart.
  5. Click Export PNG, Export SVG, Export CSV, or Copy methods text as needed.
  6. For simulation, open the Simulator tab, set initial frequencies, Generations, N_e (drift), and Evolutionary forces sliders, then click Run.

Frequently asked questions

What is Hardy-Weinberg equilibrium?
Hardy-Weinberg equilibrium (HWE) describes the expected genotype frequencies in a randomly mating population with no selection, mutation, migration, or drift. For a biallelic locus, expected proportions follow p² + 2pq + q² = 1, where p and q are allele frequencies. Deviation from expected counts can signal inbreeding, population substructure, genotyping error, or selection. This calculator tests whether observed genotype counts fit those expectations.
How do I test Hardy-Weinberg with more than two alleles?
Set Allele count to 3–6 and enter observed counts for every genotype in the auto-generated grid (e.g. A₁A₁, A₁A₂, A₁A₃, A₂A₂, A₂A₃, A₃A₃ for three alleles). You can paste tab-separated counts from a spreadsheet. Click Analyze for chi-square and exact test p-values, F statistic, observed-vs-expected table, and a De Finetti plot (3 alleles) or bar chart (4+ alleles).
When does the calculator use the exact test instead of chi-square?
The calculator reports both chi-square and exact p-values. When any expected genotype count is below 5 or zero, the exact test (Guo & Thompson MCMC or exhaustive enumeration) becomes the Primary test and a warning explains why chi-square may be unreliable. For larger expected counts, chi-square is primary. Both values remain visible so you can cite the appropriate test in your methods.
How do I estimate carrier frequency from disease incidence?
On the Calculator tab with Allele count set to 2, choose Carrier incidence. Enter recessive disease incidence as 1 in N (e.g. 2500 for cystic fibrosis), Proportion (q²), or Percent (%). Click Analyze to get carrier frequency (2pq) and allele frequencies under Hardy-Weinberg assumptions. This mode computes expected frequencies from incidence—it does not run a population HWE test on genotype counts.
What is a De Finetti plot?
A De Finetti plot (ternary plot) shows genotype frequencies for a multiallelic locus in a triangle where each vertex represents fixation on one allele. Observed and Hardy-Weinberg-expected points appear together so you can see deviation at a glance. This calculator renders a De Finetti plot automatically for 2–3 alleles; for 4–6 alleles it shows an observed-vs-expected bar chart instead.

Client source code & registry

Last updated . Pepkio builds free lab calculators alongside bioinformatics CRO services.