Exact test for 2×2 contingency tables. Ideal when expected cell frequencies are less than 5 or sample sizes are small. Results include exact p-value, odds ratio, and confidence interval.
Fisher's exact test is a statistical significance test used to determine whether there is a non-random association between two categorical variables in a 2×2 contingency table. Unlike the chi-square test, which relies on a large-sample approximation, Fisher's exact test computes the exact probability of observing the data (or more extreme data) under the null hypothesis of independence. This makes it especially appropriate when sample sizes are small or when expected cell frequencies fall below 5.
Use Fisher's exact test instead of the chi-square test when one or more of the following conditions apply: your total sample size is small (typically N < 20-30), any expected cell frequency is below 5, or you have a 2×2 table with highly unbalanced marginals. It is the gold standard for small-sample categorical analysis and is commonly used in clinical trials, epidemiology, and biomedical research where sample sizes may be limited.
| Feature | Fisher's Exact | Chi-Square |
|---|---|---|
| Method | Exact (hypergeometric) | Approximate |
| Table size | 2×2 only | Any size |
| Sample size | Any (ideal for small) | Large (N ≥ 20) |
| Expected freq < 5 | No problem | Unreliable |
| Effect size | Odds ratio, Phi | Cramer's V |
A clinical trial tests whether a new treatment improves patient outcomes compared to a control. With only 20 patients, the chi-square approximation may be unreliable, so Fisher's exact test is used.
| Improved | Not Improved | Total | |
|---|---|---|---|
| Treatment | 8 | 2 | 10 |
| Control | 1 | 9 | 10 |
| Total | 9 | 11 | 20 |
Results
Fisher's exact test, p = .003, OR = 36.00, 95% CI [3.26, 397.53]
There was a statistically significant association between treatment and outcome. Patients in the treatment group were significantly more likely to improve than those in the control group (OR = 36.00).
Fisher's exact test has fewer assumptions than the chi-square test, but the following must still be met:
1. 2×2 Contingency Table
The data must be organized in a 2×2 table with two binary categorical variables. For larger tables, consider the chi-square test or the Freeman-Halton extension of Fisher's test.
2. Independent Observations
Each observation must be independent. Each subject contributes to only one cell of the table. For paired or matched data, use McNemar's test instead.
3. Fixed Marginals
The test assumes that either the row totals, column totals, or both are fixed by the study design. This is automatically satisfied in most experimental and observational studies.
The odds ratio (OR) quantifies the strength and direction of the association in a 2×2 table. It compares the odds of the outcome in one group to the odds in the other group:
| OR Value | Interpretation |
|---|---|
| OR = 1 | No association between the variables |
| OR > 1 | Positive association (higher odds in first row) |
| OR < 1 | Negative association (lower odds in first row) |
| 95% CI includes 1 | Association is not statistically significant |
When reporting Fisher's exact test results in APA format, include the test name, p-value, odds ratio, and 95% confidence interval:
Template
Fisher's exact test indicated a [significant/non-significant] association between [Variable 1] and [Variable 2], p = .XXX, OR = X.XX, 95% CI [X.XX, X.XX].
Example Report
Fisher's exact test indicated a significant association between treatment condition and patient improvement, p = .003, OR = 36.00, 95% CI [3.26, 397.53]. Patients receiving the treatment were significantly more likely to improve than those in the control group.
Note: Report p-values to three decimal places, using p < .001 when below that threshold. Always include the odds ratio and its 95% confidence interval. If any cell contains zero, note that the odds ratio may be undefined or infinite.
StatMate's Fisher's exact test calculations have been validated against R's fisher.test() function and SAS output. The implementation uses log-factorials to avoid numerical overflow and enumerates all possible tables with fixed marginals to compute exact two-tailed p-values. All results match R output to at least 4 decimal places.
T-Test
Compare means between two groups
ANOVA
Compare means across 3+ groups
Chi-Square
Test categorical associations
Correlation
Measure relationship strength
Descriptive
Summarize your data
Sample Size
Power analysis & sample planning
One-Sample T
Test against a known value
Mann-Whitney U
Non-parametric group comparison
Wilcoxon
Non-parametric paired test
Regression
Model X-Y relationships
Multiple Regression
Multiple predictors
Cronbach's Alpha
Scale reliability
Logistic Regression
Binary outcome prediction
Factor Analysis
Explore latent factor structure
Kruskal-Wallis
Non-parametric 3+ group comparison
Repeated Measures
Within-subjects ANOVA
Two-Way ANOVA
Factorial design analysis
Friedman Test
Non-parametric repeated measures
McNemar Test
Paired nominal data test
Enter your data and click Calculate
or click "Load Example" to try it out