2×2 Contingency Table Calculator
Chi-square, Fisher's exact test, odds ratio, relative risk and attributable risk.
5.0 (1 rating)Enter your values to see the result.
Fisher's exact test is preferred when any expected count is below 5. The chi-square test is shown with and without Yates' continuity correction. Results use standard large-sample formulas and are meant to support, not replace, a statistician's review. Check the assumptions behind each method before you report the numbers.
Processing and privacy
Processing varies by tool. Check the instructions for local processing, server requests, external services and any file or request limits before entering sensitive information.
Read the privacy policyHow this calculation works
Understand the method, inputs and limits behind your result.
- Formula
- Expected cell count = row total × column total / grand total. Pearson χ² = Σ(observed − expected)²/expected; 2×2 options also include continuity correction and Fisher exact testing.
- Variables
- Exposed: outcome yes
- Exposed: outcome no
- Unexposed: outcome yes
- Unexposed: outcome no
- Confidence level: 90%, 95%, 99%
- Units
- Use the units shown beside each input. Counts and ratios are dimensionless unless labeled otherwise.
- Example
- 12 of 50 exposed and 4 of 50 unexposed people have the outcome: χ² = 4.76, p = 0.029, and the odds ratio is 3.63.
- Assumptions
- Fisher's exact test is preferred when any expected count is below 5. The chi-square test is shown with and without Yates' continuity correction. Results use standard large-sample formulas and are meant to support, not replace, a statistician's review. Check the assumptions behind each method before you report the numbers.
- Source
- ToolzHive calculation guide and calculator implementation. External reference verification is pending.
- Last reviewed
- Review date not yet recorded.
Methodology & References
The method depends on the selected model and input options. Review the assumptions and references above before interpreting the result.
- Enter the four cell counts for exposed and unexposed groups.
- Choose the confidence level for the effect measures.
- Read the test results; Fisher’s exact test is used when expected counts are small.
Interpretation and limitations
- When should I use Fisher’s exact test? When any expected count is below 5. The chi-square approximation is unreliable with small expected counts.
- What does Yates’ correction do? It makes the chi-square test more conservative for 2×2 tables. It is often too conservative, so both versions are shown.
References
External reference verification is pending. The formula and examples describe the current ToolzHive implementation.
Share this tool
Found it useful? Send it to a friend or teammate.
Rate this tool
5.0
1 rating
- 5 stars 1
- 4 stars 0
- 3 stars 0
- 2 stars 0
- 1 star 0
Clear instructions
Find steps, examples and limitations below.
Use online
Open the tool in a supported web browser.
Free to use
No sign-up required. Tool-specific limits may apply.
How to use the 2×2 Contingency Table Calculator
Chi-square, Fisher's exact test, odds ratio, relative risk and attributable risk.
- 1 Enter the four cell counts for exposed and unexposed groups.
- 2 Choose the confidence level for the effect measures.
- 3 Read the test results; Fisher’s exact test is used when expected counts are small.
Example and practical tips
12 of 50 exposed and 4 of 50 unexposed people have the outcome: χ² = 4.76, p = 0.029, and the odds ratio is 3.63.
Frequently asked questions
When should I use Fisher’s exact test?
When any expected count is below 5. The chi-square approximation is unreliable with small expected counts.
What does Yates’ correction do?
It makes the chi-square test more conservative for 2×2 tables. It is often too conservative, so both versions are shown.
Practical guides
-
How to Use 2×2 Contingency Table Calculator
Analyse a 2×2 table with Pearson and Yates chi-square, Fisher’s exact test, odds ratio, relative risk, risk difference and expected counts.
Report an issue
Something broken or not quite right? Tell us and we will look into it.