Hardy-Weinberg Equilibrium Calculator

Educational tool — numeric output only. Calculations run locally; no data is sent to our servers.

Input Type:

A Guide to the Hardy-Weinberg Principle

Calculate allele and genotype frequencies for a population in Hardy-Weinberg equilibrium. This tool serves as a fundamental resource for students and researchers in population genetics, providing instant results from allele frequencies or genotype counts.

About This Hardy-Weinberg Calculator

This calculator applies the Hardy-Weinberg principle to determine the genetic variation in a population. It can operate in two modes: you can either provide the frequency of one of the two alleles (p or q), or input the observed counts of the three possible genotypes (e.g., AA, Aa, aa). The tool then computes all corresponding allele and expected genotype frequencies, assuming the population is in equilibrium.

How the Calculator Works

The functionality is based on two core equations that describe the state of a population that is not evolving.

  • Allele Frequency Input: If you know the frequency of the dominant allele (p) or the recessive allele (q), the calculator uses the equation p + q = 1 to find the frequency of the other allele.
  • Genotype Count Input: If you provide the number of individuals for each genotype (homozygous dominant, heterozygous, homozygous recessive), the calculator first determines the frequencies of p and q from this data. It then calculates the *expected* genotype frequencies.

Once both p and q are known, the tool uses the second Hardy-Weinberg equation, p² + 2pq + q² = 1, to calculate the expected frequencies of the three genotypes.

Interpreting the Results

The results are presented in a clear table, showing the calculated frequencies for both alleles and all three genotypes.

  • p and q: These are the frequencies of the dominant ('A') and recessive ('a') alleles in the population's gene pool. They must sum to 1.
  • p², 2pq, q²: These are the expected frequencies of the homozygous dominant (AA), heterozygous (Aa), and homozygous recessive (aa) genotypes, respectively. They must also sum to 1.

A key application is to compare the *expected* genotype frequencies calculated by this tool with the *observed* frequencies in a real population. A significant difference may suggest that one of the Hardy-Weinberg assumptions is being violated and that evolution is occurring.

Disclaimer: This tool provides the expected frequencies under the ideal conditions of Hardy-Weinberg equilibrium. It is an educational and theoretical model. Real population data may deviate. For formal statistical analysis (e.g., chi-square test), specialized statistical software is required.

The Scientific Foundation: A Null Model for Evolution

The Hardy-Weinberg principle, developed independently by G. H. Hardy and Wilhelm Weinberg in 1908, is a cornerstone of population genetics. It acts as a null hypothesis, describing the genetic makeup of a population that is *not* evolving. For a population to be in Hardy-Weinberg equilibrium, five main assumptions must be met:

  1. No Mutation: No new alleles are generated, nor are alleles changed into other alleles.
  2. Random Mating: Individuals mate randomly, without any preference for particular genotypes.
  3. No Gene Flow: There is no migration of individuals into or out of the population.
  4. No Genetic Drift: The population is sufficiently large that random chance events do not change allele frequencies.
  5. No Natural Selection: All genotypes have equal survival and reproductive rates.

When these conditions are met, allele and genotype frequencies will remain constant from generation to generation.

Conclusion: A Benchmark for Genetic Change

The Hardy-Weinberg calculator is more than just a mathematical tool; it's an application of a fundamental concept in evolutionary biology. By providing a baseline of a static, non-evolving population, it allows scientists to identify and quantify the effects of evolutionary forces like natural selection, genetic drift, and migration when the observed reality deviates from the expected equilibrium.

Final Recommendation: When studying population genetics, it is crucial to understand the assumptions behind the Hardy-Weinberg principle. Use this calculator as a starting point to generate hypotheses about a population's genetic dynamics, which can then be tested with real data and appropriate statistical methods under the guidance of a qualified instructor or researcher.

Frequently Asked Questions

What is the Hardy-Weinberg principle?

It is a principle stating that allele and genotype frequencies in a population will remain constant from generation to generation in the absence of other evolutionary influences.

What are the two main Hardy-Weinberg equations?

The first equation is for allele frequencies: p + q = 1. The second is for genotype frequencies: p² + 2pq + q² = 1.

What do 'p' and 'q' represent?

By convention, 'p' represents the frequency of the dominant allele (e.g., 'A'), and 'q' represents the frequency of the recessive allele (e.g., 'a') for a gene with two alleles.

What do p², 2pq, and q² represent?

p² is the frequency of the homozygous dominant genotype (AA). 2pq is the frequency of the heterozygous genotype (Aa). q² is the frequency of the homozygous recessive genotype (aa).

Why do I only need to know one allele frequency (p or q) to solve the equations?

Because there are only two alleles for the gene in this model, their frequencies must add up to 1 (or 100%). If you know p, you can calculate q (q = 1 - p), and vice versa.

How can I find the allele frequencies from genotype counts?

The frequency of p is calculated as [ (2 × count of AA) + (count of Aa) ] / (2 × total individuals). The frequency of q is [ (2 × count of aa) + (count of Aa) ] / (2 × total individuals).

What are the five assumptions of Hardy-Weinberg equilibrium?

1. No mutation. 2. Random mating. 3. No gene flow (migration). 4. Large population size (no genetic drift). 5. No natural selection.

Do any real populations actually meet all five assumptions?

No, probably not perfectly. The Hardy-Weinberg equilibrium is a theoretical model. Its value lies in providing a baseline to compare real populations against, which allows us to measure the extent to which evolution is occurring.

What is genetic drift?

Genetic drift refers to random fluctuations in allele frequencies from one generation to the next, which are more pronounced in small populations. It is a mechanism of evolution but does not produce adaptations.

What is gene flow?

Gene flow is the transfer of genetic material from one population to another through migration of individuals. It can introduce new alleles or change existing allele frequencies.

How can this calculator be used to detect evolution?

You can collect genotype data from a real population and use it to calculate the observed allele frequencies. Then, use this calculator with those allele frequencies to find the *expected* genotype frequencies if the population were in equilibrium. If the observed and expected genotype frequencies are significantly different (as determined by a statistical test like chi-square), it suggests the population is evolving.

What is a chi-square test in this context?

A chi-square (χ²) test is a statistical method used to determine if there is a significant difference between observed and expected frequencies. It helps you decide if the deviation from Hardy-Weinberg equilibrium is due to chance or a real evolutionary pressure.

Can the Hardy-Weinberg principle apply to genes with more than two alleles?

Yes, it can be extended. For a gene with three alleles (with frequencies p, q, and r), the allele equation is p + q + r = 1, and the genotype equation is (p + q + r)² = 1, which expands to p² + 2pq + q² + 2pr + 2qr + r² = 1.

Does non-random mating violate the equilibrium?

Yes. If individuals choose mates based on their genotype (e.g., assortative mating), the genotype frequencies will change, even though the allele frequencies in the population's gene pool might stay the same.

Can I use phenotype counts instead of genotype counts?

If there is complete dominance, you cannot distinguish between homozygous dominant (AA) and heterozygous (Aa) individuals by their phenotype. However, you can use the count of homozygous recessive individuals (aa), as this corresponds directly to the q² frequency, allowing you to calculate q and then p.

What does a frequency of 0.6 for allele 'p' mean?

It means that 60% of the alleles for that gene in the entire population's gene pool are the 'p' allele.

Is this calculator suitable for clinical genetic counseling?

No. This is a tool for understanding population-level genetics. Clinical genetics requires individual patient data and interpretation by a qualified medical professional.

Who were Hardy and Weinberg?

G.H. Hardy was an English mathematician, and Wilhelm Weinberg was a German physician. They independently formulated the principle in 1908 to describe the stability of genetic variation in populations.

How is the Hardy-Weinberg principle used in conservation biology?

It can be used to estimate the frequency of deleterious recessive alleles in a population, which is important for managing the genetic health of endangered species.

What is heterozygote advantage?

Heterozygote advantage is a form of natural selection where the heterozygous genotype (Aa) has a higher fitness than either the homozygous dominant (AA) or homozygous recessive (aa) genotypes. A classic example is sickle cell trait in malaria-prone regions.

If q is the frequency of a recessive allele that causes a disease, what is the frequency of carriers?

Carriers are heterozygotes (Aa). Their frequency in the population, according to the Hardy-Weinberg equilibrium, is 2pq.

What if p + q doesn't equal 1?

In the model for a single gene with two alleles, their frequencies must sum to 1. If your calculated frequencies from observed data do not, it may indicate a calculation error or that there are more than two alleles for the gene in the population.

Can I calculate allele frequencies for X-linked traits?

Yes, but the calculations are different for males (who have one X chromosome) and females (who have two). This calculator is designed for autosomal (non-sex-linked) traits.

Who should I consult for advanced population genetics analysis?

For research or academic work, you should consult with a professor of genetics or evolutionary biology, a biostatistician, or refer to advanced textbooks and peer-reviewed literature on the subject.

Is the data I enter in this calculator saved?

No. All calculations are performed entirely within your browser. No data is transmitted to or stored by our servers, ensuring confidentiality.