for a biallelic locus
The Hardy-Weinberg Equilibrium principle states that in a large, closed, randomly mating population with no evolutionary influences, the frequencies of alleles and genotypes will remain constant from one generation to the next. This principle provides a mathematical framework to study genetic variation and serves as a baseline to detect evolutionary changes. For a population to be in Hardy-Weinberg Equilibrium, five key assumptions must be met: no mutations, random mating, no natural selection, an infinitely large population size (no genetic drift), and no gene flow (migration).
This online calculator can be used to determine the allele frequencies and to calculate, using the Hardy-Weinberg equation, the expected number of dominant homozygotes, heterozygotes and recessive homozygotes, from observed genotype counts for a gene with two alleles. It will then run a Chi-squared test and return the corresponding p-value, allowing you to determine whether the population is significantly deviating from Hardy-Weinberg Equilibrium proportions.
Determine allele frequencies (p and q)
Calculate expected genotype counts under Hardy-Weinberg equilibrium assumptions
Perform a Chi-squared test to assess whether deviations between observed and expected genotype counts are statistically significant — a low p-value (typically < 0.05) indicates a significant difference, suggesting the population may not be in Hardy-Weinberg Equilibrium
p2 = dominant homozygous frequency (AA)
2pq = heterozygous frequency (Aa)
q2 = recessive homozygous frequency (aa)
How to cite this tool:
Carvello, S.F. (2024) Hardy-Weinberg Equilibrium Calculator for a biallelic locus. Available at: https://ug.sebc.me/labs/hwe-calculator.
This tool was created to aid in the data analysis for the following project:
The distribution of human endogenous retrovirus solo-LTRs in an internationally diverse cohort of students: Exploring the potential for a novel genetic fingerprinting method (Dec 2024)
Research using this tool:
Sudershan, A., Singh, K. & Kumar, P. (2025) GeneRiskCalc: a web-based tool for genetic risk association analysis in case–control studies. BMC Bioinformatics. 26 (1). doi:10.1186/s12859-025-06207-z.
Kambali, M.M., Srivastava, K. & Flegel, W.A. (2025) Asian-type DEL among D-negative patients and donors in Malaysia can ease the demand for D-negative red cells and RhIG. Blood Global Hematology. 1 (3), 100029. doi:10.1016/j.bglo.2025.100029.
Saber, K., Ismail, R., Bassyouni, A., El-shafee, M. & Hassan, M.H. (2026) Genetic variants associated with glycemic and weight loss response to vildagliptin as add-on therapy to metformin in Egyptian obese type 2 diabetic patients: potential consequences on cardiac risk factors. European Journal of Medical Research. 31 (1). doi:10.1186/s40001-025-03816-5.
I'm always interested to hear from researchers and educators putting these tools to good use, so please do feel free to drop me a line if you've found this calculator helpful or cited it — sf@carvello.org :)