UNSUPPORTED SOFTWARE: USE AT OWN RISK
Hardy-Weinberg Equilibrium Test
Notice: this calculator is no longer available to be run on our
Sorry for the inconvenience!
If you use Windows, you can download a DOS version of the
program here. It can be run from the DOS window
either simply as
hwe infile outfile
In both cases, input is expected in the same format as this calculator
used to. For data with only two alleles, the calculation is just
Fisher's test exactly, and the three randomization parameters should
not be entered.
New: this calculator now works for two alleles.
This program uses the Markov Chain algorithm of Guo and Thompson (1992)
to test for Hardy-Weinberg equilibrium in a population. The question answered is:
What is the probability of getting a genotype-frequency table at least as unlikely
as the observed one, given the numbers of each flavour of allele?
Input is a list of numbers, as follows:
Numbers in the list must be separated by spaces, TABS, or newlines, but there is
no requirement that numbers appear on particular lines of the input.
For inputs with two alleles, the test is exact and the three randomization
parameters must not be given.
The running time of the test is proportional to
- the number of allele flavours
- the numbers, n(i,j), of individuals observed with genotype (i,j) in this order:
- n(2,1) n(2,2)
- n(3,1) n(3,2) n(3,3)
- the number of dememorization steps, steps (1000 is recommended)
- the number of randomization batches, batches
- the size of each batch, size
steps + batches * size.
You can also:
- enter, or copy/paste your data into the input window, and hit the Run
- you can enter multiple data sets into the input window, one after
another, as long as all numbers are separated by blanks, tabs, or newlines.
- to keep our server from getting too busy, you can only submit
one run at a time, per internet address
- you can prevent your browser from waiting for a
run by using its Stop Loading or equivalent command. This
doesn't cancel your run, it just frees your browser to do other things.
- results of your most recent run, when complete, are available by following the
Show Results link above.
- you should delete the results from
the server once you have saved them on your own machine.
- you can cancel a run that is taking too long.
Guo, S. W., and Thompson, E.A. (1992). Performing the Exact Test of Hardy-Weinberg Proportion for Multiple Alleles. Biometrics 48, pp. 361-372
The program run by the server is based on
hwe by Sun Wei Guo;
his C source code is available at:
This web-page, the CGI wrapper, and minor modifications to Guo's code
are by John Brzustowski; please feel free to send me comments or criticisms at
email@example.com but removing the obvious parts
You are free to link to, copy, use and modify this page and the
scripts it calls. Source code for all of these are available at
There are more free programs in a similar vein at: