Skip to content

Hardy-Weinberg Equilibrium Calculator

9 comments

This genetics calculator determines allele frequencies and expected genotype frequencies under Hardy-Weinberg equilibrium. It also calculates the chi-square statistic to test whether a population is in genetic equilibrium.

Hardy-Weinberg Frequency and Chi-Square Test

Input Fields
CH
Number of individuals with dominant homozygous genotype (AA)
H
Number of heterozygous individuals (Aa)
RH
Number of individuals with recessive homozygous genotype (aa)
If enabled, the result will update automatically when you change any value.

Hardy-Weinberg Equilibrium and Chi-Square Formula

Formula
$$p = \frac{CH + 0.5 \cdot H}{CH + H + RH} \\[5pt] q = \frac{RH + 0.5 \cdot H}{CH + H + RH} \\[10pt] E_{CH} = p^2 \cdot N \\ E_H = 2pq \cdot N \\ E_{RH} = q^2 \cdot N \\[10pt] \chi^2 = \frac{(CH – E_{CH})^2}{E_{CH}} + \frac{(H – E_H)^2}{E_H} + \frac{(RH – E_{RH})^2}{E_{RH}}$$

Where:

  • $$CH$$ = number of homozygous dominant individuals
  • $$H$$ = number of heterozygous individuals
  • $$RH$$ = number of homozygous recessive individuals
  • $$N$$ = total individuals = CH + H + RH
  • $$p$$, $$q$$ = allele frequencies
  • $$E_{CH}$$, $$E_H$$, $$E_{RH}$$ = expected genotype counts
  • $$\chi^2$$ = chi-square value for deviation from equilibrium


The Hardy-Weinberg principle predicts genotype frequencies in a population under ideal conditions (no mutation, migration, selection, or genetic drift). This calculator allows you to input observed counts of dominant, heterozygous, and recessive individuals to determine allele frequencies (p and q), expected genotype frequencies, and whether the population deviates from equilibrium using a chi-square test. It is useful in population genetics, evolutionary biology, and academic research.

Previous
Blood Type Inheritance

Leave a Reply

Your email address will not be published. Required fields are marked *

9 thoughts on “Hardy-Weinberg Equilibrium Calculator

  1. Yurany Granada says:

    Buenas tardes, quiero saber como debo citarlos. Gracias

  2. Adriana Mena says:

    How are the df calculated?

    1. Monica says:

      df = number of classes compared – no. of parameters estimated – 1.

  3. Oladejo Aliu Abiola says:

    How do you calculate the expected value for the alleles

  4. Daniel says:

    Si una enfermedad es recesiva y la frecuencia del alelo que la genera es de
    0,08, ¿cómo serán las frecuencias genotípicas?

  5. Nada says:

    I have one question please, the equation was as follows;
    ECH = pfreq * pfreq * (CH + H + RH)
    yet you have used the frequency of the rare allele in the following example ,
    Step 3 : Expected CH

    Expected CH =

    = 0.78 * 0.2121 * (21 + 10 + 2)

    can you explain why, please?
    Plus,
    what do you mean exactly by the following;
    chi2 = chi1 + chi2 + chi3

  6. Aaron Castle says:

    I love you, thank you for saving my grade in bio and letting me keep an A. Thank you!

  7. hamzah H kzar says:

    thank you so much to helping me by your this website

  8. kamna srivastava srivastava says:

    very useful. with you examples anybody can learn easily and population genetics.