Home » Statistics & Probability Calculators » Fisher’s Exact Test Calculator (2×2)

Fisher’s Exact Test Calculator (2×2)

Home › Statistics & Probability Calculators › Fisher's Exact Test Calculator (2×2)

Fisher's Exact Test Calculator (2×2)

Fisher’s exact test checks whether two categorical variables in a 2×2 table are associated, using exact probabilities instead of the chi-square approximation. It is the right test when expected counts are small (below 5), which is common in pilot studies, clinical case series and classroom experiments.

With the row and column totals fixed, the count in the top-left cell follows a hypergeometric distribution. The calculator lists every table with the same margins and its probability. The two-sided p-value adds the probabilities of all tables no more likely than the one you observed, the same rule R’s fisher.test and SciPy use. The one-sided p-values add the tables in one direction only.

The sample odds ratio (a × d) ÷ (b × c) is shown as a measure of the strength of association; the odds ratio calculator adds its confidence interval and the relative risk. For larger tables, or more than two rows or columns, use the chi-square test of independence.

Result and step-by-step solution

Fisher’s exact p
0.035

Two-sided p-value. Sample odds ratio = 20.

Reject H₀ at α = 0.05. The two variables are associated (the row and column proportions differ).
  1. Table margins
    Row 1 total = 10, column 1 total = 9, N = 16. With the margins fixed, cell a follows a hypergeometric distribution from 3 to 9.
  2. Probability of the observed table
    P(a = 8) = C(9, 8) × C(7, 2) ÷ C(16, 10) = 0.023601
  3. All tables with the same margins
    aProbabilityAs or less likely than observed
    30.01049yes
    40.11014
    50.33042
    60.367133
    70.157343
    80.023601yes
    90.000874yes
  4. p-values
    Two-sided (sum of tables no more likely than observed) = 0.035; P(a ≤ 8) = 0.9991; P(a ≥ 8) = 0.0245
  5. Decision
    p = 0.035 < α = 0.05.

Frequently asked questions

When should I use Fisher's exact test instead of chi-square?
When any expected cell count is below 5, or the total sample is small. The chi-square p-value is an approximation that becomes unreliable with small counts; Fisher’s test is exact.
How is the two-sided p-value calculated?
By adding the hypergeometric probabilities of every table with the same margins whose probability is less than or equal to that of the observed table.
Can Fisher's exact test be used for large samples?
Yes, it is valid at any size, but with large counts it gives nearly the same answer as chi-square and takes longer to compute by hand.
What does the odds ratio tell me here?
How strongly the two variables are associated. An odds ratio of 1 means no association; the p-value tells you whether the observed departure from 1 could be chance.

Last reviewed: October 7, 2026. Calculations run in your browser and were validated against SciPy.

Scroll to Top