Fisher's Exact Test Calculator
Calculate exact probabilities, odds ratio, tail probabilities, and expected counts from four entries in a 2×2 contingency table. Fisher's Exact Test Calculator helps researchers, analysts, and students evaluate associations in small categorical datasets.
Highlights
- Calculate Fisher’s exact test results from a 2×2 contingency table.
- Get exact left-tailed, right-tailed, and two-tailed p-values.
- Measure association strength with the odds ratio.
- Compare observed and expected cell counts.
- View the total sample size for your dataset.
Table of Contents
How Fisher's Exact Test Calculator Works?
Fisher's Exact Test evaluates the association between two categorical variables in a 2×2 contingency table. Enter four nonnegative integer counts arranged as follows:
| Outcome 1 | Outcome 2 | Row total | |
|---|---|---|---|
| Group 1 | a = Cell A | b = Cell B | a + b |
| Group 2 | c = Cell C | d = Cell D | c + d |
| Column total | a + c | b + d | n = a + b + c + d |
The calculator treats the row and column totals as fixed and determines the exact probability of the observed arrangement using the hypergeometric distribution. For the entered table, the observed table probability is:
The odds ratio describes the strength and direction of association:
An odds ratio of 1 indicates no association, a value above 1 indicates higher odds for the first outcome in Group 1, and a value below 1 indicates lower odds. The expected counts under independence are calculated from the marginal totals:
Thus, Expected Cell A is , with analogous calculations for the other three cells. The left-tailed p-value sums probabilities for tables with an association at least as small as the observed table, while the right-tailed p-value sums probabilities for tables with an association at least as large. The two-tailed p-value sums the probabilities of all tables with probability no greater than the observed table, representing associations at least as extreme in either direction.
Practical Use Cases
Clinical researchers can compare treatment outcomes between two groups when the sample is small, such as examining whether a new therapy is associated with recovery when several table cells contain low counts.
Medical and public-health analysts can test relationships between an exposure and a binary health outcome, such as vaccination status and infection status, without relying on large-sample approximations.
Biologists and geneticists can assess whether two categorical traits are associated in a small experimental or family dataset, using the odds ratio to describe the strength of the relationship.
Market researchers can examine whether customer group membership is related to a binary preference, purchase decision, or response when survey segments are uneven or small.
Quality-control specialists can test whether defect status is associated with production line, supplier, or inspection condition when the number of observed defects is limited.
Students and statistics instructors can use the four cell counts to connect a 2×2 table with exact probabilities, expected counts, odds ratios, and one- or two-tailed significance measures.
Accuracy and Limitations
The calculator uses exact hypergeometric probabilities for nonnegative integer cell counts and fixed marginal totals, avoiding the large-sample approximation used by a chi-square test. Expected counts are theoretical values under independence, not additional observations. The odds ratio can be undefined or infinite when the cross-product denominator is zero, and very large counts may require careful numerical handling of factorial-based calculations. The result also depends on how the rows and columns are defined: reversing a group or outcome changes the odds-ratio direction and can change which one-tailed result is relevant. A p-value indicates compatibility with the no-association model, not the practical importance or causal meaning of the relationship.
Quick Examples
Example #1: Small Clinical Trial
Evaluate whether treatment assignment is associated with patient recovery in a small clinical study.
Example #2: Rare Disease Association
Test the relationship between exposure to a potential risk factor and occurrence of a rare disease.
Example #3: Survey Response Comparison
Determine whether positive survey responses differ between two demographic groups.