Statistical Test

Fisher's Exact Test Calculator

The go-to test for small samples and sparse 2×2 tables. Computes an exact p-value directly from the hypergeometric distribution — no chi-square approximation needed.

Calculate online — no file needed

Type or paste your observed counts. Results update live, and the link in your address bar always reproduces this exact table.

Table sizeTip: paste a block of counts straight from a spreadsheet.
Total
10
6
Total9716

Fisher's exact test (two-sided)

p = .035

Odds ratio 20.00 (95% CI 1.42–282.46)

χ²(1, N = 16) = 6.11, p = .013, V = .62

3 cells have an expected count below 5 (minimum 2.63), so the chi-square approximation may be unreliable. Prefer Fisher's exact test (shown in the table below).
All statistics
Pearson chi-squareχ² = 6.112, df = 1, p = .013
G-test (likelihood ratio)G = 6.515, df = 1, p = .011
Chi-square with Yates' correctionχ² = 3.810, p = .051
Fisher's exact test (two-sided)p = .035
Odds ratio20.000 (95% CI 1.416 – 282.463)
Cramér's V0.618 (large)
Phi coefficient (φ)0.618
Contingency coefficient (C)0.526
Lambda (symmetric / row|col / col|row)0.538 / 0.500 / 0.571
Goodman–Kruskal gamma (γ)0.905
Kendall's tau-b / tau-c0.618 / 0.594
Somers' d (symmetric / row|col / col|row)0.618 / 0.633 / 0.603
Theil's U (symmetric / row|col / col|row)0.302 / 0.308 / 0.297

Have a data file? Skip the typing

CSV or XLSX. Files are parsed locally before you enter the workspace.

Drop your spreadsheet here

CSV, XLSX, or SPSS .sav · up to 50 MB

Reviewed by the crosstabs.com methods team · Last updated

What is Fisher's exact test?

Proposed by Ronald A. Fisher in 1922, Fisher's exact test assesses the null hypothesis of independence between two categorical variables in a 2×2 contingency table. Unlike the chi-square test, it computes the exact probability of observing a distribution as extreme as the one in your data — no approximation, no asymptotic assumption.

The test is especially valuable when cell counts are small. Chi-square becomes unreliable when expected cell frequencies drop below 5, but Fisher's exact test remains valid regardless of sample size. It's widely used in clinical trials, genetic association studies, and any setting where a rare event is measured in small cohorts.

The trade-off is computational cost: for large tables or large totals the calculation is intensive. Crosstabs handles this entirely in your browser using an efficient algorithm, so you get exact p-values without any server round-trip.

When to use it

  • Your table is 2×2 (two binary categorical variables).
  • One or more expected cell frequencies fall below 5.
  • Your total sample size is small (typically n < 30).
  • You need an exact p-value rather than an asymptotic approximation.
  • You are testing rare events — e.g., adverse reactions in clinical trials.

For larger tables or samples comfortably above n = 30 with healthy cell counts, the chi-square test is generally preferred and computationally faster.

Formula

Hypergeometric probability (2×2 table)

p = C(a+b, a) × C(c+d, c) / C(n, a+c)

Table cells: a (top-left), b (top-right), c (bottom-left), d (bottom-right)

n = a + b + c + d (grand total)

C(n, k) = n! / (k! × (n−k)!) — binomial coefficient

The two-tailed p-value sums probabilities for all tables as extreme or more extreme.

Interpreting the results

Fisher's exact test returns a p-value. Using the conventional α = 0.05 threshold: if p < 0.05 you reject the null hypothesis of independence and conclude the two variables are associated.

The test does not directly quantify the strength or direction of the association. For that, pair it with the odds ratio (and its 95% confidence interval), which tells you how much more likely one outcome is given a particular exposure. Many published analyses report both the exact p-value and the odds ratio together.

p > 0.05

Not significant

No evidence to reject independence. Could be a true null result or a power issue if the sample is very small.

p ≤ 0.05

Significant

Reject independence. Report the odds ratio and confidence interval to characterise the effect.

Worked example

Worked example

Take a small 2×2 table [[8, 2], [1, 9]] — that is a=8, b=2, c=1, d=9, for a total of just 20 observations.

The sample odds ratio is (8×9) / (2×1) = 72 / 2 = OR = 36.

Fisher's exact test gives a two-sided p-value of about p ≈ 0.0055— strong evidence of association despite the tiny sample. Here the chi-square approximation would be unreliable because the expected counts are small, which is exactly the situation Fisher's exact test is built for.

Frequently asked questions

When should you use Fisher's exact test?
Use Fisher's exact test for a 2×2 table when the sample is small or any expected cell count is below about 5, where the chi-square approximation becomes unreliable. It gives an exact p-value with no large-sample assumption.
What does Fisher's exact p-value mean?
It is the exact probability, under independence, of obtaining a table as extreme as or more extreme than the one observed, computed from the hypergeometric distribution rather than an approximation.
Fisher's exact test vs chi-square — which should I use?
Use chi-square for larger samples with all expected counts at least 5; switch to Fisher's exact for small 2×2 tables. When expected counts are large the two usually agree.

References & further reading

Related calculators