Calculators
Home › Calculators › Fisher's Exact Test

Fisher's Exact Test Calculator

Exact p-values for 2x2 tables, no expected-count conditions attached.

Run Fisher's exact test

Four cells; direction chosen by the hypothesis, not by the result.

Quick answer: 8 of 10 versus 1 of 10 improving: two-sided p = 0.0055, odds ratio 36. Fisher's own tea-tasting table gives p = 0.4857: the test is exact, not generous.

The exact test for small 2x2 tables

The chi-square test of independence approximates; Fisher's exact test counts. Fix the margins of the table (the row and column totals), and only one cell is free to vary. Its distribution over all tables with those margins is hypergeometric, so the probability of the observed table, and of every table at least as extreme, can be computed exactly, with no expected-count conditions. That is why Fisher's test is the standard answer when samples are small and the chi-square rule of thumb (expected counts of at least 5) starts to fail.

Worked example

A pilot trial: 8 of 10 patients improve on the new treatment, 1 of 10 on the old. Margins fixed, the observed table has hypergeometric probability 0.00539, and the two-sided p-value, summing this table and all equally or less likely ones, is 0.0055. The odds ratio is (8 × 9)/(2 × 1) = 36: the odds of improvement are 36 times higher in the new group, though with 20 patients the interval around that ratio is wide. The famous historical case is Fisher's own lady tasting tea, 3 of 4 cups called correctly in both orders: p = 34/70 = 0.4857 two-sided, no evidence she could tell.

One-sided versions, honestly chosen

The tool also reports greater and less one-sided p-values, summed over tables in one direction. They answer directional claims ("the new treatment improves odds"), and they are smaller by construction. Choose the direction from the hypothesis, before the data: choosing it afterwards, in whichever direction the table leans, quietly doubles the false-positive rate while wearing a smaller p-value as camouflage.

Watch out

Reporting the chi-square p-value for a table with tiny expected counts because Fisher "looked complicated". With all four margins this small, the exact computation is shorter than the approximation's justification. The tools have traded places: exact is the easy option now.

Frequently asked questions

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

For 2x2 tables with small samples, conventionally when any expected count falls below 5. The chi-square approximation wobbles there; Fisher's count is exact at any size.

Why does Fisher's test fix the margins?

Conditioning on the margins removes the unknown row and column probabilities from the problem, leaving one free cell whose distribution is exactly hypergeometric.

What does the odds ratio add?

An effect size. The p-value says the table is unlikely under independence; the odds ratio says how strongly the groups differ, which is the number a reader can act on.