About the Fisher's Exact Test
The Fisher's Exact Test Calculator computes the exact two-tailed p-value for a 2x2 contingency table of counts, instead of relying on the chi-square approximation. It is built for situations with small sample sizes or low expected cell counts, where a chi-square test's large-sample assumptions become unreliable. Enter the four cell counts and the calculator returns a p-value drawn directly from the hypergeometric distribution.
How It Works
You enter four non-negative counts arranged in a 2x2 table (row 1/column 1, row 1/column 2, row 2/column 1, row 2/column 2). The calculator holds the row and column totals fixed and asks, among every possible table sharing those same totals, how likely a table at least as extreme as yours would be. It sums the exact hypergeometric probability of every such table, giving a two-tailed p-value for the observed pattern.
Formula & Methodology
By hand, first tabulate the four cell counts and their row, column, and grand totals. Then, for every table achievable with those same margins, compute its hypergeometric probability using the factorial formula above. Add together the probabilities of every table that is no more likely than the one you actually observed - that sum is the two-tailed p-value.
Examples
A small pilot study
With counts a=8, b=2, c=3, d=7 (20 total observations), the calculator sums the hypergeometric probabilities of the observed table and every table no more likely than it, returning a two-tailed p-value of about 0.0698 (6.98 percent) - just above the conventional 0.05 significance threshold.
A strongly skewed table
With counts a=9, b=1, c=1, d=9 (20 total observations, evenly split margins), nearly all the ratings cluster on the diagonal. The calculator returns a two-tailed p-value of about 0.0011 (0.11 percent), indicating an association unlikely to have arisen by chance.
Advantages
- Gives an exact p-value rather than an approximation, remaining valid even when expected cell counts fall below the usual chi-square guideline of 5 per cell.
- Works directly from raw counts, with no need to verify large-sample assumptions before trusting the result.
- Handles small or unbalanced 2x2 tables, such as a 20-person pilot study, where a chi-square test could over- or under-state significance.
Common Mistakes
- Treating a large p-value as proof that no relationship exists, rather than as evidence the data don't provide strong enough support at this sample size.
- Applying the test to tables larger than 2x2, which this calculator's formula does not accommodate.
- Entering percentages or rates instead of actual observation counts, which are required for the hypergeometric calculation to be meaningful.
Edge Cases to Watch For
- All four cell counts must be zero or greater; negative entries are rejected outright.
- The table must contain at least one observation across all four cells.
- The valid range of possible counts in cell a runs from max(0, R1-(N-K)) to min(R1, K), covering every table achievable with the same row and column totals.
- The reported p-value is capped at 1, since summing many small probabilities can occasionally round fractionally above 1.
Common Use Cases
- Researchers analyzing a small clinical trial or pilot study comparing a binary outcome between two groups.
- Quality control teams testing whether a defect rate differs between two production batches when sample sizes are limited.
- Analysts checking the association between two binary survey questions when the respondent count is too small for a reliable chi-square test.