Hardy–Weinberg Calculator
Find genotype frequencies from an allele frequency.
Result
How it is calculated
The Hardy–Weinberg principle links allele frequencies to genotype frequencies in a population. With two alleles, p is the frequency of the dominant allele and q = 1 − p that of the recessive one. Expected genotype frequencies come from (p + q)2 = p2 + 2pq + q2: homozygous dominant p2, heterozygous 2pq, homozygous recessive q2. The tool takes p as a fraction between 0 and 1 (not a percentage) and shows each genotype as a percentage. The model assumes random mating, a large population, no selection, no mutation and no migration, so real populations may deviate.
Worked example
Take p = 0.7, so q = 1 − 0.7 = 0.30. Homozygous dominant: 0.72 = 49.00%. Heterozygous: 2 × 0.7 × 0.3 = 42.00%. Homozygous recessive: 0.32 = 9.00%. The three add up to 100%. Note that 91% of individuals show the dominant trait (49% + 42%), although the recessive allele itself is 30% of all alleles.
Common mistakes
- Entering p as a percentage such as 70 instead of the fraction 0.7.
- Treating the dominant phenotype frequency as p2; it is p2 + 2pq, because heterozygotes also show the dominant trait.
- Confusing the recessive phenotype frequency q2 with the allele frequency q; the allele frequency is the square root.
- Applying the model to a population under strong selection or with non-random mating.
Sources
- 19.1 Population Evolution (Hardy-Weinberg principle, Biology 2e) — OpenStax, Rice University
About this calculator
This calculator finds expected genotype frequencies from an allele frequency under the Hardy–Weinberg principle: for a gene with two alleles at frequencies p and q (where p + q = 1), the genotype frequencies in a population at equilibrium are p² (homozygous dominant), 2pq (heterozygous), and q² (homozygous recessive) — the expansion of (p + q)².
Population geneticists use this as a null-hypothesis baseline: real populations are compared against Hardy–Weinberg expectations to detect evolutionary forces like natural selection, genetic drift, non-random mating, or migration, since a population only stays in equilibrium absent these pressures. It's taught in every introductory genetics course as the foundation of population genetics.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Most real questions arrive the other way round: you know how common a recessive condition is and need the allele frequency. If it affects 1 person in 2,500, then q squared is 0.0004, so q is 0.02 and you should enter p = 0.98. The tool then shows carriers, 2pq, at 3.92%. This only holds under the model's assumptions, such as random mating. What trait or dataset are you working with, and how is your frequency measured?