Fisher Exact Test Calculator
Enter the four cell counts of your 2x2 table to get the exact probability.
Result
How it is calculated
Enter the four counts of a 2×2 table: a and b in the first row, c and d in the second. With the row and column totals held fixed, the tool computes the hypergeometric probability of exactly this table: P = (a+b)! (c+d)! (a+c)! (b+d)! ÷ (a! b! c! d! n!), where n = a+b+c+d. Factorials are handled through logarithms, so larger tables do not overflow. It also shows the total n and the odds ratio (a×d) ÷ (b×c), displayed as ∞ when b×c is zero. All four cells must be whole numbers of at least zero, and the table must not be empty or have a total above 10,000,000 (no result). The first result is the two-sided p-value of the Fisher test: it adds P for this table and for every table with the same totals that is equally or more unlikely. The point probability is shown separately.
Worked example
A small trial: 8 of 10 treated patients improve (a = 8, b = 2) and 1 of 6 untreated patients improves (c = 1, d = 5). Total n = 16 and the column totals are 9 improved and 7 not improved. The probability of exactly this table is (45 × 6) ÷ 11,440 = 0.023601, which is the tool's 0.023601. The odds ratio is (8 × 5) ÷ (2 × 1) = 20.0000. The more extreme table (9, 1, 0, 6) has probability 0.000874, and the tables at the other end add a little more, so the two-sided p-value the tool shows first is 0.034965.
Common mistakes
- Reading the point probability as the p-value of the test. It is the probability of this single table only; use the two-sided p-value above it.
- Entering percentages or rates. The cells must be raw counts, such as 8 patients and not 80%.
- Entering a decimal or negative count. Only whole numbers of zero or above are accepted, and anything else returns no result.
- Mixing up the layout. Keep groups in rows and outcomes in columns; swapping the two columns (a with b, c with d) leaves the probability unchanged but turns the odds ratio 20 into its reciprocal 0.05.
- Misreading ∞ as an error. It appears when b × c is zero, meaning one of those cells is empty and the odds ratio cannot be calculated.
About this calculator
The Fisher exact test computes the exact probability of observing a particular 2×2 contingency table of counts, given the table’s fixed row and column totals, rather than relying on the chi-square test’s large-sample approximation. For a table with cells a, b, c, d (and totals n = a+b+c+d), the exact hypergeometric point probability of that specific table is P = [(a+b)!(c+d)!(a+c)!(b+d)!] / [a!·b!·c!·d!·n!], derived from the hypergeometric distribution that describes how counts fall into cells when the margins are held fixed.
This point probability is the building block of the full Fisher exact test p-value (which sums this quantity over all tables as extreme or more extreme than the one observed), and it’s paired here with the odds ratio — (a·d)/(b·c) — which measures the strength and direction of the association between the two categorical variables. Biostatisticians and researchers reach for Fisher’s exact test instead of chi-square specifically when sample sizes are small or any expected cell count falls below about 5, a very common situation in clinical trials, case-control studies, and rare-event data; this calculator returns the two-sided p-value and the exact probability of the entered 2×2 table, along with its total and odds ratio.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Fisher's method earns its place when counts are small, for example when an expected cell count falls below 5 and a chi-square test becomes unreliable. The 2×2 table 8, 2, 1, 5 gives a two-sided p-value of 0.034965, a table probability of 0.023601 and an odds ratio of 20.0000, while 9, 1, 0, 6 gives 0.000874 with an odds ratio shown as ∞. What counts are you testing, and did you decide on one-sided or two-sided before looking?