Statistical Test
Fisher's Exact Test Calculator
The go-to test for small samples and sparse 2×2 tables. Computes an exact p-value directly from the hypergeometric distribution — no chi-square approximation needed.
Try it now — drop your data file
CSV or Excel. Your data stays in your browser.
Drop your spreadsheet here
CSV or Excel · up to 50 MB
What is Fisher's exact test?
Proposed by Ronald A. Fisher in 1922, Fisher's exact test assesses the null hypothesis of independence between two categorical variables in a 2×2 contingency table. Unlike the chi-square test, it computes the exact probability of observing a distribution as extreme as the one in your data — no approximation, no asymptotic assumption.
The test is especially valuable when cell counts are small. Chi-square becomes unreliable when expected cell frequencies drop below 5, but Fisher's exact test remains valid regardless of sample size. It's widely used in clinical trials, genetic association studies, and any setting where a rare event is measured in small cohorts.
The trade-off is computational cost: for large tables or large totals the calculation is intensive. Crosstabs handles this entirely in your browser using an efficient algorithm, so you get exact p-values without any server round-trip.
When to use it
- Your table is 2×2 (two binary categorical variables).
- One or more expected cell frequencies fall below 5.
- Your total sample size is small (typically n < 30).
- You need an exact p-value rather than an asymptotic approximation.
- You are testing rare events — e.g., adverse reactions in clinical trials.
For larger tables or samples comfortably above n = 30 with healthy cell counts, the chi-square test is generally preferred and computationally faster.
Formula
Hypergeometric probability (2×2 table)
p = C(a+b, a) × C(c+d, c) / C(n, a+c)
Table cells: a (top-left), b (top-right), c (bottom-left), d (bottom-right)
n = a + b + c + d (grand total)
C(n, k) = n! / (k! × (n−k)!) — binomial coefficient
The two-tailed p-value sums probabilities for all tables as extreme or more extreme.
Interpreting the results
Fisher's exact test returns a p-value. Using the conventional α = 0.05 threshold: if p < 0.05 you reject the null hypothesis of independence and conclude the two variables are associated.
The test does not directly quantify the strength or direction of the association. For that, pair it with the odds ratio (and its 95% confidence interval), which tells you how much more likely one outcome is given a particular exposure. Many published analyses report both the exact p-value and the odds ratio together.
p > 0.05
Not significant
No evidence to reject independence. Could be a true null result or a power issue if the sample is very small.
p ≤ 0.05
Significant
Reject independence. Report the odds ratio and confidence interval to characterise the effect.