Hypothesis Testing

Fisher's Exact Test Calculator

Use this calculator to perform Fisher's exact test for a 2 × 2 contingency table. Enter the observed counts to get the observed table probability, sample odds ratio, exact p-value, and a complete step-by-step solution.

2 × 2 Contingency Table

Edit the variable and category names inside the table, then enter the four observed counts.

Row Total
Row Category Total
10
6
Column Total 9 7 16
Enter nonnegative whole-number counts. Each row and column must contain at least one observation.
Fisher's exact test calculates an exact p-value for a 2 × 2 contingency table without relying on the chi-square approximation.

Step-by-Step Solution

How to Use the Fisher’s Exact Test Calculator

This Fisher’s exact test calculator helps you determine whether there is an association between two categorical variables, especially when your data sample size is very small or when expected cell counts are less than 5. If all the expected cell counts are at least 5, you should use the chi-square calculator instead.

To use the calculator:

  1. Select the correct alternative hypothesis (Two-sided, right-sided, or left-sided)
  2. Edit the variable names in the 2 × 2 contingency table.
  3. Enter the four observed counts in the 2 × 2 contingency table.
  4. Enter the significance level, α.
  5. Click Calculate

The calculator will instantly perform Fisher’s exact test and return the observed table probability, odds ratio (OR), exact p-value, and the correct decision about the hypothesis. It will also provide a clear, step-by-step solution showing you exactly how to perform the test manually.

Tip. You should only use this calculator when you have two categorical variables summarized in a 2 × 2 contingency table.

What Is Fisher’s Exact Test?

Fisher’s exact test is a nonparametric test used to determine whether there is a nonrandom association between two categorical variables. It is appropriate when working with a 2 × 2 contingency table with small expected counts, especially when standard approximations like the chi-square test fail or become unreliable.

The test is particularly useful when the sample is small or one or more expected cell counts are too low for the chi-square approximation. Unlike a chi-square test, Fisher’s exact test calculates probabilities directly. It does not require a chi-square statistic, critical value, or degrees of freedom.

When to Use Fisher’s Exact Test

Fisher’s exact test is appropriate when:

  • You have two categorical variables.
  • Each variable has exactly two categories.
  • The sample is small for a chi-square test approximation
  • One or more expected cell counts are less than 5
  • The data can be arranged in a 2 × 2 table.
  • The table contains observed counts.
  • The observations are independent.
  • Each participant or observation appears in only one cell.

For larger contingency tables, use the chi-square test calculator. However, to compare one categorical variable with a specified expected distribution, use the chi-square goodness-of-fit calculator.

Hypotheses for Fisher’s Exact Test

The null hypothesis for a 2 × 2 contingency table states that the two variables are independent. This is equivalent to stating that the population odds ratio equals 1.

However, the alternative hypothesis for the test can be either of these:

  • Two-Sided Test. This is appropriate when you want to test whether there is an association in either direction. The alternative hypothesis is:
    • H₁: There is an association between the two categorical variables; OR ≠ 1.
  • Right-tailed Test. Use this test when you predict that the odds of the first column outcome are higher in the first row than in the second row. In this case, the alternative hypothesis is:
    • H₁: OR > 1.
  • Left-tailed Test. The left-sided test is appropriate when you predict that the odds of the first column outcome are lower in the first row. Therefore, the alternative hypothesis is:
    • H₁: OR < 1.

Note. The order of the rows and columns affects the direction of the odds ratio and one-sided hypotheses. Use the two-sided option when there is no justified directional prediction.

Fisher’s Exact Test Formula

To understand Fisher’s exact test formula, consider the following general 2 × 2 contingency table

Column 1Column 2Total
Row 1aba + b
Row 2cdc + d
Totala + cb + dn

Using the contingency table, Fisher’s exact formula is the probability of obtaining a particular 2 × 2 table. The formula is:

Fisher's exact test formula

Where:

  • a, b, c, and d are the four observed counts.
  • n = a + b + c + d is the total sample size.

Example 1. Finding Fisher’s Exact Test Manually

A community college wants to determine whether participation in a mathematics tutoring program is associated with passing a final examination. Eight students receive the tutoring program, while another eight receive standard academic support. The results are shown below.

Academic supportPassedDid not passTotal
Tutoring program628
Standard support178
Total7916

