Fisher's Exact Test Calculator screenshot

Fisher's Exact Test Calculator

A 2 × 2 table into the exact hypergeometric two-tailed p, with both one-tailed tails and the odds ratio.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Exact where arithmetic allows

Fisher's Exact Test Calculator

A 2 × 2 table into the exact hypergeometric two-tailed p, with both one-tailed tails and the odds ratio.

What the page prints, and what it refuses

Every figure is printed with the rule or formula that produced it, and any numerical tolerance is stated on the result rather than implied. The page refuses an input the formula does not define and names the value it read; it prints no answer it cannot support.

The calculation runs entirely in this browser tab; nothing is uploaded.

The page computes Fisher's exact test rather than a chi-square approximation. The table 3, 1, 1, 3 has a two-tailed p of 0.4857, and both one-tailed values are printed beside it.

The arithmetic is the hypergeometric distribution with the observed margins fixed. Probabilities are formed in log space with ln Γ, so a table with millions of counts does not underflow to zero before the sum is taken.

Why the margins are fixed

Fisher's test conditions on the row and column totals. With those fixed, the count in cell a determines the whole table, and its probability is C(r₁, a)·C(r₂, c₁ − a) ÷ C(n, c₁).

The two-tailed p sums every table at least as extreme as the observed one, where extreme means a probability no larger. The page prints the observed table's probability nowhere separately because the tails and the p are the answer; the odds ratio is printed as the effect size.

How to use Fisher's Exact Test Calculator

Enter the four cells a, b, c and d, then press Run.

The result prints the two-tailed p, both one-tailed p-values, the odds ratio and the margins.

What to Expect

Best for

  • Testing a small 2 × 2 table exactly
  • Checking a chi-square result on sparse counts
  • Reporting an exact p beside an odds ratio

Not ideal for

  • A table with a zero margin, which has no test
  • Tables larger than 2 × 2
  • A claim about study design or causation

What this tool keeps

  • The four cells exactly as typed

What may need cleanup

  • Nothing: the p-values are final numbers

Common errors

  • A zero row or column total is refused
  • A negative or fractional cell is refused by name

Example use cases

  • Test the table 3, 1, 1, 3
  • Check a sparse clinical table
  • Compare with a chi-square p

Sample input

a = 3, b = 1, c = 1, d = 3

Sample output

two-tailed p = 0.4857, odds ratio = 9

Who this is for

  • Researchers with small samples
  • Students comparing exact and approximate tests

Frequently asked questions

Why is the two-tailed p larger than either tail?

It sums both tails plus any table as extreme in the other direction. For the symmetric table 3, 1, 1, 3 the left tail is 0.9857 and the right tail 0.2429, and the two-sided value is 0.4857.

How is extreme defined?

A table is at least as extreme when its probability is no larger than the observed table's. That is the standard Fisher definition, and the page follows it rather than choosing a direction.

Does a zero cell break the test?

No. The exact test handles zero cells; only a zero row or column total is refused, because then there is no table to test.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.