exact fisher test calculator

Fisher's Exact Test (2×2)

Enter your 2×2 contingency table counts. This calculator returns left-tailed, right-tailed, and two-sided exact p-values using the hypergeometric distribution.

Outcome: Yes Outcome: No
Group 1
Group 2
Use 0.05 unless your protocol specifies otherwise.
Tip: For one-sided tests, the direction depends on how you place groups and outcomes in the table.

What is Fisher's exact test?

Fisher's exact test is a statistical test used to determine whether two categorical variables are associated in a 2×2 table. It is called "exact" because the p-value is computed from the exact hypergeometric probabilities of all possible tables with the same row and column totals, rather than relying on large-sample approximations.

This makes Fisher's exact test especially helpful when sample sizes are small, expected counts are low, or you want a precise p-value instead of an approximation from a chi-square test.

When should you use this calculator?

Use it when:

  • You have a 2×2 contingency table of counts.
  • Your groups are independent.
  • At least one expected cell count is small (a common rule is below 5).
  • You need a two-sided or one-sided exact p-value.

Avoid it when:

  • Your table is larger than 2×2 (you would need an extension or another method).
  • Your data are paired or matched (McNemar-type methods are usually better).
  • You are analyzing continuous outcomes rather than categorical counts.

How the calculator works

For a table with cells a, b, c, d, the calculator keeps row totals and column totals fixed, then computes every possible value of a that is compatible with those margins. Each possible table has a hypergeometric probability. From these probabilities, it computes:

  • Left-tailed p-value: Probability of tables with values at or below the observed a.
  • Right-tailed p-value: Probability of tables with values at or above the observed a.
  • Two-sided p-value: Sum of probabilities for all tables with probability less than or equal to the observed table probability.

You also get an estimated odds ratio and an approximate 95% confidence interval (Haldane-Anscombe correction applied to stabilize zero cells).

Interpreting your result

Start with the p-value that matches your hypothesis design:

  • Two-sided: Best for "any difference" questions.
  • Right-tailed: Best for a pre-specified increase in Group 1.
  • Left-tailed: Best for a pre-specified decrease in Group 1.

If your chosen p-value is below alpha (for example, 0.05), you can reject the null hypothesis of no association. If it is above alpha, you do not have enough evidence to reject the null.

Quick practical example

Suppose a pilot study compares a treatment and control group:

  • Treatment: 1 success, 9 failures
  • Control: 11 successes, 3 failures

Because counts are small and imbalanced, Fisher's exact test is appropriate. Click Load Example in the calculator to see this setup and evaluate the p-values.

Common mistakes to avoid

  • Using percentages instead of raw counts.
  • Choosing one-sided testing after looking at the data direction.
  • Ignoring effect size (odds ratio) and reporting only p-values.
  • Assuming significance means practical importance.

Final takeaway

Fisher's exact test is one of the most reliable ways to test association in a 2×2 table when sample sizes are limited. Use this exact fisher test calculator for clean, reproducible p-values and pair the result with effect size interpretation for better decisions.

🔗 Related Calculators