Interactive module guide
Fisher Exact Test Calculator — Free 2×2 Analysis
This Fisher exact test calculator evaluates association in a 2 by 2 table exactly, staying valid when expected counts are too small for chi-square.
Free · No sign-up · Calculations stay in your browser
Fisher’s exact test evaluates association in a 2×2 contingency table without any large-sample approximation.
Holding the row and column totals fixed, the count in one cell follows a hypergeometric distribution, and the two-sided p-value sums the probability of every table no more likely than the observed one.
This calculator reports that exact p-value and the sample odds ratio, and it remains valid exactly where the chi-square test’s expected-count guidance fails.
Use the Fisher exact test calculator for sparse 2 by 2 tables where chi-square expected-count guidance fails; independence of observations is still required.
When to use this Fisher exact test calculator
Use it when
- Use it for 2×2 tables with small cell counts, where at least one expected frequency falls below the usual chi-square threshold of five. Sparse adverse-event tables, small pilot comparisons, and rare-outcome audits are the classic cases.
- It is appropriate whenever an exact association p-value is required by a protocol or reviewer, regardless of size, since the hypergeometric computation is exact at every table.
- Choose it when both variables are binary and each subject contributes exactly one outcome to exactly one cell, such as treatment arm crossed with recovery status in a small trial.
Choose another method when
- Do not use it for paired binary outcomes: measuring the same units twice creates dependence between the rows, and the McNemar test is the design-matched method.
- Tables larger than 2×2 are out of scope here; use the chi-square independence test, which now accepts tables up to 6×6, when categories exceed two on either margin.
- Avoid reading it as a measure of effect size on its own. A tiny table can produce a small p-value with an extremely unstable odds ratio, so the strength of association needs separate, cautious treatment.
Interactive tool
The calculator loads as you approach this section so the guide remains fast on mobile connections.
Example preview
Sparse 2×2 association table
- Inputs
- Table a=8, b=2, c=1, d=5 with N=16 observations.
- Representative result
- Two-sided exact p≈0.0350 with a sample odds ratio of 20; interpret the huge ratio cautiously at this size.
Illustrative only. Load the interactive tool to enter your own values and review assumptions.
Watch the explanation
4:58 minThe player loads only after you press play. You can also watch on YouTube.
Read the complete transcript
Fisher's Exact Test. Eight passes against two failures looks very different from one pass against five failures. Fisher's exact test asks whether this sparse two-by-two imbalance is surprising. Enter four whole counts, labeled a, b, c, and d. Keep both row groups and both outcome columns visible because orientation controls interpretation. Fisher's null conditions on the observed row and column totals. Once those four margins are fixed, cell a alone determines every feasible table. Cell a ranges from the larger of zero and row one minus column two, through the smaller of row one and column one. For each feasible a, multiply two combination counts and divide by the total combination count. This is the conditional hypergeometric probability of that table. The two-sided rule sums every fixed-margin table no more probable than the observed table. It ranks table probabilities, not distance from an expected count. Compare the exact p-value with alpha for the decision. Report the sample odds ratio separately, because evidence strength and observed effect magnitude are different outputs.
Each independent observational unit must enter exactly one cell. The two variables must be genuinely binary, with mutually exclusive and consistently recorded categories. Exact arithmetic removes a large-sample approximation. It does not repair clustering, repeated measurements, selection bias, changing definitions, or outcome-driven stopping. Fisher is especially useful when expected cell counts are small and the chi-square approximation is weak. Healthy large tables usually give similar conclusions. The calculation conditions on the observed margins even when every margin was not fixed by design. That conditional frame is exact, discrete, and sometimes conservative. Distri Scope reports the sample odds ratio a times d over b times c. Swap one row or column and the ratio inverts. Do not confuse that sample ratio with R's conditional estimate. This page also does not provide an odds-ratio confidence interval, so precision remains unquantified. Paired binary outcomes need a paired test for binary outcomes. More than two categories need a larger-table method, and this page does not offer one-sided alternatives.
Suppose method one has eight passes and two failures, while method two has one pass and five failures. Plan a two-sided test at alpha point zero five. The row totals are ten and six; the column totals are nine and seven. Those margins allow a from three through nine, not four through ten. Independence would expect counts five point six two five, four point three seven five, three point three seven five, and two point six two five. At the observed table, where a equals eight, the conditional hypergeometric probability is about zero point zero two three six zero one. Across all seven feasible tables, only a equals three, eight, or nine is no more probable than the observation. Their probabilities sum to zero point zero three four nine seven. That exact p-value is below zero point zero five, so reject the fixed-margin independence null. The pilot supplies evidence of association, not causal proof. The sample odds ratio is eight times five over two times one, or twenty. With only sixteen observations, treat twenty as unstable and descriptive.
A reproducible analysis lists every feasible value from three through nine, its full table, its probability, and whether the two-sided rule includes it. Zero cells are valid counts, but they can make the sample odds ratio zero, infinite, or degenerate. Never hide that with an unreported correction. Validate nonnegative whole cells, at least one observation, positive row and column margins, total size at most five thousand, and alpha strictly between zero and one. Define both variables, category order, table orientation, analysis convention, and alpha before inspection. Relabeling a row or outcome afterward changes the claim. Route paired units, clusters, stratified designs, repeated looks, and tables larger than two-by-two to methods that preserve their actual data structure. Report the oriented table, margins, total, two-sided probability convention, alpha, exact p-value, sample odds ratio, design limits, and a guarded conclusion. Test a sparse two-by-two table, inspect every feasible result, and report the exact evidence free at Distri Scope dot com.
How to read the result
Read the p-value as the exact probability, under independence and fixed margins, of a table at least as unusual as the one observed; no degrees of freedom or reference curve is involved, so none is drawn.
Read the sample odds ratio as a description of the observed table, not a precise population estimate: with single-digit cells its sampling variability is enormous, and a zero cell makes it degenerate, which the tool flags rather than hides.
How to use the Fisher exact test calculator
Enter the four observed counts a, b, c, d so that rows are groups and columns are outcomes; every subject must appear in exactly one cell. Percentages, rates, and averages are not valid inputs.
Keep the orientation in writing: the reported odds ratio is ad/bc, so which outcome is column one and which group is row one determines whether the ratio lands above or below one.
The calculator accepts up to 5,000 total observations and always reports the two-sided p-value; one-sided exact tests exist but are not offered here, so a directional protocol needs different software.
Formula, hypotheses, and assumptions
Conditions to review
- Each observation falls in exactly one cell of the 2×2 table
- Observations are independent of each other
- Row and column totals are treated as fixed for the conditional inference
Calculator parameters
- Significance Level (α): default 0.05.
What the method is doing
Conditioning on the margins removes the unknown nuisance proportions: with all totals fixed, cell a alone determines the table, and its null distribution is hypergeometric. The two-sided p-value then follows the minimum-likelihood rule, summing every table whose probability does not exceed the observed table’s, the same point-probability convention as R’s fisher.test.
Statisticians have debated conditioning for decades because the margins were usually not fixed by the design; the conditional test is nonetheless standard practice, slightly conservative in small samples, and exactly valid under the null in the conditional frame it states.
Worked example: a sparse pilot comparison
A pilot compares two preparation methods. Under method one, 8 of 10 samples pass and 2 fail; under method two, 1 of 6 passes and 5 fail. The table is a = 8, b = 2, c = 1, d = 5 with N = 16, far too sparse for the chi-square approximation.
- 1Enter the four counts. Holding the margins fixed, the passing count under method one can range from 4 to 10, and each possible table has a hypergeometric probability.
- 2The calculator sums every table whose probability does not exceed the observed table’s, giving a two-sided exact p ≈ 0.0350, below the conventional 0.05 threshold.
- 3Read the sample odds ratio (8×5)/(2×1) = 20, and treat that number with humility: with cells this small the ratio is compatible with a very wide range of population values.
Interpretation
The exact test finds the observed imbalance unlikely under independence, so the pilot provides real evidence that pass rates differ between methods. The odds ratio of 20 should be reported as a rough direction-and-magnitude indicator rather than a stable estimate, and a follow-up with a planned sample size is the right next step before any operational decision.
Common mistakes
- Running Fisher’s test on percentages or on averaged replicates instead of raw subject counts invalidates the hypergeometric model entirely.
- Reporting the giant odds ratio of a tiny table as the finding is the classic overreach; the p-value can be trustworthy while the ratio is wildly unstable.
- Assuming exact means assumption-free is wrong: independence between subjects and one observation per subject are still required, and clustering silently breaks them.
Limits and independent validation
The implementation covers two-sided tests for 2×2 tables up to 5,000 observations; it does not provide one-sided versions, mid-p corrections, confidence intervals for the odds ratio, or stratified (Mantel–Haenszel) analyses.
For large balanced tables the chi-square test gives nearly identical answers with a familiar statistic; Fisher’s advantage is concentrated where counts are sparse.
Before using the result
- Verify that every subject was counted once, that the two variables are genuinely binary, and that group membership and outcome were recorded independently of each other.
- Cross-check the p-value against R’s fisher.test or scipy’s fisher_exact for the same table, and record the full table with its orientation so the analysis can be reproduced.
Related modules and resources
Explore Other Hypothesis Tests
- One Sample Z-Test Calculator
- One Sample T-Test Calculator
- Two Sample Z-Test Calculator
- Two Sample T-Test Calculator
- Paired T-Test Calculator
- One-Way ANOVA Calculator
- Two-Way ANOVA with Replication
- Chi-Square Test Calculator
- Chi-Square Goodness-of-Fit Test
- F-Test Calculator
- One-Proportion Z-Test
- Two-Proportion Z-Test
- Exact Binomial Test
- Fisher’s Exact Test
- McNemar Test
- Mann-Whitney U Test
- Wilcoxon Signed-Rank Test
- Sign Test
- Kruskal-Wallis Test
- Friedman Test
- Pearson Correlation Test
- Spearman Correlation Test
- Kendall Tau Test
- Levene Test
- Brown-Forsythe Test
- Welch ANOVA
- Repeated Measures ANOVA
- TOST Equivalence Test
- Power & Sample Size
- Confidence Interval Calculator
- Critical Value Lookup
See every option in the Statistical Hypothesis Test Calculator or review the DistriScope methodology. Educational information; last reviewed 2026-08-09. Verify consequential calculations independently.