When analyzing categorical data to see if two variables are related (such as “Treatment vs. Placebo” and “Cured vs. Not Cured”), the standard approach is the Chi-Square test. However, the Chi-Square test relies on mathematical approximations that completely break down when your sample size is very small. If any cell in your data table has an expected value of less than 5, you must use Fisher’s Exact Test.
Our free online Fisher’s Exact Test Calculator analyzes your 2×2 contingency table using intensive factorial mathematics. Instead of giving you an estimation, it calculates the exact p-value, proving definitively whether the association between your two categorical variables is statistically significant or purely random.
Understanding the 2×2 Contingency Table
Fisher’s Exact Test is almost exclusively run on a 2×2 matrix, meaning you are tracking exactly two groups and exactly two possible outcomes. The calculator assigns algebraic variables (a, b, c, d) to each cell to process the factorial math.
| Test Group | Outcome 1 (e.g., Cured) | Outcome 2 (e.g., Not Cured) | Row Totals |
|---|---|---|---|
| Group 1 (Treatment) | Cell a | Cell b | a + b |
| Group 2 (Placebo) | Cell c | Cell d | c + d |
| Column Totals | a + c |
b + d |
N (Total Sample) |
The Factorial Math Behind Fisher’s Exact Test
Because the test calculates the exact hypergeometric probability of observing your specific table layout, the formula requires heavy factorial (!) calculations. This is why the test is traditionally run on computers rather than by hand.
| Mathematical Equation | Formula Breakdown |
|---|---|
| Numerator (The Totals) | (a+b)! · (c+d)! · (a+c)! · (b+d)!The factorial of all four row and column marginal totals multiplied together. |
| Denominator (The Cells) | a! · b! · c! · d! · N!The factorial of the four individual cells and the total sample size (N) multiplied together. |
| Final Exact P-Value | p = Numerator / Denominator |
If the final calculated p-value is less than your designated alpha level (usually 0.05), you can reject the null hypothesis and confirm that the relationship between your two variables is statistically significant.
If you are trying to find the boundaries for a different test, utilize our Critical Value Calculator. To determine how many independent parameters exist in your matrix, use our Degrees of Freedom Calculator.
Frequently Asked Questions (FAQ)
When should I use Fisher’s Exact Test instead of Chi-Square?
You must use Fisher’s Exact Test when your sample sizes are very small. The strict statistical rule is that if more than 20% of your expected cell frequencies are less than 5, or if any single expected cell frequency is less than 1, the Chi-Square approximation is invalid. Fisher’s Exact Test mathematically guarantees accuracy regardless of how small the numbers are.
Can Fisher’s Exact Test be used on large samples?
Yes, but it is rarely done. Because the formula relies on massive factorial calculations (like calculating 150!), computing Fisher’s test on large sample sizes used to crash early statistical software. Today, modern computers can easily handle it, but most researchers switch to Chi-Square for large datasets because the two tests yield virtually identical p-values at high sample volumes.
What is the difference between a one-tailed and two-tailed Fisher’s Test?
A one-tailed test only looks for an association in one specific direction (e.g., “Does the treatment group have a higher cure rate than the placebo group?”). A two-tailed test looks for an association in both directions (e.g., “Is there any difference at all between the treatment and the placebo?”). Standard clinical research typically demands a two-tailed p-value.