Biology calculator

Hardy-Weinberg Calculator

Calculate Hardy-Weinberg expected genotype frequencies from allele frequency p and q, or from recessive genotype frequency q².

Last reviewed: July 27, 2026Biology calculation engine v1.0.0

Hardy-Weinberg Calculator

Calculate Hardy-Weinberg expected genotype frequencies from allele frequency p and q, or from recessive genotype frequency q².

local biology model
From p and q inputs

Calculate genotype frequencies from allele frequencies.

Result and visual stay hidden until you choose Calculate. This prevents a fake default result from appearing on the page.

Formula and assumptions

Primary formula

p + q = 1 and p² + 2pq + q² = 1.

Input assumptions

Hardy-Weinberg ideal assumptions are used. Allele frequencies are for a two-allele model. Expected counts are optional estimates.

Precision note

Biology models use Decimal.js for deterministic arithmetic where useful, with documented local constants for DNA base contributions.

How NexaCalc calculates biology results

Validate

Required numeric, count, frequency and DNA sequence inputs are checked before calculation.

Model

The selected Biology formula or model is applied in a pure TypeScript utility.

Explain

The result card shows formula substitutions, assumptions, warnings and related values.

Visualize

A scenario-specific Biology visual appears only after a valid calculation.

What the Hardy-Weinberg Calculator does

Use this page for population-genetics exercises involving p, q, p², 2pq and q².

Hardy-Weinberg Calculator calculates locally and separates formula, variables, assumptions, examples, warnings and references so the result can be checked without external biology APIs.

Formula or model and variables

p + q = 1 and p² + 2pq + q² = 1.

  • p is dominant allele frequency
  • q is recessive allele frequency
  • p² is homozygous dominant
  • 2pq is heterozygous
  • q² is homozygous recessive

Step-by-step worked example

Use the default values as the worked example for Hardy-Weinberg Calculator. After Calculate, the result card shows the substituted model and a breakdown using the same engine values.

The examples are intentionally simple so the formula direction and biological assumptions are visible.

  • p = 0.6 and q = 0.4 gives p² = 0.36, 2pq = 0.48, q² = 0.16
  • q² = 0.09 gives q = 0.3, p = 0.7, 2pq = 0.42, p² = 0.49
  • Population size can estimate expected counts

Additional examples

These additional examples use the same deterministic model path.

  • p = 0.6 and q = 0.4 gives p² = 0.36, 2pq = 0.48, q² = 0.16
  • q² = 0.09 gives q = 0.3, p = 0.7, 2pq = 0.42, p² = 0.49
  • Population size can estimate expected counts

How to read the dynamic biology visual

The visual for this page is a allele-to-genotype distribution visual. It appears only after Calculate, so there is no fake default result.

Visual proportions are normalized for readability and should be read as explanatory diagrams, not measured laboratory diagrams.

Common mistakes

Most errors come from model mismatch, invalid input meaning or over-interpreting a simplified estimate.

  • Confusing q with q².
  • Using observed genotype counts as proof of equilibrium without testing.
  • Entering p and q values that do not sum to 1.

Assumptions and limitations

Biology calculators are simplified models. They help with education and planning, but real organisms, lab systems and datasets can behave differently.

  • Hardy-Weinberg ideal assumptions are used.
  • Allele frequencies are for a two-allele model.
  • Expected counts are optional estimates.
  • Selection, migration, mutation, drift and nonrandom mating can change genotype frequencies.
  • The calculator does not perform a chi-square test.

Practical and lab-use note

This calculator is for general educational use only. It does not replace laboratory protocols, institutional guidance, safety review, clinical decisions or professional biological analysis.

DNA sequence inputs are processed locally in the browser session by the calculator component and are not sent to an external biology API.

Frequently asked questions

What does the Hardy-Weinberg Calculator calculate?

Hardy-Weinberg Calculator answers use this page for population-genetics exercises involving p, q, p², 2pq and q². It shows the model, substituted values, assumptions and a visual tied to the entered values.

What formula or model does the Hardy-Weinberg Calculator use?

Hardy-Weinberg Calculator uses p + q = 1 and p² + 2pq + q² = 1. The result breakdown shows how entered values feed the model.

What inputs are required for the Hardy-Weinberg Calculator?

Inputs for Hardy-Weinberg Calculator depend on the selected mode and are labelled in the calculator card. Required values are validated before a result appears.

How should I read the Hardy-Weinberg Calculator result?

Hardy-Weinberg Calculator uses deterministic TypeScript logic and local constants only.

How does the dynamic visual work on the Hardy-Weinberg Calculator?

The dynamic visual for Hardy-Weinberg Calculator is a allele-to-genotype distribution visual. It appears only after a valid calculation and includes the current result.

What assumptions does the Hardy-Weinberg Calculator make?

Important assumptions include: Hardy-Weinberg ideal assumptions are used. Allele frequencies are for a two-allele model. Expected counts are optional estimates. These are shown in the page content.

What common mistakes should I avoid with the Hardy-Weinberg Calculator?

Common mistakes include Confusing q with q². Using observed genotype counts as proof of equilibrium without testing. Entering p and q values that do not sum to 1. Check units, model choice and input meaning before using the result.

What are the limitations of the Hardy-Weinberg Calculator?

Limitations include: Selection, migration, mutation, drift and nonrandom mating can change genotype frequencies. The calculator does not perform a chi-square test. Use biological context and lab procedures for critical work.

Which related Biology calculator should I use next?

Hardy-Weinberg Calculator links to related Biology calculators so population, genetics and DNA-sequence workflows stay on canonical pages.

Is the Hardy-Weinberg Calculator safe for lab or privacy-sensitive use?

Hardy-Weinberg Calculator calculates locally from values entered in the browser session. It is for educational use and does not replace laboratory or professional guidance.

How is the Hardy-Weinberg Calculator different from adjacent Biology tools?

Hardy-Weinberg Calculator uses deterministic TypeScript logic and local constants only.

Can the Hardy-Weinberg Calculator be used for real experimental decisions?

Hardy-Weinberg Calculator uses deterministic TypeScript logic and local constants only.

References

  • OpenStax Biology 2e, Population Growth and Regulation. Relevance: exponential and logistic population models. Last verified: July 27, 2026. Source.
  • OpenStax Biology 2e, Population Genetics. Relevance: Hardy-Weinberg allele and genotype frequency relationships. Last verified: July 27, 2026. Source.
  • OpenStax Biology 2e, Structure of DNA. Relevance: DNA bases and sequence composition context. Last verified: July 27, 2026. Source.
  • NCBI Bookshelf, Molecular Biology of the Cell. Relevance: DNA sequence and nucleotide composition context. Last verified: July 27, 2026. Source.

Biology references and local DNA constants reviewed on July 27, 2026.

Educational disclaimer

This calculator provides mathematical results from the values, conventions and methods you enter. Verify important academic, engineering or professional work independently.