Fisher's Exact Test Calculator (2×2)

Exact one- and two-sided p-values and the odds ratio for a 2×2 contingency table.

Fisher's exact test adds the hypergeometric probabilities of every table with the same margins that is as or less likely than the one observed. For the table [1, 9; 11, 3], two-sided p = 0.0028, a significant association.

Free, runs in your browser. Nothing you enter is uploaded.

How to use it

  1. Enter the four cell counts of your 2×2 table.
  2. Read the two-sided p-value (or a one-sided p if you planned a direction).
  3. Report the odds ratio with the p-value.

What you enter

What you get

Formula

P(a) = C(a+b, a) × C(c+d, c) / C(n, a+c)

Worked example

Input: Group 1: 1 yes, 9 no; Group 2: 11 yes, 3 no

Result: Two-sided p = 0.0028; OR = 0.03

Strong evidence that the outcome differs between groups.

Questions

When should I use Fisher's exact test instead of chi-square?

When any expected cell count is below 5, which happens with small samples. Fisher's test is exact at any sample size.

What is the null hypothesis?

That the row and column variables are independent, so the odds ratio is 1.

One-sided or two-sided?

Use two-sided unless you decided on the direction before seeing the data.

Why might my p-value differ from another program?

Programs differ in how they define the two-sided p. This calculator sums tables with probability at or below the observed one, as R and SAS do.

References

Related reading

More Statistics

All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.