Hardy-Weinberg Equilibrium Calculator
Calculate Hardy-Weinberg equilibrium from either allele frequency or observed genotype counts. Get p, q, expected genotype frequencies p², 2pq, q², expected genotype counts, observed and expected heterozygosity, and a simple chi-square screen for quick classroom or lab use.
Choose your calculation mode
Result table
| Measure | Value | Meaning |
|---|---|---|
| p | 0.600000 | Frequency of allele A |
| q | 0.400000 | Frequency of allele a |
| Expected AA frequency | 0.360000 | p² |
| Expected Aa frequency | 0.480000 | 2pq |
| Expected aa frequency | 0.160000 | q² |
Your output
Status
The current sample aligns closely with Hardy-Weinberg expectations.
Core equations
Observed vs expected genotypes
| Genotype | Observed count | Expected count | Expected frequency |
|---|---|---|---|
| AA | 36 | 36.000000 | 0.360000 |
| Aa | 48 | 48.000000 | 0.480000 |
| aa | 16 | 16.000000 | 0.160000 |
Expected counts are large enough for the simple chi-square screen to be reasonably stable in this example.
What Hardy-Weinberg equilibrium means
Hardy-Weinberg equilibrium is one of the foundational ideas in population genetics. It describes the genotype distribution expected in a large, randomly mating population when major evolutionary forces are absent. In the simplest case, a gene has two alleles, usually labeled A and a. If the allele frequencies are p and q, and if p + q = 1, the expected genotype frequencies under equilibrium are p² for AA, 2pq for Aa, and q² for aa.
This principle matters because it gives biology a neutral baseline. Instead of starting with the assumption that a population is changing, Hardy-Weinberg starts with the expectation of no change and asks whether the observed data fit that expectation. If observed genotype counts are close to the expected values, the locus is behaving roughly as the equilibrium model predicts. If the counts differ meaningfully, the difference may point to evolutionary forces, non-random mating, sampling issues, population structure, or technical errors in how genotypes were measured.
That is why Hardy-Weinberg equilibrium is often called a null model. It does not claim that real populations always satisfy every assumption perfectly. Instead, it provides a reference point. A null model is useful because it tells you what pattern you would expect in the absence of a particular kind of process. Once you know the baseline, you can begin to ask deeper questions about why the data do or do not depart from it.
At first glance, the formulas look simple. But the principle is powerful because it connects allele frequencies to genotype frequencies in a way that lets you move back and forth between them. If you know p, you can calculate q and then the three expected genotype frequencies. If you know observed counts for AA, Aa, and aa, you can estimate p and q from the sample and then compare the observed counts to the equilibrium expectation.
In teaching, Hardy-Weinberg is often the first place students see how algebra, probability, and biology connect in a truly elegant way. In research, it remains useful in population studies, genetic screening, quality control pipelines, and introductory assessments of whether genotype distributions behave as expected. In medicine and genomics, it can also serve as a practical data-checking step because strong departures from equilibrium may indicate biological processes or technical problems worth investigating.
The two core equations
The first equation is p + q = 1. This simply states that the total frequency of the two alleles must add up to 1, or 100% of the alleles at that locus in the population. If the frequency of allele A is 0.7, then the frequency of allele a must be 0.3. There is no room for anything else in the basic two-allele model.
The second equation is p² + 2pq + q² = 1. This gives the expected genotype frequencies after random mating in the classic two-allele case. The term p² represents the frequency of genotype AA. The term 2pq represents the frequency of heterozygotes Aa. The term q² represents the frequency of genotype aa.
These equations are closely connected. Once you know p, you immediately know q because q = 1 − p. Once you know both allele frequencies, the expected genotype frequencies follow directly. This is why Hardy-Weinberg calculations are often fast once the underlying logic is clear.
The calculator above automates this process in both directions. It can start from an allele frequency and build the expected genotype frequencies, or it can start from observed genotype counts and work backward to estimate the allele frequencies first.
Why heterozygotes are 2pq
The heterozygote term often causes confusion the first time students see it. Why is it 2pq rather than just pq? The reason is that there are two ways to form a heterozygote. One parent can contribute A while the other contributes a, or the first parent can contribute a while the other contributes A. Those two routes are distinct in the probability calculation, so they add together: pq + qp = 2pq.
This is easier to see with a population-level Punnett square. If allele A has frequency p and allele a has frequency q in the gamete pool, then the possible genotype combinations are AA, Aa, aA, and aa. The two heterozygote boxes are combined because Aa and aA are the same genotype. That produces the familiar three-term result: p², 2pq, and q².
Once that pattern becomes intuitive, many Hardy-Weinberg problems become much easier. You are no longer memorizing the formulas as disconnected symbols. You are seeing how random pairing of alleles produces the genotype pattern.
The assumptions behind Hardy-Weinberg equilibrium
Hardy-Weinberg equilibrium depends on a specific set of assumptions. In the classic introductory model, the population is large, mating is random with respect to the locus, and there is no strong selection, mutation, migration, or random drift altering allele frequencies from one generation to the next. These assumptions are not meant to describe a perfectly real population in every detail. They define the conditions under which the equilibrium model acts as a useful baseline.
Large population size matters because small populations are more strongly affected by genetic drift. Drift is random fluctuation in allele frequency caused by sampling effects from one generation to the next. In a very large population, those random fluctuations are smaller relative to the whole.
Random mating matters because genotype frequencies are built from the random union of gametes. If individuals preferentially mate with similar genotypes, different genotypes, or close relatives, the genotype distribution can shift away from the Hardy-Weinberg expectation even when allele frequencies remain the same.
No selection means that all genotypes contribute equally to survival or reproduction with respect to the locus being considered. If one genotype has a consistent advantage or disadvantage, the allele frequencies can change across generations, and the observed genotype distribution may not match the equilibrium expectation.
No mutation means alleles are not being systematically converted into one another at a rate that changes the population pattern across generations. In many short-term classroom examples, mutation is ignored because its effect is usually tiny compared with other forces, but in long evolutionary time it matters.
No migration or gene flow means the population is not being mixed with genetically different groups at a rate that changes genotype structure. When populations mix, allele frequencies and genotype frequencies can shift in ways that make the simple model less accurate for the combined sample.
These assumptions explain why Hardy-Weinberg equilibrium is so useful. If a sample deviates from the expected pattern, that deviation becomes a clue. It does not instantly prove which assumption failed, but it tells you there is something worth investigating. That could be biology, population structure, or even data quality.
Allele frequencies
Allele frequencies describe how common each allele is in the population. In the two-allele model, once you know one allele frequency, the other is determined automatically because they must sum to 1. Allele frequencies are the starting point for expected genotype frequencies under Hardy-Weinberg equilibrium.
Genotype frequencies
Genotype frequencies describe how common AA, Aa, and aa are in the population. Under equilibrium, those frequencies are predicted directly from the allele frequencies. This is the bridge that makes Hardy-Weinberg so useful for both teaching and analysis.
Observed versus expected
The real value of the model appears when observed genotype counts are compared with the expected counts. A close fit supports the equilibrium model as a reasonable approximation. A poor fit suggests that something biological or technical may be affecting the sample.
How to calculate Hardy-Weinberg equilibrium by hand
- Start with genotype counts or an allele frequency. If you know p already, then q = 1 − p. If you know genotype counts instead, estimate p and q from the counts.
- Find p and q. When starting from counts, use p = (2AA + Aa) / 2N and q = (2aa + Aa) / 2N.
- Compute expected genotype frequencies. Use p², 2pq, and q².
- Convert to expected counts. Multiply each expected frequency by the sample size N.
- Compare observed and expected counts. If you want a simple quantitative screen, calculate the chi-square statistic.
- Interpret the result carefully. A departure from equilibrium does not identify a cause on its own. It tells you the sample does not fit the simple model closely.
A very common classroom problem begins with the frequency of the recessive genotype. For example, if q² = 0.16, then q = 0.4. Since p + q = 1, then p = 0.6. From there, the expected genotype frequencies are p² = 0.36, 2pq = 0.48, and q² = 0.16.
Another common problem starts with counts such as AA = 36, Aa = 48, and aa = 16. The sample size is 100. The A allele count is 2×36 + 48 = 120. The a allele count is 2×16 + 48 = 80. Since there are 200 total alleles in the sample, p = 120/200 = 0.6 and q = 80/200 = 0.4. Those values lead to the same expected genotype frequencies as above.
Using the allele-frequency mode
The first mode in the calculator is ideal when you already know the allele frequency of A. This happens often in textbook questions where p is given directly or where the recessive genotype frequency is given and you can derive q first. Once p is entered, the calculator automatically computes q and then returns the expected genotype frequencies AA, Aa, and aa.
If you also enter a sample size, the calculator converts those frequencies into expected counts. This is useful when you want to see what the equilibrium pattern would look like in a concrete sample of 50, 100, or 1,000 individuals. Frequencies tell you the proportions; counts tell you the expected numbers.
This mode is especially helpful in teaching because it keeps the logic clean. Students can focus on the direct relationship between allele frequency and genotype frequency without first having to derive p and q from observed counts.
Using the genotype-count mode
The second mode is ideal when you have observed genotype counts. This is often the more realistic situation in lab work, field studies, or worksheets built around population samples. You enter the observed counts for AA, Aa, and aa, and the calculator estimates the allele frequencies from those observations.
After that, it computes the Hardy-Weinberg expected frequencies and counts for the same sample size, then compares observed and expected values. This mode also reports observed heterozygosity, expected heterozygosity, and a simple chi-square statistic with an approximate p-value for quick interpretation.
Because the allele frequencies are estimated from the sample itself, the equilibrium comparison is internal to that sample. This is exactly why the mode is useful: it lets you ask whether the genotype distribution is close to the equilibrium pattern implied by the sample’s own allele frequencies.
What the chi-square value is doing
The chi-square statistic gives a compact way to compare observed counts with expected counts. In a simple form, it is calculated as the sum of (Observed − Expected)² / Expected across the genotype classes. If the observed counts match the expected counts closely, the chi-square value will be small. If the counts differ more strongly, the chi-square value will be larger.
In introductory Hardy-Weinberg work, the chi-square value is often paired with a rough threshold such as 3.84 for one degree of freedom at the 0.05 level. But in practice, it is better to view the chi-square result as a screening tool rather than as a magical yes-or-no machine. Very small expected counts can make the approximation unstable, and some research settings use exact tests rather than simple chi-square approximations.
That is why this calculator reports the chi-square value and an approximate p-value, but also shows a warning when expected genotype counts are small. The goal is to help with understanding, not to overstate the certainty of the result.
In classroom work, the chi-square screen is still extremely helpful because it teaches students how to connect the visual mismatch between observed and expected counts to a quantitative summary. It also helps illustrate that equilibrium questions are not only algebra problems. They are model-fit questions.
Worked example 1: starting from p
Suppose the frequency of allele A is p = 0.7. Then the frequency of allele a is q = 0.3. Under Hardy-Weinberg equilibrium, the expected genotype frequencies are:
- AA = p² = 0.49
- Aa = 2pq = 0.42
- aa = q² = 0.09
If the sample size is 200, the expected counts are 98 AA, 84 Aa, and 18 aa. This example shows the simplest use of the principle: once p is known, everything else follows quickly.
It also shows a common pattern: heterozygotes are often the most common genotype when both alleles are reasonably frequent. That is because the term 2pq can become large when p and q are both far from zero.
Worked example 2: starting from counts
Now suppose a sample has AA = 25, Aa = 50, and aa = 25. The total sample size is 100. The frequency of allele A is:
p = (2×25 + 50) / 200 = 100 / 200 = 0.5
The frequency of allele a is:
q = (2×25 + 50) / 200 = 100 / 200 = 0.5
Under Hardy-Weinberg equilibrium, the expected genotype frequencies are 0.25, 0.50, and 0.25, which correspond exactly to the observed sample. In this case, the sample fits the equilibrium model perfectly.
How to interpret departures from equilibrium
A departure from Hardy-Weinberg equilibrium means the observed genotype distribution does not fit the simple expectation especially well. That does not automatically tell you why. But it does tell you that something about the population, the sampling process, or the data may deserve closer attention.
Non-random mating can produce a genotype pattern that differs from equilibrium even when allele frequencies do not change dramatically. For example, inbreeding tends to reduce heterozygosity and increase homozygosity relative to the Hardy-Weinberg expectation. Assortative mating can create similar shifts if individuals with similar traits mate more often than expected by chance.
Selection can also shift genotype frequencies. If one genotype has lower survival or reproductive success, the observed counts can move away from equilibrium. In some contexts, heterozygote advantage may increase heterozygote frequency relative to what the simple model predicts.
Migration or admixture can matter when the sample contains individuals from subpopulations with different allele frequencies. When these groups are analyzed together as if they formed one random-mating unit, the combined genotype distribution may depart from Hardy-Weinberg expectations. This kind of effect is one reason population structure matters so much in genetics.
Genetic drift matters especially in small populations. Random fluctuations can move allele frequencies and create patterns that the equilibrium model does not track well. Drift can also interact with founder effects and bottlenecks, producing genotype structures that are not well described by the simple large-population assumption.
Mutation is usually a weaker immediate force in simple classroom examples, but over longer timescales it changes allele frequencies and contributes to deviations from equilibrium expectations. Mutation is one of the reasons real populations are never perfect copies of the simplest null model.
Genotyping error is another practical cause. If heterozygotes are systematically miscalled, or if a technical pipeline has allele dropout or poor quality control, the genotype distribution can appear to deviate from equilibrium even when the biology is unremarkable. This is one reason Hardy-Weinberg checks are often used as part of data review.
The best interpretation is therefore cautious and structured: first identify that a deviation exists, then ask which biological or technical explanation is plausible in context. The Hardy-Weinberg result is the start of a question, not the final answer.
Observed heterozygosity
Observed heterozygosity is simply the proportion of individuals in the sample that are heterozygous. If 48 out of 100 individuals are Aa, then the observed heterozygosity is 0.48.
Expected heterozygosity
Expected heterozygosity under Hardy-Weinberg equilibrium is 2pq. Comparing observed and expected heterozygosity can quickly show whether heterozygotes are more or less common than the equilibrium model predicts.
Why the comparison matters
Deficits or excesses of heterozygotes can point toward inbreeding, assortative mating, population structure, selection, or technical genotyping issues. This is one reason heterozygosity is so informative in introductory population genetics.
Common mistakes students make
- Forgetting that p + q = 1 and treating p and q as independent values.
- Confusing allele frequencies with genotype frequencies.
- Using pq instead of 2pq for heterozygotes.
- Trying to estimate p from AA alone without accounting for heterozygotes.
- Forgetting to divide by 2N when deriving allele frequencies from genotype counts.
- Comparing observed and expected counts without first matching the same sample size.
- Treating a chi-square result as a final explanation rather than a sign to investigate further.
- Using the simple model for situations that involve multiple alleles, sex linkage, or complex inheritance without acknowledging the limitation.
Most Hardy-Weinberg errors come from mixing up the levels of the problem. Alleles and genotypes are not the same thing. Once you keep those two levels distinct, the rest of the math becomes much more manageable.
Why Hardy-Weinberg matters in genetics
Hardy-Weinberg equilibrium matters because it gives genetics a baseline expectation. Without a baseline, there is no clear way to say whether a population looks ordinary or unusual at a locus. The principle makes that comparison possible.
It is also important educationally because it introduces the logic of model-based reasoning. Instead of memorizing facts about evolution, students learn to compare data against a defined neutral expectation. That mindset appears throughout biology, not just in population genetics.
In applied settings, Hardy-Weinberg checks can help flag unexpected genotype patterns during data review. A strong deviation may point to real biology, but it may also point to issues such as population stratification or poor genotype calling. In that sense, the principle remains practically useful even in modern genomic contexts.
What this calculator does not cover
This section is designed for the classic biallelic diploid model. It does not handle multi-allele loci, sex-linked special cases, polyploid systems, or exact-test workflows for very small samples. It also does not model evolutionary change across multiple generations.
That limitation is intentional. For most students, classes, and introductory genetics tasks, the two-allele Hardy-Weinberg model is the correct starting point. Once that foundation is solid, more advanced versions of the theory are easier to understand.
Deep guide: everything you need to know about Hardy-Weinberg equilibrium
Hardy-Weinberg equilibrium is one of those rare ideas in biology that stays elegant even as you look at it more closely. At the beginner level, it seems like a simple pair of equations used to solve genotype problems. At a deeper level, it becomes a powerful way of thinking about what a stable genetic system should look like if no strong forces are pushing it away from that state.
The reason the idea is so memorable is that it makes something complicated feel manageable. Populations are messy. Real organisms do not live in perfectly closed, infinite, randomly mating groups. Selection does happen. Migration does happen. Mutation does happen. Drift definitely happens. Yet even in the middle of all that mess, Hardy-Weinberg gives you a clean conceptual starting point. It says: here is the pattern you would expect if the genotype distribution were governed only by the allele frequencies and random mating.
That starting point is incredibly useful because it transforms a biology question into a comparison problem. You are not just asking “what are the genotypes?” You are asking “do the observed genotypes fit the pattern predicted by the allele frequencies?” That is a much more powerful question, because it opens the door to interpretation. When the fit is close, the equilibrium model works well. When the fit is poor, you begin to ask why.
One of the most valuable habits in genetics is learning not to over-interpret the first number you see. Hardy-Weinberg helps teach that discipline. A sample might have a recessive allele that seems rare, but if the heterozygote frequency is large, the full picture looks different. Or a sample might show a notable homozygote excess, which is impossible to appreciate fully unless you compare the observed data against the equilibrium expectation. In that sense, Hardy-Weinberg does not just give answers. It teaches better questions.
The classic two-allele equations are simple enough to remember, which is part of why they are taught so widely. If the frequency of A is p and the frequency of a is q, then the genotype frequencies after random mating are p², 2pq, and q². Students often memorize this quickly, but the deeper understanding comes when they see where it comes from. The genotype pattern is just the result of combining alleles from the gamete pool. In other words, the formula is a probability argument, not an arbitrary rule.
This matters because it makes the model intuitive. You do not have to memorize it as a mysterious genetics fact. You can reconstruct it from first principles. If A occurs with frequency p in gametes and a occurs with frequency q, then AA appears with probability p×p, aa with probability q×q, and heterozygotes appear through two paths, which together give 2pq. Once a student sees that, the equations stop feeling artificial.
Hardy-Weinberg equilibrium also shows why genotype frequencies can settle into a stable relationship after random mating. Even if the starting genotype distribution is unusual, the expected frequencies after random mating are determined by the allele frequencies. That is one of the reasons the principle became so important historically. It demonstrated that dominant alleles do not automatically become more common just because they are dominant. Frequency change requires evolutionary forces, not simple visibility of a trait.
That historical insight still matters because it separates genotype expression from evolutionary change. Dominance affects how traits appear in individuals. It does not, by itself, dictate whether an allele will spread. Hardy-Weinberg equilibrium helped make that distinction clear and remains one of the classic demonstrations of how mathematical reasoning can clarify biological misunderstanding.
In real populations, the assumptions are never perfect. Yet the model is still useful precisely because perfection is not required for usefulness. A null model does not need to be reality in every detail. It needs to be clear enough that departures from it are meaningful. Hardy-Weinberg does that extremely well. When the genotype distribution departs from the expectation, you know something is worth a closer look.
Sometimes that “something” is biology. For example, inbreeding tends to increase homozygote frequencies. Population subdivision can generate a heterozygote deficit when groups with different allele frequencies are pooled together. Selection can favor one genotype over another. Heterozygote advantage can create a heterozygote excess. Drift can push small populations into patterns that differ from the simple expectation. These are all biologically interesting possibilities.
At other times, the cause is technical rather than biological. This is especially important in modern genotype datasets. If heterozygotes are undercalled because of poor assay performance or allele dropout, the sample may appear to depart from Hardy-Weinberg equilibrium even when the underlying population is not unusual. This is why the equilibrium check is often used not only as a biological test, but also as a quality-control signal.
That dual role is one of the reasons the principle remains relevant even in genomics. On one hand, it is a teaching tool in classrooms. On the other, it remains part of the logic of real data review. The details of modern workflows may be more sophisticated, but the core idea is the same: compare the observed genotype structure to the structure expected from the allele frequencies under a neutral equilibrium model.
Students also benefit from Hardy-Weinberg because it teaches them how biological data can be summarized at more than one level. Allele frequency is one level. Genotype frequency is another. Heterozygosity is another. Expected counts and observed counts add still another layer. Good population genetics reasoning often depends on moving smoothly between these levels without confusing them.
That is why the two calculator modes are useful. The allele-frequency mode reflects the most direct theoretical use of the principle. You know p, so you build the expected genotype structure. The genotype-count mode reflects the more empirical use. You start with data, estimate p and q from what you observed, and then check how well the sample fits the equilibrium pattern implied by its own allele frequencies.
The chi-square screen adds another educational layer. It moves the problem from purely descriptive comparison to basic statistical reasoning. Instead of saying “these numbers look close,” you calculate a statistic that summarizes how close they are. This is not the final word in every research context, but it is excellent for learning because it shows how deviations can be quantified rather than eyeballed.
Still, it is important to use that statistic carefully. A p-value is not a biological explanation. It does not tell you which assumption failed. It does not tell you that the population is “good” or “bad.” It simply tells you how surprising the observed deviation is relative to the equilibrium model. Interpretation still depends on context, sample size, expected counts, population design, and biological background.
That context matters enormously. For example, a slight departure from equilibrium in a very large sample might be statistically noticeable but biologically trivial. Conversely, a strong-looking deviation in a tiny sample might be unstable because the expected counts are too small for simple approximations to work well. This is one reason good genetic reasoning never stops at the first metric.
Another valuable aspect of Hardy-Weinberg equilibrium is that it trains you to think in terms of populations rather than individuals. The equations are not about predicting one person’s genotype. They are about the distribution of genotypes across a mating population. That shift in perspective is important because many genetic misunderstandings happen when people mix up individual inheritance with population-level structure.
The principle also helps connect different parts of biology. It links Mendelian allele logic with population-level frequency patterns. It links probability with empirical observation. It links mathematical expectations with biological interpretation. That integrative quality is why it remains central in introductory genetics courses all over the world.
Even when students move on to more advanced topics such as linkage disequilibrium, selection models, multi-allele systems, or genomic association studies, the Hardy-Weinberg idea stays in the background. It remains the simple benchmark against which more complicated patterns are understood. In that sense, mastering Hardy-Weinberg is not just about solving one type of problem. It is about building a mental framework that supports later genetics learning.
When you use a calculator like this one, the arithmetic becomes easy, but the interpretation still matters. You should ask: what are p and q? What are the expected genotype frequencies? How do the observed counts compare? Is the heterozygote frequency lower or higher than expected? Is the chi-square large enough to suggest a meaningful departure? Could the cause be biology, sampling, or technical error? Those questions turn the output from a number into a reasoning process.
That is also why good answers in class or lab reports usually go beyond the raw calculation. A strong response explains what the result means. It names the relevant assumptions. It notes whether the sample appears close to equilibrium or not. If the sample deviates, it suggests plausible reasons without pretending certainty. That style of explanation shows real understanding.
There is also an important humility built into Hardy-Weinberg equilibrium. The model is simple by design, and that simplicity is its strength. But no one should confuse a useful null model with the full complexity of living populations. The most responsible use of the principle is to treat it as a powerful starting point, not a complete description of biological reality.
In practical terms, that means using the calculator to learn structure, not just to obtain a decimal. Run one sample. Then run another. Change the counts and see what happens to p, q, and heterozygosity. Make the population more inbred and watch heterozygotes fall. Keep the same allele frequencies but distort the genotype counts and see how the chi-square reacts. This kind of exploration builds intuition much more effectively than memorization alone.
If you are using the section for coursework, a smart strategy is to describe the mathematics first, then interpret the biology second. Show how p and q were obtained. Show the expected genotype frequencies. Show the expected counts. Then discuss whether the sample seems to fit the equilibrium model and what types of processes could explain any mismatch. That sequence produces clear, disciplined reasoning.
At the end of the day, Hardy-Weinberg equilibrium remains important because it is one of the cleanest examples of how a biological system can be understood through a mathematical expectation. It does not replace fieldwork, lab methods, or evolutionary theory. It sharpens them. It gives you a clear reference pattern and asks you to think carefully about when that pattern holds and when it breaks.
That is exactly what good scientific thinking looks like: define a model, compare data to the model, notice where the fit is strong, notice where it is weak, and then investigate the reason. Hardy-Weinberg equilibrium is one of the first places many biology students encounter that logic, and it remains one of the best teaching tools for showing why models matter.
So the real value of this calculator is not only that it returns p, q, p², 2pq, and q². Its value is that it helps you see the structure of a population in a disciplined way. Once you see that structure, the next questions become more interesting, more precise, and much more biological.
Quick reference summary
- Alleles: A and a
- Allele frequencies: p and q
- Rule: p + q = 1
- Genotype frequencies: p², 2pq, q²
- Expected heterozygosity: 2pq
- From counts: p = (2AA + Aa) / 2N
- From counts: q = (2aa + Aa) / 2N
- Use expected counts: expected frequency × N
Best way to use this page
- Use the allele mode for direct formula problems.
- Use the count mode for observed sample data.
- Check whether observed and expected heterozygosity are similar.
- Use chi-square as a screen, not as the whole interpretation.
- Always link departures from equilibrium back to assumptions and context.
Frequently asked questions
What does Hardy-Weinberg equilibrium tell you?
It tells you the genotype frequencies expected from known allele frequencies in a large, randomly mating population when major evolutionary forces are absent.
What are p and q?
They are the frequencies of the two alleles in the classic biallelic model. They must sum to 1.
Why are genotype frequencies p², 2pq, and q²?
Because they come from the random pairing of alleles in the gamete pool. AA forms with probability p×p, aa with q×q, and heterozygotes through two routes that sum to 2pq.
Can a population deviate from equilibrium even if allele frequencies are unchanged?
Yes. Non-random mating can alter genotype frequencies without immediately changing allele frequencies.
What causes a heterozygote deficit?
Possible causes include inbreeding, population subdivision, assortative mating, or technical genotyping issues.
What causes a heterozygote excess?
Possible causes include some forms of selection, disassortative mating, or sampling effects, depending on context.
Why does the calculator report a chi-square value?
It provides a quick quantitative screen for how closely the observed genotype counts match the expected equilibrium counts.
Is chi-square always the best Hardy-Weinberg test?
No. It is common in teaching and basic analysis, but exact tests are often preferred when expected counts are small or in more specialized settings.
Can this page handle more than two alleles?
No. This section is designed for the standard two-allele diploid model only.
Do I need a sample size when I already know p?
You need sample size only if you want expected genotype counts. Expected frequencies can be calculated from p alone.
Final takeaway
Hardy-Weinberg equilibrium is one of the clearest examples of how population-level biology can be described mathematically. Once you know how to move between p, q, genotype frequencies, and expected counts, you can use the model to understand whether a sample looks close to equilibrium or whether something more interesting may be happening.
This section includes the calculator, formulas, comparison tables, worked examples, a full explanation, and FAQ.
