Statistics & probability

Fisher exact two by two calculator

Enumerate fixed-margin 2×2 tables for Fisher’s test, exposing the selected one-sided or probability-ordered two-sided tail and sample odds ratio.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Try it, understand it

Explore the result

Hold the observed row and column margins fixed and enumerate all feasible top-left counts. For the two-sided option, sum tables with probability no greater than the observed table’s probability.

Worked example comparison
ExampleOutputWhat to notice
Worked exampleConditional exact p value0.00275945619For [1,9;11,3], probability-ordered two-sided Fisher evidence is about 0.002759456. The raw sample odds ratio is 1×3/(9×11), about 0.030303.
Reverse column associationConditional exact p value0.00275945619The sample odds ratio reverses while two-sided evidence agrees.
Select the lower tailConditional exact p value0.00137972809Only feasible top-left counts no larger than observed are included.

Check your understanding

Is two-sided p always twice the smaller tail?

Not under this probability-ordering definition.

Is the odds ratio conditionally estimated?

No, the display is the raw cross-product sample ratio.

Behind the numbers

How this calculation works

Hold the observed row and column margins fixed and enumerate all feasible top-left counts. For the two-sided option, sum tables with probability no greater than the observed table’s probability.

THE FORMULAConditional table probability = choose(column-one total, a) × choose(column-two total, row-one total − a) / choose(grand total, row-one total)

A worked example

For [1,9;11,3], probability-ordered two-sided Fisher evidence is about 0.002759456. The raw sample odds ratio is 1×3/(9×11), about 0.030303.

Good to know

Conditional inference for independent count observations, with total at most 2,000. No paired-data model, conditional odds-ratio estimate, interval or causal interpretation.

Fix the margins before defining the tail

The reference tables preserve both observed row totals and both column totals. Only the top-left count varies; the remaining cells follow from those margins.

That conditional reference model is different from a binomial analysis with a freely varying total or a paired before/after analysis.

The chi square contingency independence calculator adds calculate Pearson independence evidence for rectangular count tables, with expected cells, residual contributions, sparse-cell counts and Cramér’s V.

Two-sided exact definitions are not all identical

This page uses probability ordering: include feasible tables no more probable than the observed one. It is not defined by automatically doubling a one-sided tail.

The enumeration table shows which outcomes enter the selected tail. A small numerical tolerance handles probabilities that should tie but differ by floating-point rounding.

Separate sample odds ratio from conditional inference

The displayed odds ratio is the cross-product sample ratio. It is not a conditional maximum-likelihood estimate and does not include a confidence interval.

When a denominator product is zero, the ratio can be infinite or undefined; the page labels that case instead of adding an undisclosed continuity adjustment.

Use the result with the next measurement

The chi square contingency independence calculator uses an asymptotic Pearson statistic and supports larger rectangular tables. That p value is not the same conditional calculation as Fisher’s enumeration.

Conditional inference for independent count observations, with total at most 2,000. No paired-data model, conditional odds-ratio estimate, interval or causal interpretation.

A few questions, answered

Is two-sided p always twice the smaller tail?

Not under this probability-ordering definition.

Is the odds ratio conditionally estimated?

No, the display is the raw cross-product sample ratio.

Are zero cells allowed?

Yes, provided the total is positive and within the supported bound.

Find your calculator

Start typing to explore the library.