Overview

Fisher's exact test checks whether two yes/no variables are related, using a 2 × 2 table. Unlike the chi-square test, it's exact, so it works for small counts.

Enter the four cells: A and B in the first row, C and D in the second.

Worked examples

InputsResult
Cell A12Cell B5Cell C3Cell D14Observed-table probability: 0.00227Two-tailed Fisher p-value: 0.00490Odds ratio: 11.2
Show 2 more examples
Cell A3Cell B1Cell C1Cell D3Observed-table probability: 0.23Two-tailed Fisher p-value: 0.49Odds ratio: 9
Cell A20Cell B20Cell C18Cell D22Observed-table probability: 0.16Two-tailed Fisher p-value: 0.82Odds ratio: 1.22

Observed-table probability by cell a

With the calculator's starting values, the observed-table probability is 0.00227. The table shows how it changes with the cell a.

Cell AObserved-table probability
60.05
80.02
100.00588
12starting value0.00227
140.000920
160.000391
180.000174

Other inputs: Cell B: 5 · Cell C: 3 · Cell D: 14. Change them in the calculator above for your own numbers.

How it works

With the row and column totals fixed, it lists every possible table and its hypergeometric probability. The two-tailed p-value adds the probabilities of all tables as unlikely as the one observed, or more so. The odds ratio, (A × D) ÷ (B × C), shows the direction and size of the link.

The formula

Odds ratio = (A × D) ÷ (B × C)

Practical tips

  • 12, 5, 3 and 14 give a two-tailed p of about 0.0049 and an odds ratio of 11.2.
  • Use it instead of chi-square when any expected count is below 5.
  • An odds ratio of 1 means no association.

Frequently asked questions

When should I use Fisher's test?

For 2 × 2 tables, especially with small counts.

What do the cells mean?

Rows are one variable, such as treatment or control, and columns the other, such as improved or not.

Why is it called exact?

It calculates the probability directly rather than approximating with a distribution.