Estimate allele frequencies p and q from genotype counts, then test the population against Hardy-Weinberg expectations with a chi-square value.
Results
Calculated
Frequency of A (p)
—
allele A, from (2AA + Aa) / 2N
Frequency of a (q)
—
allele a, q = 1 − p
Expected genotype counts
—
Hardy-Weinberg: p²N, 2pqN, q²N
Chi-square test (1 d.f.)
—
critical value 3.841 at the 5% level
Add this calculator to your website
What this calculator does
Given how many individuals in a sample carry each genotype, this calculator estimates the frequency of the two alleles, p for allele A and q for allele a. It then works out the genotype counts you would expect if the population were in Hardy-Weinberg equilibrium and compares them with what you observed using a chi-square statistic.
It suits genetics coursework, population-genetics lab reports, and quick checks on whether a sample shows signs of selection, non-random mating or sampling problems.
The equations
p = (2 × AA + Aa) / (2N), where N = AA + Aa + aa is the number of individuals. Each AA carries two copies of A and each Aa carries one.
q = 1 − p.
Expected genotype counts under Hardy-Weinberg: AA = p²N, Aa = 2pqN, aa = q²N.
χ² = Σ (observed − expected)² / expected over the three genotypes. With one degree of freedom (three classes, minus one, minus one estimated allele frequency), a value above 3.841 rejects equilibrium at the 5% level.
Worked example
A sample of 1,000 individuals has 298 AA, 489 Aa and 213 aa (the default inputs).
Allele A: (2 × 298 + 489) / 2,000 = 1,085 / 2,000 = 0.5425, so q = 0.4575. Expected counts are AA = 0.29431 × 1,000 = 294.3, Aa = 0.49639 × 1,000 = 496.4 and aa = 0.20931 × 1,000 = 209.3.
χ² = 0.046 + 0.110 + 0.065 = 0.221. That is well below 3.841, so this sample is consistent with Hardy-Weinberg equilibrium.
Common mistakes and how to interpret the result
Entering allele counts instead of genotype counts. The inputs are numbers of individuals, not numbers of alleles.
Using percentages. Enter counts, because the chi-square test depends on sample size. Percentages give a meaningless statistic.
Small samples. Chi-square is unreliable when any expected count is below about 5; use an exact test instead.
Assuming equilibrium proves neutrality. Passing the test does not rule out weak selection, and failing it can also reflect genotyping error.
Frequently Asked Questions
Can I enter frequencies instead of counts?
Not directly. Multiply each genotype frequency by your sample size to get counts, because the chi-square statistic needs the actual number of individuals.
Why is there only one degree of freedom?
There are three genotype classes, the total is fixed, and one parameter (the allele frequency p) was estimated from the data, leaving 3 − 1 − 1 = 1.
What if the test says the population departs from equilibrium?
Possible causes include selection, non-random mating, migration, small population size, mutation, or genotyping errors. The test tells you that something is off, not which cause.
Does this work for genes with more than two alleles?
No. This tool handles one locus with two alleles. Multi-allelic loci need a generalised Hardy-Weinberg calculation.
Practical Guide for Allele Frequency Calculator
Allele Frequency Calculator is most useful when the inputs reflect the situation you are actually planning around, not a best-case estimate. Treat the result as a decision aid: it gives you a structured way to compare assumptions, spot outliers, and decide what to verify next. For Biology work, the most important review lens is sampling method, growth assumptions, measurement window, variability, and biological context.
Start with a baseline run using values you can defend. Then change one assumption at a time and watch which output moves the most. If one input dominates the result, spend your verification time there first. If several inputs have similar influence, use a conservative scenario and an optimistic scenario to create a practical range instead of relying on a single exact number.
Before acting on the result, compare the result with observed measurements, protocol notes, and expected biological ranges. This is especially important when the calculator supports a purchase, project plan, performance target, or operational decision. The calculator can make the math consistent, but the quality of the conclusion still depends on current data, clear units, and assumptions that match your real constraints.
When the output looks surprising, slow down and inspect each input in order. A small change in one high-leverage field can move the final number more than several low-leverage fields combined. For Allele Frequency Calculator, that means you should first confirm the value with the greatest scale, then confirm the value with the greatest uncertainty, then rerun the calculator with conservative and optimistic assumptions. This sequence turns the calculator from a single answer into a practical decision range.
Review Checklist
Confirm every input uses the unit and time period requested by the calculator.
Run a low, expected, and high scenario so the answer has a useful range.
Check whether rounding or a missing decimal place changes the decision.
Update the calculation whenever the organism, culture condition, population, or sampling period changes.
How to Validate the Result
Use Allele Frequency Calculator as a repeatable checkpoint rather than a one-time answer. The safest workflow is to record the original inputs, save the output, and write down which assumption you are testing. Then rerun the calculator with one changed value. If the result changes sharply, that input deserves more attention before you act on the number.
For this topic, the main validation lens is sampling method, growth assumptions, measurement window, variability, and biological context. That means a result can be mathematically correct and still be misleading if the inputs come from the wrong time period, use inconsistent units, or mix expected values with best-case values. Keep baseline, conservative, and optimistic runs separate so the final decision is easier to explain later.
When you share the result with someone else, include the assumptions and the date of the calculation. Many calculator outputs become stale after prices, schedules, measurements, or constraints change. A short note about the source of each input makes the calculation auditable and prevents later confusion about why the answer moved.
Label the source for each input before comparing scenarios.
Use the same rounding method across every run.
Flag any input that is estimated rather than measured.
Recalculate whenever the organism, culture condition, population, or sampling period changes.