About this tool
This calculator works with the Hardy-Weinberg principle for a single gene with two alleles. You can start from observed genotype counts or from a known allele frequency. All calculations happen in your browser.
From counts of AA, Aa and aa individuals, the dominant allele frequency is p = (2·AA + Aa) / (2N) and q = 1 − p, where N is the total. The expected genotype counts under equilibrium are p²N, 2pqN and q²N. A chi-square goodness-of-fit statistic χ² = Σ (observed − expected)² / expected with one degree of freedom compares observed to expected; χ² above the 3.841 critical value means the population departs from equilibrium at the 0.05 level, and an approximate p-value is reported.
From an allele frequency p, the tool returns q = 1 − p and the equilibrium genotype frequencies p², 2pq and q²; entering a population size also gives the expected genotype counts. Remember that the frequencies always sum to one: p² + 2pq + q² = 1.