At the 5% significance level, test whether academic support type and examination outcome are associated.

Solution

The appropriate test is Fisher’s exact test since the sample is small and some of the expected frequencies are less than 5. To perform the test, follow these steps:

Step 1: State the Hypotheses

Because the question asks whether an association exists without specifying a direction, we use a two-sided test. Therefore, the hypotheses are:

  • H₀: Academic support type and examination outcome are independent; OR = 1.
  • H₁: Academic support type and examination outcome are associated; OR ≠ 1.

Step 2: State the Significance Level

We need to test the hypothesis at a 5% significance level. Hence, α = 0.05

Step 3: Calculate the Observed Table Probability

From the contingency table, we know that:

  • a = 6
  • b = 2
  • c = 1
  • d = 7

Substituting the values into Fisher’s exact test formula, we get:

P(observed table)=(76)(92)(168)P(\text{observed table}) = \frac{ \binom{7}{6} \binom{9}{2} }{ \binom{16}{8} }=7(36)12870= \frac{7(36)}{12870}

= 0.019580

Therefore, P(observed table) = 0.019580

Step 4: Calculate the Odds Ratio and Exact P-Value

The sample odds ratio is:OR=(6)(7)(2)(1)OR=\frac{(6)(7)}{(2)(1)}

=21

This implies that the sample odds of passing are 21 times as high in the tutoring group as in the standard-support group.

To find the exact p-value for the two-tailed test, we sum all the probabilities of the observed table and all equally or less probable tables. This gives p = 0.040559

Step 5. State the Decision

Since the p-value (0.040559) is less than the 0.05 significance level, we reject the null hypothesis

Step 6. Write the Conclusion

At the 5% significance level, there is sufficient evidence to conclude that academic support type and examination outcome are associated.

Example 2. Finding Fisher’s Exact Test Using the Calculator

To perform Fisher’s exact test for Example 1 using the calculator, follow these steps:

  1. Select Two-Sided: OR ≠ 1 as the alternative hypothesis
  2. Edit the variable names to match the above contingency table
  3. Enter the observed counts to match the above contingency table
  4. Enter 0.05 as the significance level
  5. Click calculate

The calculator will instantly return the observed table probability, odds ratio, exact p-value, and decision, as follows:

  • Observed table probability = 0.019580
  • Sample odds ratio = 21
  • Exact p-value = 0.040559
  • Decision: Reject H₀

You’ll also see a clear, step-by-step solution explaining how the test was performed.

Frequently Asked Questions

What is Fisher’s exact test used for?

It tests whether two categorical variables are associated in a 2 × 2 contingency table. It is especially useful for small samples or tables with low expected frequencies.

Is the observed table probability the same as the p-value?

Not usually. The observed table probability applies only to the exact table entered. The exact p-value also includes other relevant tables that are at least as extreme under the selected hypothesis.

When should I use Fisher’s exact test instead of chi-square?

Use Fisher’s exact test when the data form a 2 × 2 table, and the sample or expected frequencies are small. However, if the approximation is appropriate, or the contingency table is larger, use the chi-square test.

Can Fisher’s exact test be used when a cell contains zero?

Yes. The exact p-value can still be calculated as long as each row and column has a positive total. The sample odds ratio may become zero, infinite, or undefined.

Does Fisher’s exact test use degrees of freedom?

No. The p-value is calculated directly from exact conditional probabilities, so a chi-square distribution and degrees of freedom are not required.

Should I use a one-sided or two-sided test?

Use a two-sided test when an association in either direction would be important. However, if a directional hypothesis was established before examining the results, use a one-sided test instead.

Cite

Choose APA, MLA, Chicago, or Harvard, then copy the citation.

Mburu, J.. (2026, July 30). Fisher’s Exact Test Calculator. StatCalc.net. Retrieved August 23, 2026, from https://statcalc.net/fishers-exact-test-calculator/

Joseph Mburu

About This Calculator

Prepared by Joseph Mburu · Updated on

Joseph is an applied statistician and data analyst with over 6 years of experience helping students, researchers, and professionals solve statistics and data analysis problems. He holds a degree in Applied Statistics and a Master’s degree in Data…

We aim to keep our calculators accurate, easy to use, and helpful for learning. Always check that your inputs match the assumptions of the method you are using.