Quick Answer: What Is a Fisher's Exact Test Table?
A Fisher's exact test table is a 2×2 contingency table that records observed counts for two binary categorical variables. It contains four cells — labeled a, b, c, and d — plus row totals, column totals, and a grand total. Fisher's exact test then calculates the probability of observing this table, or any table at least as extreme with the same marginal totals, using the hypergeometric distribution.
The term "Fisher's exact test table" most often refers to this 2×2 data layout — not a universal critical-value lookup table. Unlike the chi-square or t-table, Fisher's exact test produces a direct p-value from the observed data rather than comparing a test statistic against a pre-computed threshold.
The 2×2 Contingency Table
Every Fisher's exact test starts with a 2×2 contingency table. The table cross-classifies observations by two categorical variables, each with exactly two levels. Here is the standard format:
| Outcome + | Outcome − | Row Total | |
|---|---|---|---|
| Group 1 | a | b | a + b |
| Group 2 | c | d | c + d |
| Column Total | a + c | b + d | n = a+b+c+d |
The row totals (a+b) and (c+d) give the number of observations in each group. The column totals (a+c) and (b+d) give the overall frequency of each outcome. The grand total n = a+b+c+d is the total number of observations. These four values — the two row totals and two column totals — are collectively called the marginal totals or fixed margins.
Does Fisher's Exact Test Have a Critical Value Table?
Standard statistical tables — like the chi-square table — work by comparing a computed test statistic against a pre-tabulated critical value at a given degrees of freedom and significance level. Fisher's exact test operates differently. It calculates a direct probability from the observed 2×2 table and its fixed margins, then sums probabilities across all tables at least as extreme to obtain the p-value.
The significance decision is:
If p-value > α → Fail to reject H₀ → Insufficient evidence at this α
Specialized tables of exact probabilities for specific small fixed margins (e.g. row totals of 5 and 5, column totals of 6 and 4) have appeared in some textbooks, but these serve only those exact margin configurations — they are not universal reference tables. In practice, Fisher's exact test is always computed numerically, and software does this instantly.
Fisher's Exact Test Formula
Given a 2×2 table with cells a, b, c, d and fixed marginal totals, the probability of the observed table under H₀ (independence) is given by the hypergeometric distribution:
─────────────────────────────────────
[a! × b! × c! × d! × (a+b+c+d)!]
This is equivalent to the combination form:
Where C(n, k) = n! / [k! × (n−k)!] is the binomial coefficient ("n choose k"). The notation n! means the factorial of n: n! = n × (n−1) × (n−2) × … × 1, with 0! = 1 by convention.
Why the hypergeometric distribution?
Fisher's exact test conditions on both sets of marginal totals being fixed — meaning both the row sums and column sums are treated as given constants, not as random quantities. Under this conditioning, the distribution of cell a follows the hypergeometric distribution with parameters determined by the four margin values. This is what makes the test "exact": the p-value is computed from a known probability distribution rather than from a large-sample approximation.
Why Do the Marginal Totals Matter?
Fisher's exact test conditions on all four marginal totals being fixed. Given these margins, only a certain set of 2×2 tables is possible — one for each valid value of cell a. The test asks: among all possible tables with these margins, what proportion have a value of a (or a configuration) as extreme as observed?
Consider this example with row totals of 10 and 10, column totals of 11 and 9:
| Outcome + | Outcome − | Row Total | |
|---|---|---|---|
| Treatment | 8 | 2 | 10 |
| Control | 3 | 7 | 10 |
| Column Total | 11 | 9 | 20 |
Here a = 8, b = 2, c = 3, d = 7. Row totals are 10 and 10. Column totals are 11 and 9. Grand total n = 20. Given these margins, cell a can only range from max(0, (a+b)+(a+c)−n) = max(0, 10+11−20) = 1 to min(a+b, a+c) = min(10, 11) = 10. That means a can be 1, 2, 3, …, 10 — giving exactly 10 possible tables, each with a calculable hypergeometric probability.
How Is the Fisher's Exact Test P-Value Calculated?
The p-value from a Fisher's exact test is not the probability of the observed table alone. That is a common and important misconception.
1Start with fixed margins
Record the observed 2×2 table and note all four marginal totals. These do not change across the calculation.
2Calculate probability for the observed table
Apply the hypergeometric formula: P_obs = [(a+b)!(c+d)!(a+c)!(b+d)!] / [a!b!c!d!n!]. This is the probability of this exact configuration, not the p-value.
3Enumerate all possible tables
List every valid 2×2 table sharing the same marginal totals. Each corresponds to a specific integer value of cell a, from its minimum possible value to its maximum.
4Identify tables "at least as extreme"
For a one-sided test, these are tables where a is as extreme or more extreme in the specified direction. For a two-sided test, various definitions exist across software implementations — most commonly, tables whose hypergeometric probability is ≤ P_obs (the doubling method or the probability method). Software documentation is the authoritative source for which convention a given tool uses.
5Sum probabilities to get the p-value
p-value = Σ P(table k) for all tables k identified as at least as extreme. The p-value is always ≥ P_obs.
6Compare p to α
If p ≤ α, reject H₀ (independence). Report the p-value, not just the binary decision. A p-value of 0.049 and a p-value of 0.001 are both "significant at α = 0.05," but they carry different amounts of evidence.
Worked Example 1: Complete Fisher's Exact Test Calculation
Hypothetical scenario: A researcher tests whether a training intervention affects pass rates. Ten participants receive training; ten serve as controls.
| Passed | Failed | Row Total | |
|---|---|---|---|
| Trained | 8 (a) | 2 (b) | 10 |
| Control | 3 (c) | 7 (d) | 10 |
| Column Total | 11 | 9 | 20 |
Step 1: Probability of the observed table
a=8, b=2, c=3, d=7, n=20.
Step 2: All possible tables and their probabilities
With row totals 10,10 and column totals 11,9, cell a ranges from 1 to 10:
| a | b | c | d | P(table) | As extreme (two-sided)? |
|---|---|---|---|---|---|
| 1 | 9 | 10 | 0 | 0.000006 | Yes |
| 2 | 8 | 9 | 1 | 0.000550 | Yes |
| 3 | 7 | 8 | 2 | 0.0165 | No |
| 4 | 6 | 7 | 3 | 0.1100 | No |
| 5 | 5 | 6 | 4 | 0.2751 | No |
| 6 | 4 | 5 | 5 | 0.3302 | No |
| 7 | 3 | 4 | 6 | 0.1982 | No |
| 8 | 2 | 3 | 7 | 0.0498 | Yes (observed) |
| 9 | 1 | 2 | 8 | 0.0055 | Yes |
| 10 | 0 | 1 | 9 | 0.000183 | Yes |
Step 3: Two-sided p-value
Summing the probabilities of all tables with P ≤ P_obs = 0.0498:
Decision and interpretation
With p ≈ 0.054 at α = 0.05 (two-sided), the result does not meet the threshold for rejecting H₀ at α = 0.05. The data do not provide sufficient evidence to conclude a statistically significant association between training and pass rate at this significance level. (A one-sided test in the direction a > expected would yield p ≈ 0.027, which would be significant — but the direction must be pre-specified before seeing the data.)
Worked Example 2: Small Expected Counts
Hypothetical scenario: A small pilot study checks whether a side effect occurs more often in a drug group (n=7) versus a placebo group (n=8).
| Side effect | No side effect | Row Total | |
|---|---|---|---|
| Drug | 5 | 2 | 7 |
| Placebo | 1 | 7 | 8 |
| Column Total | 6 | 9 | 15 |
The expected count for the placebo/side-effect cell is (8 × 6)/15 = 3.2. With an expected count below the threshold that has sometimes been cited for the chi-square approximation, Fisher's exact test is the natural choice here. Applying the hypergeometric formula:
Why not just use chi-square here?
The chi-square test relies on a large-sample approximation. With n = 15 and expected cell counts as low as 3.2, that approximation is less reliable. Fisher's exact test conditions on the observed margins and computes an exact probability — no approximation required. The difference in p-values between the two methods can be meaningful at these sample sizes, though neither method can overcome the limited statistical power inherent in n = 15.
Worked Example 3: Research Context (Hypothetical)
Hypothetical scenario: In a study on disease risk, 50 individuals with an exposure history and 50 without are followed for one year. Researchers record whether each participant develops the outcome condition. All data are hypothetical and presented for educational purposes only.
| Outcome + | Outcome − | Row Total | |
|---|---|---|---|
| Exposed | 14 | 36 | 50 |
| Unexposed | 6 | 44 | 50 |
| Column Total | 20 | 80 | 100 |
Odds ratio and p-value
Odds ratio = (14 × 44) / (36 × 6) = 616 / 216 ≈ 2.85. The exposed group shows roughly 2.85 times the odds of the outcome compared to the unexposed group. Fisher's exact two-sided p-value ≈ 0.048. At α = 0.05, this result falls just below the threshold, providing evidence against the null hypothesis of independence. However, with only 20 outcome events across 100 participants, the estimate is uncertain and the confidence interval wide. This result should not be interpreted as establishing causation.
Appropriate reporting
Fisher's exact test found evidence of an association between exposure status and outcome occurrence: OR = 2.85, 95% CI [0.97, 9.48], two-sided p = 0.048. Counts: exposed 14/50, unexposed 6/50. This is a hypothetical illustration; the wide confidence interval indicates substantial uncertainty around the odds ratio estimate.
Worked Example 4: Business Context
Hypothetical scenario: A marketing team runs two email campaigns (Campaign A and Campaign B) to small matched groups. They record whether each recipient converts (makes a purchase) or does not.
| Converted | Did Not Convert | Row Total | |
|---|---|---|---|
| Campaign A | 10 | 5 | 15 |
| Campaign B | 4 | 11 | 15 |
| Column Total | 14 | 16 | 30 |
a=10, b=5, c=4, d=11. Odds ratio = (10 × 11)/(5 × 4) = 110/20 = 5.5. Fisher's exact two-sided p-value ≈ 0.032.
Interpretation and practical note
Fisher's exact test found evidence of a statistically significant difference in conversion rates between the two campaigns (OR = 5.5, two-sided p = 0.032). Campaign A's conversion rate (67%) was higher than Campaign B's (27%). Statistical significance at α = 0.05 does not confirm that this difference will persist in a larger audience or that it reflects a true causal effect of the campaign content — confounding factors in audience assignment, timing, or other campaign elements could contribute. This result is a starting point for investigation, not a final business decision.
One-Sided vs Two-Sided Fisher's Exact Test
The choice of alternative hypothesis determines which tables count as "extreme" and therefore affects the p-value. This choice must be made before examining the data.
Two-Sided (default)
Tests whether any association exists, without specifying direction. Most appropriate when there is no prior directional prediction. Two-sided p-values are higher than one-sided p-values for the same data.
One-Sided (directional)
Tests whether the association is specifically in the predicted direction. Use only when the direction was specified before data collection — otherwise it constitutes a form of data dredging that inflates Type I error.
fisher.test() and Python's scipy.stats.fisher_exact() may give slightly different two-sided p-values for the same data because they use different definitions of "as extreme." When reporting, state which software and which alternative was used.
Fisher's Exact Test vs Chi-Square Test
Both tests evaluate whether two categorical variables in a 2×2 table are independent. Their key differences relate to how the p-value is derived.
| Feature | Fisher's Exact Test | Chi-Square Test |
|---|---|---|
| Data type | Categorical | Categorical |
| Table size | Primarily 2×2 (extensions available) | 2×2 or larger |
| Small expected counts | Well-suited | Approximation may be less reliable |
| P-value method | Exact (hypergeometric) | Approximate (asymptotic) |
| Main calculation | Hypergeometric probability | χ² = Σ(O−E)²/E |
| Degrees of freedom | Not applicable — p is exact | df = (rows−1)(cols−1) = 1 |
| Large datasets | Applicable; computationally intensive for very large margins | Commonly used |
| Software availability | All major packages | All major packages |
The traditional guidance about using Fisher's exact test when any expected cell count is below 5 is a rough heuristic, not a firm rule. Simulation studies have shown that the chi-square approximation can be reasonably accurate even with some low expected counts, and that Fisher's test can be conservative in some designs. When in doubt, Fisher's exact test is a safe choice — it never relies on an asymptotic approximation. See also the chi-square test guide on Statistics Fundamentals.
Fisher's Exact Test and the Odds Ratio
For any 2×2 table, the sample odds ratio is:
The odds ratio and the p-value answer different questions:
P-value
Evaluates evidence against H₀ of independence. Does not measure the size of the association.
Odds Ratio
Describes the magnitude of the association. OR = 1 means no association; OR ≠ 1 indicates association.
Confidence Interval
Quantifies uncertainty around the odds ratio estimate. A 95% CI not containing 1 corresponds to p < 0.05 (two-sided).
A complete analysis reports all three: the 2×2 counts, the odds ratio with its confidence interval, and the exact p-value. Reporting only the p-value discards information about the direction and size of the association. See the odds ratio calculator for direct computation.
What If a 2×2 Table Contains a Zero?
Fisher's exact test can still compute a p-value when one cell is zero — the hypergeometric formula handles this without issue. However, the sample odds ratio is affected:
| Cell with zero | Sample OR | Implication |
|---|---|---|
| a = 0 or d = 0 | OR = 0 | No events in one cell; OR estimate at boundary |
| b = 0 or c = 0 | OR = undefined (∞) | Zero in denominator; OR is infinite |
For confidence intervals with zero cells, exact methods (such as the Baptista-Pike or conditional exact interval) handle the boundary correctly, while the Woolf interval (which relies on logarithms) breaks down. Adding a small constant (0.5) to all cells — a continuity correction — is one informal remedy, but it changes the data and may not be appropriate in all contexts. Most statistical software handles zero cells automatically via exact intervals.
Fisher's Exact Test Assumptions
Categorical data with two levels per variable
Both variables must be nominal or ordinal with exactly two categories each, forming a 2×2 table. Variables with more than two levels require extensions of the test or different methods.
Independent observations
Each observation must be independent of all others. Repeated measures, matched pairs, or clustered data violate this assumption and require different tests such as McNemar's test for paired binary data.
Fixed marginal totals (conditional framework)
Fisher's exact test conditions on both row totals and column totals being fixed. In practice, row totals may be fixed by design (e.g., equal group sizes), while column totals are random. The test remains valid in most practical situations even when only row totals are fixed by design.
What Fisher's exact test does not fix
The test cannot correct for selection bias, confounding variables, poor study design, or measurement error. A statistically significant Fisher's exact test in a poorly designed study tells you about the observed counts — not about any underlying truth. The validity of the conclusion depends entirely on the quality of the data and study design.
How to Interpret Fisher's Exact Test Results
If p ≤ α → Reject H₀ → Evidence of association at significance level α
If p > α → Fail to reject H₀ → Insufficient evidence of association at α
Language that is incorrect
"Fisher's exact test proves the two variables are related." — Wrong. The test provides evidence against independence; it does not prove a relationship. "p > 0.05 proves there is no association." — Wrong. Failing to reject H₀ means the data do not provide enough evidence — not that no association exists. "The result is significant, therefore the effect is large." — Wrong. Small effects can be statistically significant in larger samples. Report the odds ratio and confidence interval alongside the p-value.
Language that is correct
"Fisher's exact test provided evidence against the null hypothesis of independence (p = 0.032)." / "The result did not provide sufficient evidence to reject the null hypothesis at α = 0.05 (p = 0.071)." / "Fisher's exact test found a statistically significant association between X and Y (OR = 3.2, 95% CI [1.1, 11.4], two-sided p = 0.034). These are hypothetical data."
Fisher's Exact Test in Statistical Software
R
Returns the two-sided p-value, the sample odds ratio, and a confidence interval for the odds ratio. The alternative argument accepts "two.sided", "greater", or "less". Documentation: R stats documentation.
Python (SciPy)
table = [[a, b], [c, d]]
odds_ratio, p_value = fisher_exact(table, alternative='two-sided')
scipy.stats.fisher_exact() returns the odds ratio and p-value. The alternative parameter accepts 'two-sided', 'greater', or 'less'. Note that SciPy and R may give slightly different two-sided p-values for the same data. Documentation: SciPy documentation.
SPSS
In SPSS, Fisher's exact test is available through Analyze → Descriptive Statistics → Crosstabs → Statistics → Chi-Square. SPSS automatically includes Fisher's exact test in the output table when the table is 2×2 and the sample is small. The output reports the two-sided Fisher's exact p-value alongside the chi-square p-value.
SAS / Stata / GraphPad / JASP / Jamovi
SAS includes Fisher's exact test via PROC FREQ with the EXACT option. Stata uses tabulate var1 var2, exact. GraphPad Prism has a dedicated Fisher's exact test dialog. JASP and Jamovi both compute Fisher's exact test within their contingency table modules. Consult each package's documentation for exact syntax and the definition of "two-sided" used.
What Fisher's Exact Test Output Looks Like
The following illustrates the typical structure of output from statistical software. Values are hypothetical and for demonstration only.
| Output measure | Value (hypothetical) | What it means |
|---|---|---|
| a, b, c, d | 8, 2, 3, 7 | Observed cell counts |
| Sample odds ratio | 9.33 | OR = (a×d)/(b×c) = (8×7)/(2×3) |
| Two-sided p-value | 0.054 | Probability of result at least as extreme under H₀ |
| 95% Confidence interval | [0.96, 167.6] | Uncertainty around the odds ratio estimate |
| Alternative | two.sided | Which alternative hypothesis was tested |
| Grand total (n) | 20 | Total observations = a+b+c+d |
Common Mistakes
Confusing P_obs with the p-value
The probability of the observed table is not the p-value. The p-value is the sum of all table probabilities that are at least as extreme as the observed one.
Using a one-sided test after seeing the data
Switching to a one-sided test because the two-sided result was close to but above α doubles the Type I error rate in practice. The alternative hypothesis direction must be specified before data collection.
Reporting only the p-value
A p-value without the 2×2 counts and the odds ratio provides an incomplete picture. Readers cannot assess the size or direction of the association from a p-value alone.
Treating statistical significance as practical significance
A small p-value in a large study can accompany a trivially small odds ratio. Effect size and confidence interval width should always accompany the significance decision.
Ignoring software differences in two-sided p-values
R and Python can return slightly different two-sided exact p-values for the same table because they use different algorithms. Neither is wrong — they use different but defensible definitions of "at least as extreme."
Inferring causation from a significant result
Fisher's exact test is a test of association, not causation. A significant result means the data are unlikely under independence — not that one variable causes the other.
Fisher's Exact Test Calculator
Enter the four cell counts from your 2×2 table to compute the exact p-value, odds ratio, and key marginal totals. All calculations follow the hypergeometric probability formula described on this page.
2×2 Fisher's Exact Test — Enter Your Data
| Outcome + | Outcome − | |
|---|---|---|
| Group 1 | ||
| Group 2 |
Frequently Asked Questions
What is the Fisher's exact test table?
The Fisher's exact test table is the 2×2 contingency table used as input to the test. It shows observed counts for two binary categorical variables across two groups, with cells labeled a, b, c, and d. The test computes the exact probability of this configuration and all more extreme configurations given fixed marginal totals.
What does "exact" mean in Fisher's exact test?
"Exact" means the p-value is computed from the known hypergeometric probability distribution — not from a large-sample approximation like the chi-square distribution. The result is exact in the sense that it does not depend on asymptotic theory; it is accurate regardless of sample size.
What are cells a, b, c, and d?
In a standard 2×2 table: a = Group 1 with positive outcome; b = Group 1 with negative outcome; c = Group 2 with positive outcome; d = Group 2 with negative outcome. Row totals are a+b and c+d. Column totals are a+c and b+d. Grand total n = a+b+c+d.
What are marginal totals?
Marginal totals are the row and column sums in a contingency table. In a 2×2 table there are four: two row totals (a+b) and (c+d), and two column totals (a+c) and (b+d). Fisher's exact test conditions on all four marginal totals being fixed, which determines what other 2×2 tables are possible given the same data structure.
Does Fisher's exact test work for larger tables?
Yes. Extensions of Fisher's exact test to m×n tables exist in R (fisher.test()) and other software, using network algorithms to enumerate or approximate the relevant exact distribution. The computational burden grows substantially for large tables with large margins, so Monte Carlo estimation of the exact p-value is sometimes used instead.
Is Fisher's exact test only for small samples?
No. Fisher's exact test is valid at any sample size. The chi-square approximation is generally reliable in large samples with adequate expected counts, so the choice often comes down to convention and software defaults. For very large tables, computational efficiency may favor chi-square. For small samples or sparse tables, Fisher's exact test is the preferred choice. Many researchers apply Fisher's exact test routinely to all 2×2 tables.
What is the null hypothesis in Fisher's exact test?
H₀: the two variables are statistically independent — that is, the row variable and column variable are not associated in the population. Equivalently, H₀: the odds ratio in the population equals 1. Fisher's exact test evaluates how unlikely the observed data are if this null hypothesis were true.
Can I use Fisher's exact test for a one-sided hypothesis?
Yes. One-sided alternatives test whether a is larger than expected (greater) or smaller than expected (less). The one-sided p-value is the sum of probabilities for tables as extreme or more extreme in the specified direction. Use a one-sided test only when the direction was predicted before data collection — not after examining results.
How do I report Fisher's exact test results?
Report the 2×2 counts, the sample odds ratio, the confidence interval, the exact p-value, and the alternative hypothesis direction. Example: "Fisher's exact test found evidence of an association between treatment and outcome (OR = 9.33, 95% CI [0.96, 167.6], two-sided p = 0.054; n = 20)." If the result is not significant, report all the same quantities — the absence of statistical significance at a chosen α is not the same as the absence of an effect.
Why does my software show a different two-sided p-value than another tool?
Multiple valid definitions of "at least as extreme" exist for two-sided exact tests. The most common are: (1) the probability method, summing all tables with P ≤ P_obs; (2) the doubling method, doubling the smaller one-sided p-value. R uses method (1) and Python's SciPy also uses method (1), but their implementations can still differ slightly. Always specify your software version when reporting.
What is the hypergeometric distribution's role in Fisher's test?
When both row and column totals are fixed, cell a follows the hypergeometric distribution. The hypergeometric distribution models the number of successes in a fixed-size sample drawn without replacement from a finite population containing a known number of successes. Fisher recognized that conditioning on both margins makes cell a's distribution exactly hypergeometric under H₀, allowing exact inference without asymptotic approximation.
Does a significant Fisher's test prove causation?
No. Fisher's exact test is a test of statistical association, not causation. A statistically significant result tells you the observed data are unlikely under independence — not why the relationship exists. Establishing causation requires randomized experimental designs, not observational association tests alone.
Sources & Further Reading
Fisher, R. A. (1935). The Logic of Inductive Inference. Journal of the Royal Statistical Society, 98(1), 39–54. The original paper outlining the exact conditional test that bears Fisher's name.
Agresti, A. (2002). Categorical Data Analysis (2nd ed.). Wiley. Chapter 2 covers Fisher's exact test, hypergeometric probabilities, one- and two-sided alternatives, and odds ratios in depth. Publisher page.
R Core Team. fisher.test() documentation. The official R documentation for stats::fisher.test() describes the exact algorithm, the definition of two-sided p-values used, and confidence interval computation. stat.ethz.ch/R-manual.
SciPy documentation. scipy.stats.fisher_exact. Official Python documentation explaining the hypergeometric method and the alternative argument. docs.scipy.org.
NIST/SEMATECH e-Handbook of Statistical Methods. Section on contingency tables and categorical data. National Institute of Standards and Technology. itl.nist.gov/div898/handbook.
Lydersen, S., Fagerland, M. W., & Laake, P. (2009). Recommended tests for association in 2 × 2 tables. Statistics in Medicine, 28(7), 1159–1175. A thorough review of exact and approximate tests for 2×2 tables, including when each is recommended. doi:10.1002/sim.3531.
Related Statistical Resources
Key Takeaways
Fisher's exact test table = 2×2 contingency table
Most people searching for a "Fisher's exact test table" need the 2×2 contingency table format — cells a, b, c, d with marginal totals — not a universal critical-value reference table. The latter does not exist for this test in the way it does for chi-square or t-tests.
P-value ≠ probability of the observed table
The hypergeometric probability of the observed table (P_obs) is not the p-value. The p-value is the sum of P_obs and the probabilities of all other tables with the same margins that are at least as extreme. The p-value is always ≥ P_obs.
Report counts, OR, CI, and p together
A complete Fisher's exact test report includes the 2×2 observed counts, the sample odds ratio, the confidence interval, the p-value, and the alternative hypothesis tested. A p-value without these elements is incomplete. See the hypothesis testing guide on Statistics Fundamentals for further context.