Fisher's Exact Test Calculator
Perform Fisher's exact test on 2×2 contingency tables. Get exact p-values (one-tailed and two-tailed), odds ratio, relative risk, step-by-step hypergeometric probability calculations, and interactive mosaic plot visualization.
Your ad blocker is preventing us from showing ads
MiniWebtool is free because of ads. If this tool helped you, please support us by going Premium (ad‑free + faster tools), or allowlist MiniWebtool.com and reload.
- Allow ads for MiniWebtool.com, then reload
- Or upgrade to Premium (ad‑free)
About Fisher's Exact Test Calculator
The Fisher's Exact Test Calculator performs the exact significance test for 2×2 contingency tables using the hypergeometric distribution. Unlike the chi-square test which relies on an asymptotic approximation, Fisher's test computes exact p-values, making it the gold standard for analyzing categorical data — especially with small sample sizes. Enter your 2×2 table to get one-tailed and two-tailed p-values, odds ratios, relative risk, interactive mosaic plots, and step-by-step solutions.
How to Use the Fisher's Exact Test Calculator
- Enter cell values — input the four observed frequency counts for your 2×2 contingency table. Cell "a" represents Group 1 with a positive outcome, "b" is Group 1 with a negative outcome, "c" is Group 2 positive, and "d" is Group 2 negative. You can also click a quick example to see how it works.
- Choose test direction — select "Two-Tailed" to test for any association (most common), "Left-Tailed" if you hypothesize that the odds ratio is less than 1, or "Right-Tailed" if you expect it to be greater than 1.
- Set significance level — choose α (commonly 0.05). A smaller α requires stronger evidence to reject the null hypothesis.
- Interpret the results — review the p-value, odds ratio, relative risk, mosaic plot, hypergeometric probability distribution chart, and the detailed step-by-step calculation.
What Is Fisher's Exact Test?
Fisher's exact test, developed by Sir Ronald Fisher in 1935, is a statistical significance test for categorical data in contingency tables. It determines whether there is a nonrandom association between two categorical variables. The test is called "exact" because it calculates the exact probability of obtaining the observed data (or more extreme data) under the null hypothesis of independence, rather than relying on approximations like the chi-square test.
The Hypergeometric Distribution Formula
The probability of observing a particular 2×2 table with fixed marginal totals is given by the hypergeometric distribution:
= (R₁! × R₂! × C₁! × C₂!) / (N! × a! × b! × c! × d!)
Where R₁, R₂ are row totals, C₁, C₂ are column totals, and N is the grand total. This formula computes the exact probability of observing exactly that arrangement of values in the table.
When to Use Fisher's Exact Test
- Small sample sizes — when any expected cell count is less than 5, chi-square approximation becomes unreliable and Fisher's test is recommended
- 2×2 tables — the test is specifically designed for two-by-two contingency tables
- Exact inference needed — when you need an exact p-value rather than an asymptotic approximation
- Clinical trials — commonly used in medical research to compare treatment vs. control group outcomes
- Quality control — testing if defect rates differ between processes or batches
Fisher's Exact Test vs. Chi-Square Test
Both tests assess independence in contingency tables, but they differ in approach:
- Fisher's test computes exact probabilities; chi-square uses a large-sample approximation
- Fisher's test is always valid regardless of sample size; chi-square requires expected counts ≥ 5
- For large samples, both tests give nearly identical results, but chi-square is faster to compute
- Fisher's test becomes computationally intensive for very large tables (N > 1000)
Understanding Odds Ratio and Relative Risk
The odds ratio (OR) measures the strength of association between two events. OR = (a × d) / (b × c). An OR of 1 means no association, OR > 1 means the outcome is more likely in Group 1, and OR < 1 means it is more likely in Group 2. The 95% confidence interval helps assess whether the OR is statistically distinguishable from 1.
The relative risk (RR) compares the probability of the outcome between groups. RR = [a/(a+b)] / [c/(c+d)]. While the OR approximates the RR when the outcome is rare, they diverge for common outcomes. RR is often more intuitive to interpret in prospective studies.
One-Tailed vs. Two-Tailed Tests
A two-tailed test sums the probabilities of all tables that are equally or less probable than the observed table, regardless of the direction of the association. This is the most common and conservative approach. A one-tailed test only considers tables in one direction — left-tailed for OR < 1 or right-tailed for OR > 1 — and should only be used when you have a strong prior hypothesis about the direction of the effect.
FAQ
What is Fisher's exact test?
Fisher's exact test is a statistical significance test used to determine if there is a nonrandom association between two categorical variables in a 2×2 contingency table. Unlike the chi-square test, it calculates exact probabilities using the hypergeometric distribution, making it ideal for small sample sizes or when expected cell counts are below 5.
When should I use Fisher's exact test instead of chi-square?
Use Fisher's exact test when any expected cell count in your 2×2 table is less than 5, when the total sample size is small (typically less than 20-30), or when you want an exact p-value rather than an approximation. Fisher's test is always valid regardless of sample size, while chi-square is an approximation that becomes unreliable with small samples.
What is the difference between one-tailed and two-tailed Fisher's exact test?
A two-tailed test checks for any association between variables regardless of direction and is the most commonly used approach. A one-tailed test checks for association in a specific direction: left-tailed tests if the odds ratio is less than 1, and right-tailed tests if it is greater than 1. Use a two-tailed test unless you have a strong prior hypothesis about the direction of the effect.
How is the p-value calculated in Fisher's exact test?
The p-value is calculated using the hypergeometric distribution. For a given 2×2 table with fixed row and column totals, the exact probability of that table is computed. For a two-tailed test, the probabilities of all possible tables that are equally or less probable than the observed table are summed. For one-tailed tests, probabilities are summed in one direction only.
What does the odds ratio tell me in Fisher's exact test?
The odds ratio measures the strength of association between two categorical variables. An odds ratio of 1 means no association. Greater than 1 means Group 1 has higher odds of the positive outcome compared to Group 2. Less than 1 means Group 2 has higher odds. The 95% confidence interval helps assess whether the association is statistically meaningful — if the interval includes 1, the association may not be significant.
Reference this content, page, or tool as:
"Fisher's Exact Test Calculator" at https://MiniWebtool.com// from MiniWebtool, https://MiniWebtool.com/
by miniwebtool team. Updated: 2026-04-15
You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.