# Hardy-Weinberg Equilibrium Calculator (p² + 2pq + q² = 1)

Compute allele and expected genotype frequencies under Hardy-Weinberg equilibrium. Two modes: allele frequency or genotype counts with chi-square test. Derived from Hardy 1908, Weinberg 1908, Wigginton 2005, StatPearls. Educational use only.

> Canonical page: https://elysiatools.com/en/tools/hardy-weinberg-equilibrium

- **Category:** Education

- **Keywords:** hardy-weinberg, hardy weinberg equilibrium, hwe, allele frequency, genotype frequency, p squared, 2pq, population genetics, chi-square test, genetics, biology

## Overview

The Hardy-Weinberg Equilibrium Calculator estimates allele and expected genotype frequencies for a biallelic locus using p² + 2pq + q² = 1. Enter a recessive allele frequency or observed AA, Aa, and aa counts to calculate results and, in counts mode, perform a chi-square goodness-of-fit test. Educational use only.

## Inputs

- **Input Mode** (select): Choose allele-frequency mode or genotype-counts mode.
- **Allele q frequency (recessive)** (number): Frequency of the recessive allele q (0–1). Used in frequency mode only.
- **aa count (homozygous recessive)** (number): Observed count of genotype aa. Used in counts mode only.
- **Aa count (heterozygous)** (number): Observed count of genotype Aa. Used in counts mode only.
- **AA count (homozygous dominant)** (number): Observed count of genotype AA. Used in counts mode only.
- **Decimal Places** (number)

## When to use

- Calculate AA, Aa, and aa genotype frequencies from a known recessive allele frequency.
- Estimate allele frequencies from observed AA, Aa, and aa genotype counts.
- Check whether observed genotype counts are consistent with Hardy-Weinberg equilibrium using chi-square.

## How it works

- Select Allele Frequency Mode or Genotype Counts Mode.
- In frequency mode, enter q, the recessive allele frequency from 0 to 1; the calculator derives p and calculates p², 2pq, and q².
- In counts mode, enter the observed AA, Aa, and aa counts; the calculator estimates p and q, then calculates expected genotype counts.
- The counts mode reports a chi-square statistic with one degree of freedom and indicates whether the result is significant.

## Use cases

- Teaching population genetics and the relationship between allele and genotype frequencies.
- Estimating carrier frequency from a recessive allele frequency in genetics exercises.
- Comparing observed genotype counts with Hardy-Weinberg expectations in classroom or research practice.

## Frequently asked questions

### What does q represent?

q is the frequency of the recessive allele, while p is the frequency of the dominant allele and p + q = 1.

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

They are the expected frequencies of AA, Aa, and aa genotypes, respectively.

### What inputs are required in frequency mode?

Enter q, the recessive allele frequency, as a value from 0 to 1.

### What inputs are required in counts mode?

Enter observed counts for AA, Aa, and aa.

### Is this calculator suitable for clinical decisions?

No. It is intended for educational use only.

## Related tools

- [Allele Frequency Calculator (p = (2AA + Aa) / 2N)](https://elysiatools.com/en/tools/allele-frequency-calculator): Compute allele frequencies from genotype counts: p = (2AA + Aa) / 2N, q = (2aa + Aa) / 2N. Derived from Hartl & Clark 2007, Griffiths, StatPearls. Educational use only.
- [Genotype Frequency Calculator](https://elysiatools.com/en/tools/genotype-frequency-calculator): Compute genotype frequencies from counts: freq = count / N. Also derives allele and phenotypic frequencies. Derived from Hartl & Clark 2007, Griffiths, StatPearls. Educational use only.
- [Audio Cutter](https://elysiatools.com/en/tools/audio-cutter): Cut and extract audio clips from audio files with precise time selection
- [Audio Decrackler](https://elysiatools.com/en/tools/audio-decrackle): Remove crackles and subtle impulsive noise from audio files. Ideal for restoring old recordings, cassette tapes, and digitized vinyl with surface noise
- [Audio to Text Transcriber (AI)](https://elysiatools.com/en/tools/audio-to-text-transcriber): Transcribe speech from audio (wav/mp3/m4a/flac/ogg/webm/aac) to text, SRT, VTT or JSON using the grok-stt AI model. Up to 10 minutes.
- [AAC to MP3 Converter](https://elysiatools.com/en/tools/aac-to-mp3): Convert AAC audio to MP3 with controllable bitrate, resampling, and channel selection
- [Audio Declicker](https://elysiatools.com/en/tools/audio-declick): Remove clicks and pops from audio files caused by vinyl records, digital errors, or other impulsive noise sources
- [Audio Declipper](https://elysiatools.com/en/tools/audio-declip): Repair clipped audio by reconstructing peaks that exceeded the maximum amplitude. Restore distorted audio from overdriven recordings or excessive gain

## Samples

- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Copyright-Free AAC Audio Samples](https://elysiatools.com/en/samples/aac-samples): High-quality AAC encoded audio samples for testing and development, featuring nature sounds and meditation music with excellent compression
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion

## Related content

- [Audio Encoding and Format Conversion Tools](https://elysiatools.com/en/hubs/audio-convert): Compare audio format conversion, bitrate changes, sample-rate conversion, codec swaps, and export tools in one hub for delivery and archive workflows.
- [Image Format Conversion and Animated Export Tools](https://elysiatools.com/en/hubs/image-convert): Compare image format converters for JPG, PNG, GIF, AVIF, WebP, TIFF, ICO, base64, and animation-friendly exports in one hub.
- [JSON Interchange and Format Translation Tools](https://elysiatools.com/en/hubs/json-convert): Compare JSON conversion tools for CSV, YAML, TOML, GraphQL, XML, Markdown, Excel, BSON, EDN, and related structured formats in one hub.
- [Color Space Conversion Tools for Web and Print](https://elysiatools.com/en/hubs/design-convert): Curated tools for web-to-print color space conversion in one hub.
