Skip to content

Fisher's Exact Test Calculator

Type the four counts of a 2 × 2 table and get Fisher's exact p-value — two-sided and both one-sided versions — with the sample odds ratio, R's conditional maximum-likelihood odds ratio and its exact confidence interval, and the probability of every table that shares your margins. It is the test to use when expected counts are too small for chi-square. Free, no sign-up.

Type the four counts. Rename the rows (groups) and columns (outcomes) to label the results.

Total
—
—
Total———

The odds ratio compares the odds of column 1 in row 1 with the odds of column 1 in row 2.

Fill all four cells with whole-number counts — zero is allowed.

How to Use the Fisher's Exact Test Calculator

  1. 1. Enter the table. Put the groups in the rows and the outcomes in the columns, type the four counts, and rename the rows and columns so the results read naturally.
  2. 2. Choose the alternative. Two-sided asks whether the odds ratio differs from 1. The one-sided options ask whether row 1 has lower (< 1) or higher (> 1) odds of the column 1 outcome than row 2.
  3. 3. Pick α and a confidence level for the decision and the odds-ratio interval.
  4. 4. Read and report. The results give all three p-values, both odds ratios, the exact interval, a list of every table with your margins, the working, and an APA line.

How the Exact p-Value Is Found

Label the cells a and b (row 1) and c and d (row 2). Fisher's test treats every row and column total as fixed. Once they are, the top-left count a determines the whole table, and under the null hypothesis of no association it follows the hypergeometric distribution: P(a) = C(a + c, a) × C(b + d, b) / C(N, a + b), where C(n, k) counts combinations. The calculator lists every value a can take, with its probability.

  • One-sided p-values add up one tail: P(X ≤ a) for an odds ratio below 1, P(X ≥ a) for an odds ratio above 1.
  • The two-sided p-value adds up the probability of every table that is no more likely than the one you observed. That is the method R and SciPy use; the calculator also allows a relative tolerance of 10⁻⁷, as R does, so that tables that are equally likely in exact arithmetic are not split by rounding.
  • Doubling the smaller one-sided p, an older shortcut, can give a different answer when the distribution is lopsided. Say which two-sided method you used if it matters.

Worked Example: Tutoring and Pass Rates

Click Try an example to load a small study: of 10 tutored students, 8 passed and 2 failed; of 6 who were not tutored, 1 passed and 5 failed. With 16 students, three of the four expected counts are below 5, so the chi-square approximation would be unreliable. The margins fix a + b = 10, a + c = 9 and N = 16, so a can only run from 3 to 9.

Fisher's exact test, step by step

P(a = 8) = C(9, 8) × C(7, 2) / C(16, 10) = 9 × 21 / 8008 = .0236

Tables no more likely than a = 8: a = 3 (.0105), a = 8 (.0236), a = 9 (.0009)

two-sided p = .0105 + .0236 + .0009 = .0350

sample OR = (8 × 5) / (2 × 1) = 20; conditional MLE = 15.47, 95% CI [1.01, 1059.64]

In APA style: tutored students were more likely to pass (8 of 10) than students without tutoring (1 of 6), Fisher's exact test, p = .035, OR = 15.47, 95% CI [1.01, 1059.64]. The enormous interval is the honest part of the result: with 16 students the data are compatible with anything from a negligible to a huge effect.

Two Odds Ratios, and Why They Differ

The sample odds ratio ad / bc is what most textbooks and SciPy's fisher_exact report. R's fisher.test instead reports the conditional maximum-likelihood estimate — the odds ratio that makes the observed a the expected value under the noncentral hypergeometric distribution — together with an exact interval built from the same distribution. The two estimates agree closely in large tables and drift apart in small ones (20 versus 15.47 in the example). Report the conditional estimate when you report the exact interval, so the estimate and its interval come from the same model. When a cell is zero the sample odds ratio is 0 or infinite, while the interval still has one finite end.

Frequently Asked Questions

When should I use Fisher's exact test instead of chi-square?
When a 2 × 2 table has small expected counts — the common rule is any expected count below 5. The chi-square test relies on a large-sample approximation that breaks down there, while Fisher's test computes the probability exactly. With large counts the two give similar p-values, and either is acceptable.
Does Fisher's exact test work for tables larger than 2 × 2?
The idea extends to r × c tables (the Freeman–Halton extension), but this calculator handles 2 × 2 tables only. For larger tables with small counts, use statistical software that offers an exact or Monte Carlo test, or combine sparse categories and use the chi-square test.
Why is Fisher's exact test called conservative?
Because it treats both margins as fixed, the test statistic can take only a handful of values, so the actual false-positive rate is usually below the nominal α rather than equal to it. Some statisticians prefer mid-p values or unconditional tests such as Barnard's for that reason; Fisher's test remains the standard, widely accepted choice.
How do I report Fisher's exact test in APA style?
Give the counts or percentages for each group, name the test, and report the p-value and an effect size with its interval: Fisher's exact test, p = .035, OR = 15.47, 95% CI [1.01, 1059.64]. Italicise p and OR; there is no test statistic or degrees of freedom to report.
Why does my software give a different two-sided p-value?
Some programs and textbooks double the smaller one-sided p-value instead of summing the probabilities of every table no more likely than yours. R and SciPy sum, as this calculator does, so they should match it; if your program doubles, compare its result with twice the smaller one-sided p shown here. Tiny differences can also come from how near-ties in probability are handled.
What does the odds ratio from Fisher's test mean?
It compares the odds of the column 1 outcome in row 1 with those odds in row 2. An odds ratio of 1 means no association; above 1, row 1 has higher odds; below 1, lower. Because the table is small, always read the confidence interval as well — it shows how precisely the odds ratio is known.

Related Tools

More in Statistics Calculators

See all Statistics Calculators