Skip to main content

FISHER'S EXACT TEST CALCULATOR

Fisher's exact test calculator for a 2 × 2 table.

Test whether two yes/no variables are related when your sample is small or expected counts are below 5. Get the exact two-sided and one-sided p values, the odds ratio with a 95% CI, and an APA sentence.

2 × 2 TABLE

Groups (rows) × outcome (columns)

EXACT

METHOD

Fisher's exact test: when to use it, formula, and reporting

What is Fisher's exact test?

Fisher's exact test checks whether two yes/no variables are related in a 2 × 2 table. Unlike the chi-square test, it calculates the exact probability of the observed table and anything more extreme, so it stays accurate when the sample is small or some expected counts are below 5.

Formula

P(table) = (a+b)! (c+d)! (a+c)! (b+d)! ÷ (n! a! b! c! d!)

The probability of every table with the same row and column totals is computed from the hypergeometric distribution. The two-sided p value adds the probabilities of all tables that are no more likely than the one you observed.

Worked example

Treatment: 8 improved, 2 did not. Control: 1 improved, 5 did not (n = 16).

  1. Row totals are 10 and 6; column totals are 9 and 7.
  2. Sum the probabilities of all tables as unlikely as this one: two-sided p = .035.
  3. The odds ratio is (8 × 5) ÷ (2 × 1) = 20.00.
  4. Report: Fisher's exact test, p = .035, OR = 20.00, 95% CI [1.42, 282.45].

Fisher's exact test or chi-square?

  • Any expected count below 5 in a 2 × 2 table: use Fisher's exact test
  • Large sample, all expected counts 5 or more: chi-square is fine and gives almost the same p
  • Same people measured twice (before and after): use McNemar's test instead

How to report it (APA style)

Give the percentages in each group, then the test: “80.0% of the treatment group improved compared with 16.7% of the control group, Fisher's exact test, p = .035, OR = 20.00, 95% CI [1.42, 282.45].” The wide CI reflects the small sample.

References

  • Fisher, R. A. (1922). On the interpretation of χ² from contingency tables, and the calculation of P. Journal of the Royal Statistical Society, 85(1), 87–94.
  • Agresti, A. (2013). Categorical data analysis (3rd ed.). Wiley.