Home › Statistics & Probability Calculators › Fisher's Exact Test Calculator (2×2)
Fisher's Exact Test Calculator (2×2)
Fisher’s exact test checks whether two categorical variables in a 2×2 table are associated, using exact probabilities instead of the chi-square approximation. It is the right test when expected counts are small (below 5), which is common in pilot studies, clinical case series and classroom experiments.
With the row and column totals fixed, the count in the top-left cell follows a hypergeometric distribution. The calculator lists every table with the same margins and its probability. The two-sided p-value adds the probabilities of all tables no more likely than the one you observed, the same rule R’s fisher.test and SciPy use. The one-sided p-values add the tables in one direction only.
The sample odds ratio (a × d) ÷ (b × c) is shown as a measure of the strength of association; the odds ratio calculator adds its confidence interval and the relative risk. For larger tables, or more than two rows or columns, use the chi-square test of independence.
Result and step-by-step solution
Two-sided p-value. Sample odds ratio = 20.
- Table marginsRow 1 total = 10, column 1 total = 9, N = 16. With the margins fixed, cell a follows a hypergeometric distribution from 3 to 9.
- Probability of the observed tableP(a = 8) = C(9, 8) × C(7, 2) ÷ C(16, 10) = 0.023601
- All tables with the same margins
a Probability As or less likely than observed 3 0.01049 yes 4 0.11014 5 0.33042 6 0.367133 7 0.157343 8 0.023601 yes 9 0.000874 yes - p-valuesTwo-sided (sum of tables no more likely than observed) = 0.035; P(a ≤ 8) = 0.9991; P(a ≥ 8) = 0.0245
- Decisionp = 0.035 < α = 0.05.
Frequently asked questions
- When should I use Fisher's exact test instead of chi-square?
- When any expected cell count is below 5, or the total sample is small. The chi-square p-value is an approximation that becomes unreliable with small counts; Fisher’s test is exact.
- How is the two-sided p-value calculated?
- By adding the hypergeometric probabilities of every table with the same margins whose probability is less than or equal to that of the observed table.
- Can Fisher's exact test be used for large samples?
- Yes, it is valid at any size, but with large counts it gives nearly the same answer as chi-square and takes longer to compute by hand.
- What does the odds ratio tell me here?
- How strongly the two variables are associated. An odds ratio of 1 means no association; the p-value tells you whether the observed departure from 1 could be chance.
Last reviewed: October 7, 2026. Calculations run in your browser and were validated against SciPy.
