InfyCalculator
📊

Fisher's Exact Test Calculator (2×2)

Exact p-value for a 2×2 table — one- and two-sided Fisher's exact test with the odds ratio, for small samples where chi-square is unreliable.

Group 1 — outcome yes
Group 1 — outcome no
Group 2 — outcome yes
Group 2 — outcome no
Loading calculator…

How it works

P(table) = C(r₁, a) · C(r₂, c) ÷ C(n, c₁); two-sided p = Σ P(tables at least as extreme as the observed)

Fisher's exact test fixes both margins of the 2×2 table and asks how likely a split at least this uneven is under the hypergeometric distribution. Because no approximation is involved it is valid at any sample size, which is why it replaces chi-square when an expected cell count drops below five. The two-sided p-value here sums every table whose probability is no larger than the observed one — the convention used by R.

Worked example

8/2 versus 1/5: the observed table has probability 0.0245 and the two-sided p-value is 0.035, so the difference is significant at 5%.

Frequently asked questions

Why is the two-sided p not just double the one-sided?

The hypergeometric distribution is asymmetric, so tables in the other tail are summed individually rather than doubled.

When should I use chi-square instead?

With large counts both agree; chi-square is fine when every expected cell is 5 or more. Fisher is safe everywhere.

Related calculators

For education — check assumptions (sample size, distribution, independence) before using a test result in a real decision.