Statistics & genetics

Hardy–Weinberg Equilibrium Calculator

Enter AA, Aa and aa genotype counts to get allele frequencies, expected counts, the chi-square test with one degree of freedom and the exact p-value. Runs in your browser.

Hardy–Weinberg Equilibrium CalculatorRuns in your browser; nothing is uploaded
Checking your sign-in…

Learn the method behind this result in Genetics & Genomics Fundamentals, a Vedicgen course with a certificate · from ₹6,999 + GSTView course

What the test checks

A population is in Hardy–Weinberg equilibrium when the genotype frequencies at a locus are p², 2pq and q², where p and q are the two allele frequencies. Those are the frequencies you get from random mating with no selection, migration, mutation or drift acting between generations.

This calculator takes your observed counts of the two homozygotes and the heterozygotes, recovers p and q from the genotypes themselves (p = (2·AA + Aa) / 2N), shows the counts expected under equilibrium, and tests the difference. The inbreeding coefficient Fis = 1 − (observed heterozygotes / expected heterozygotes) summarises the direction: positive means a deficit of heterozygotes, negative an excess.

Chi-square and exact p

The chi-square statistic is the sum over the three genotypes of (observed − expected)² / expected, and is read on one degree of freedom because the two allele frequencies were estimated from the same counts. It is a good approximation when the expected counts are large.

When the sample is small or one allele is rare, the expected counts get small and the chi-square approximation breaks down, so the exact test is the one to report. It enumerates every possible arrangement of the same 2N gene copies that keeps the allele counts fixed, and sums the probabilities of arrangements at least as extreme as yours (the Wigginton–Cutler–Abecasis formulation, with half of the probability of your own arrangement counted, as is standard). The two p-values usually agree closely; where they differ, trust the exact one.

How to read a significant result

A departure from equilibrium is a statement about your data, not automatically about biology. In genotype calling it is the standard quality filter, because a systematic heterozygote deficit is what a failed caller produces: a duplicated region read as one site, alleles dropping out at a SNP under a primer, or samples from two populations analysed as one.

In a real population the same deficit points at inbreeding, selection against heterozygotes, or non-random mating, while an excess suggests outbreeding, balancing selection or a genotyping artefact that misreads homozygotes as heterozygotes. Check the missingness, Hardy–Weinberg counts per batch and the allele frequency before deciding which one you are looking at.

Cite, link or share this tool

Cite this tool

Solagene. Hardy–Weinberg Equilibrium Calculator [online tool]. Nayancode, Solagene; 2026. Available at: https://solagene.com/nayancode/tools/hardy-weinberg-calculator/ (accessed 2026-11-23).

Add it to your lab or course page

<a href="https://solagene.com/nayancode/tools/hardy-weinberg-calculator/" title="Free Hardy–Weinberg Equilibrium Calculator by Solagene">Hardy–Weinberg Equilibrium Calculator</a> (free, runs in your browser) by <a href="https://solagene.com/">Solagene</a>

FAQ

Frequently asked questions

Not answered here? Send us your question and we will reply by e-mail.

The exact p for small samples and rare alleles, and either for hundreds of typical genotypes where they agree. In genome-wide association studies the exact test is the one normally used, and a locus is dropped below a threshold such as p < 1e-6.

No. The model here assumes one autosomal locus with two alleles scored in diploid individuals. Hemizygous samples, more than two alleles and polyploid organisms need a different expected distribution.

No. The calculation runs in your browser with JavaScript. Nothing you enter is sent to a server.

Work with us

Want this done for you?

Send us your data and a short note. We reply with a fixed price.

Sent securely to Solagene. Your details are used only to answer this request.

Or order directly: Order an analysis.