Calculator Inputs
Enter whole-number counts for a 2×2 table, choose the hypothesis direction, and calculate exact p-values, odds ratios, and effect summaries.
Example data table
This example uses a small-sample comparison where exact inference is more reliable than a large-sample approximation.
| Improved | Not Improved | Row total | |
|---|---|---|---|
| Treatment | 9 | 1 | 10 |
| Control | 4 | 8 | 12 |
| Column total | 13 | 9 | 22 |
Formula used
Fisher’s exact test conditions on fixed row and column totals, then evaluates the exact probability of the observed table and comparable tables.
Exact table probability
For a 2×2 table with fixed margins, the probability of the top-left count a is:
P(a) = [C(c1, a) × C(c2, r1 − a)] / C(n, r1)
Here, r1 and r2 are row totals, c1 and c2 are column totals, and n is the grand total.
Two-sided exact p-value
The calculator sums the probabilities of every feasible table whose exact probability is less than or equal to the observed table probability. That is a common two-sided Fisher definition for 2×2 tables with fixed margins.
Expected counts
Expected counts are shown for reference:
Expected cell = (row total × column total) / n
Odds ratio and interval
Odds ratio = (a × d) / (b × c)
The interval shown is an approximate log-odds-ratio interval. When a zero cell appears and you enable adjustment, the calculator adds 0.5 to all cells before estimating the odds ratio and its interval.
How to use this calculator
- Enter labels for both rows and both columns.
- Type whole-number counts into cells A, B, C, and D.
- Choose a two-sided, less-than, or greater-than hypothesis.
- Set alpha, confidence level, and decimal precision.
- Click the calculate button to generate exact results.
- Review the p-values, odds ratio, expected counts, and interpretation.
- Use the chart to inspect the feasible exact distribution.
- Download a CSV for analysis records.
- Download a PDF report for printing or sharing.
Frequently asked questions
1) What does Fisher’s exact test evaluate?
It evaluates whether two categorical variables are associated in a 2×2 table, using exact probabilities rather than large-sample approximations.
2) When should I prefer it over a chi-square test?
Use it when sample sizes are small, expected counts are low, or you want an exact result that does not rely on asymptotic assumptions.
3) What do two-sided, less-than, and greater-than mean?
Two-sided checks for any association. Less-than and greater-than test directional alternatives based on the top-left cell and the fixed table margins.
4) Can I enter percentages or decimal values?
No. Fisher’s exact test requires raw whole-number counts in each cell of the 2×2 contingency table.
5) Why are expected counts shown if the test is exact?
Expected counts help you understand the table structure and compare observed counts with independence expectations, even though the p-value itself is exact.
6) What does the odds ratio tell me?
It summarizes direction and strength of association. Values above 1 suggest higher odds in row one for the first-column outcome.
7) Does a significant result prove causation?
No. A significant p-value suggests association, not causation. Study design, bias, confounding, and domain knowledge still matter.
8) What happens if one of the cells is zero?
The exact p-value still works. The optional 0.5 adjustment only affects odds-ratio style summaries when a zero cell would otherwise destabilize them.