Skip to content
The Calculatorz
Hypothesis testing

Fisher’s Exact Test Calculator (2 × 2 Table)

Test for association in a 2 × 2 table with small counts using Fisher's exact test, with one- and two-sided p-values and the odds ratio.

Statistical results depend on the assumptions stated in the formula. Check that your data meet them before drawing conclusions.

2 × 2 counts

Table

How to use this calculator

Enter the four counts of a 2 × 2 table, for example treatment versus control in rows and outcome yes versus no in columns. Fisher's exact test calculates the exact probability of tables as extreme as yours, given the row and column totals, so it works for small samples where the chi-square test is unreliable.

Formula

With row totals R₁, R₂, column totals C₁, C₂ and total n, the probability of a table with top-left count a is the hypergeometric probability C(R₁, a) C(R₂, C₁ − a) ÷ C(n, C₁). The two-sided p-value sums the probabilities of all tables no more likely than the observed one; one-sided p-values sum the tail in one direction. Odds ratio = (a × d) ÷ (b × c).

Calculator credits

Calculator developmentJulia Edwards

Editorial supervision

Expert reviewSaeedM.Phil Statistics, Data Scientist

Published byThe Calculatorz

Last updated

Read how we research, test, review and correct our calculators in our editorial policy.

Frequently asked questions

When should I use Fisher's exact test?

For 2 × 2 tables with small counts, especially when any expected count is below 5, where the chi-square approximation can be poor.

What does it assume?

Independent observations and fixed row and column totals. It is commonly used even when totals are not fixed by design.

Why is it called exact?

It calculates the p-value directly from the hypergeometric distribution rather than from a large-sample approximation.

How is the two-sided p-value defined?

As the sum of the probabilities of all tables with the same margins that are as likely as, or less likely than, the observed table.

What does the odds ratio show?

The strength and direction of the association. An odds ratio of 1 means no association.

Can I use it for larger tables?

The principle extends to larger tables but the computation grows rapidly; for large samples a chi-square test is usually adequate.

References & methodology sources

These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.

  1. National Institute of Standards and Technology. (n.d.). Fisher exact test. In Dataplot reference manual. View source
  2. Ross, S. M. (2019). A first course in probability (10th ed.). Pearson. View source
  3. Casella, G., & Berger, R. L. (2002). Statistical inference (2nd ed.). Duxbury. View source
  4. Croarkin, C., & Tobias, P. (Eds.). (2012). NIST/SEMATECH e-handbook of statistical methods. National Institute of Standards and Technology. View source