Fisher's Exact Test vs. Chi-Square: When to Use Each
Choosing between Fisher's exact test and the chi-square test is a common decision for researchers analyzing categorical data in 2x2 contingency tables. The practical rule is straightforward: use Fisher's exact test when any expected cell count falls below 5, and use the chi-square test when all expected cell counts are 5 or greater. This article explains the statistical reasoning behind that rule, shows how to apply it with real research examples, and provides a decision framework you can use in your own work.
At a Glance
The table below summarizes the key differences between Fisher's exact test and the chi-square test for 2x2 contingency tables. Use it as a quick reference when planning your analysis.
| Feature | Chi-Square Test | Fisher's Exact Test |
|---|---|---|
| Best for | Large samples with expected cell counts of 5 or more | Small samples or sparse tables with expected cell counts below 5 |
| Calculation method | Approximates the chi-square distribution | Calculates the exact probability of observing the table |
| Sample size requirement | Requires adequate expected frequencies | Works with small sample sizes |
| Table types | 2x2 and larger tables | Primarily 2x2 tables, though extensions exist |
| Output | Chi-square statistic with degrees of freedom | Exact p-value |
| Computational demand | Low | Higher, especially with large samples |
| Common use in research | Comparing proportions across groups in large cohorts | Analyzing rare events or small clinical samples |
Understanding the Core Question
The fundamental question both tests answer is whether two categorical variables are independent or associated. In a 2x2 table, you are comparing the proportion of an outcome between two groups. For example, you might ask whether the rate of a complication differs between two treatment groups or whether the frequency of a characteristic differs between two populations.
The chi-square test achieves this by comparing observed frequencies to expected frequencies. The expected frequency for each cell is calculated from the row and column totals under the assumption that the variables are independent. The test statistic measures how far the observed values deviate from these expected values. The result follows a chi-square distribution, which allows you to calculate a p-value.
Fisher's exact test takes a different approach. It calculates the exact probability of obtaining the observed table, or a more extreme table, given the fixed row and column totals. This is done by enumerating all possible tables with the same margins and summing the probabilities of those that are as extreme or more extreme than the observed table. Because this calculation is exact, it does not rely on approximations that require large samples.
The choice between these tests matters most when your sample is small or when some expected cell counts are low. In these situations, the chi-square approximation can be inaccurate, leading to incorrect conclusions. Fisher's exact test provides a more reliable p-value in these conditions.
Core Principles of Each Test
How the Chi-Square Test Works
The chi-square test of independence is based on comparing observed frequencies with expected frequencies. For each cell in the table, the expected frequency is calculated by multiplying the row total by the column total and dividing by the grand total. The test statistic is the sum of the squared differences between observed and expected values, divided by the expected values.
The validity of the chi-square test depends on the approximation to the chi-square distribution being accurate. This approximation improves as sample size increases. The conventional rule is that all expected cell counts should be at least 5 for the approximation to be reliable. When expected counts fall below this threshold, the test can produce inflated type I error rates, meaning you may reject the null hypothesis when it is actually true.
Research in interventional cardiology illustrates the typical use of the chi-square test in large datasets. A 2022 study in The American Journal of Cardiology examined outcomes in patients undergoing percutaneous coronary interventions using data from the National Cardiovascular Data Registry. The authors compared outcomes between two quarters of the academic year and used chi-square and Fisher's exact tests to analyze the categorical data. With over 2,000 patients in the analysis, the chi-square test was appropriate for most comparisons, while Fisher's exact test was used for outcomes with low frequencies, such as stroke 6.
How Fisher's Exact Test Works
Fisher's exact test computes the probability of observing the specific table configuration given the marginal totals. The calculation involves factorials and produces an exact p-value without relying on asymptotic approximations. This makes it suitable for small samples where the chi-square approximation would be unreliable.
The test is called exact because it calculates the precise probability instead of an approximation. For a 2x2 table with fixed margins, the hypergeometric distribution describes the probability of each possible table. The p-value is the sum of probabilities for all tables that are as extreme or more extreme than the observed one.
A study on Takotsubo-like cardiomyopathy in pheochromocytoma demonstrates the combined use of both tests. The researchers compared 38 cases of pheochromocytoma-associated Takotsubo cardiomyopathy with 254 cases of primary Takotsubo cardiomyopathy. They reported using the chi-square test or Fisher's exact test as appropriate for comparing categorical data, reflecting the common practice of selecting the test based on expected cell frequencies 8.
Sample Size Considerations
Expected Cell Counts and the Rule of 5
The most important factor in choosing between the two tests is the expected cell count. The expected count for each cell is calculated from the marginal totals. When all expected counts are 5 or greater, the chi-square approximation is generally reliable. When any expected count falls below 5, Fisher's exact test is the safer choice.
This rule is not arbitrary. The chi-square distribution is continuous, but the test statistic calculated from a contingency table is discrete. The approximation improves as the expected counts increase because the discrete distribution becomes more similar to the continuous chi-square distribution. With small expected counts, the approximation can be poor, and the resulting p-values can be misleading.
A study on Omicron SARS-CoV-2 reinfection among healthcare workers illustrates how researchers apply this rule. The authors compared 101 cases of first infection with 161 cases of reinfection and reported using Pearson's chi-square and Fisher's exact tests based on the expected frequencies of categorical variables 24. This approach reflects the standard practice of checking expected frequencies before deciding which test to use.
Small Sample Situations
Small samples are common in clinical research, especially when studying rare conditions or specific patient subgroups. In these situations, Fisher's exact test is often the only valid option. The test does not require minimum expected counts and provides exact p-values regardless of sample size.
A study on endometriosis features in women with and without migraine used both tests appropriately. The researchers compared 250 women with endometriosis alone against 94 women with endometriosis and migraine. They reported using the chi-square test and Fisher's exact test for comparing subgroups, selecting the test based on the characteristics of each comparison 12.
Large Sample Situations
When sample sizes are large, the chi-square test is computationally efficient and provides results nearly identical to Fisher's exact test. The approximation is excellent when expected counts are high, and the chi-square test is simpler to calculate and interpret.
A study on periprosthetic fractures following total hip and knee arthroplasty analyzed data from a national database with thousands of patients. The researchers used chi-square or Fisher exact tests for group comparisons, with the large sample allowing reliable use of the chi-square test for most analyses 20.
Practical Decision Framework
Step 1: Define Your Table
Start by constructing your 2x2 contingency table. The rows represent the two groups being compared, and the columns represent the two outcome categories. Record the observed frequencies for each cell.
Step 2: Calculate Expected Counts
For each cell, calculate the expected count using the formula: row total multiplied by column total, divided by the grand total. Perform this calculation for all four cells.
Step 3: Apply the Decision Rule
If all expected counts are 5 or greater, use the chi-square test. If any expected count is below 5, use Fisher's exact test. This rule applies to 2x2 tables, which are the most common application.
Step 4: Consider Table Size
For tables larger than 2x2, the chi-square test is generally used when expected counts are adequate. Fisher's exact test can be extended to larger tables, but the computational demands increase substantially. For larger tables with sparse data, consult a statistician about appropriate methods.
Step 5: Report Your Choice
In your methods section, state which test you used and why. Mention that you checked expected cell counts and selected the test accordingly. This transparency allows readers to assess the validity of your analysis.
Options and Tradeoffs
When the Chi-Square Test Is Preferred
The chi-square test is preferred in large studies where expected counts are adequate. It is computationally simple, widely available in statistical software, and produces results that are easy to interpret. The test statistic and degrees of freedom are standard outputs that readers expect to see.
A study on the burden of periprosthetic fractures used chi-square tests to compare outcomes across treatment groups. With data from a national database covering 2016 to 2022, the sample sizes were large enough for the chi-square approximation to be reliable 20.
When Fisher's Exact Test Is Preferred
Fisher's exact test is preferred when expected counts are low or when the total sample size is small. It provides an exact p-value that does not depend on approximations. This is particularly important in clinical research where small samples are common and accurate p-values are essential.
A study on trauma in obstetrical patients identified 569 pregnant trauma patients out of 105,507 women in a national database. The researchers used chi-square tests, Fisher's exact tests, and other methods as appropriate for different comparisons. For outcomes with low frequencies, such as mortality in specific subgroups, Fisher's exact test provided more reliable results 7.
Yates Correction and Alternatives
Some textbooks recommend the Yates continuity correction for 2x2 tables with small samples. This correction reduces the chi-square statistic to account for the discrete nature of the data. However, the correction can be overly conservative, and many statisticians now recommend Fisher's exact test instead.
The choice between Yates correction and Fisher's exact test depends on your field and the preferences of your audience. In medical research, Fisher's exact test is more commonly used and accepted. In other fields, the Yates correction may be more familiar.
Observations and Measurements
What the Tests Measure
Both tests measure the strength of association between two categorical variables. The p-value indicates the probability of observing the data, or more extreme data, if the null hypothesis of independence is true. A small p-value suggests that the observed association is unlikely to have occurred by chance.
The chi-square test also produces a test statistic that can be used to calculate measures of association such as the phi coefficient or Cramer's V. These measures quantify the strength of the association, which is useful when comparing results across studies.
Interpreting Results in Context
Statistical significance does not imply practical importance. A large study can detect small differences that have little clinical relevance. Conversely, a small study may fail to detect meaningful differences due to limited power.
A study on lifestyle interventions to prevent gestational diabetes mellitus illustrates this point. The researchers found that the intervention reduced the risk of gestational diabetes by 46.9% compared with the control group. The p-value of 0.007 indicated statistical significance, and the magnitude of the effect was clinically meaningful 26.
Effect Sizes and Confidence Intervals
Reporting effect sizes and confidence intervals alongside p-values provides a more complete picture of your results. The p-value tells you whether an association exists, while the effect size tells you how strong it is. Confidence intervals indicate the precision of your estimate.
A study on testosterone recovery after androgen deprivation therapy reported recovery rates for different treatment durations. The researchers used chi-square tests to compare recovery rates and reported the percentages for each group, allowing readers to assess both statistical significance and clinical importance 23.
Records and Documentation
What to Record in Your Analysis
Document the following information for each analysis you perform:
- The contingency table with observed frequencies
- The expected counts for each cell
- The test used and the reason for the choice
- The test statistic and degrees of freedom for chi-square tests
- The exact p-value for Fisher's exact tests
- The software and version used for the analysis
This documentation allows others to reproduce your analysis and verify your conclusions.
Software Implementation
Most statistical software packages can perform both tests. In R, the chisq.test function includes an option to use Fisher's exact test when expected counts are low. In SPSS, the Crosstabs procedure offers both tests with options for exact calculations. In SAS, the FREQ procedure includes both tests.
The availability of exact tests in standard software has made Fisher's exact test more accessible. Researchers no longer need to avoid the test due to computational limitations, even for larger tables.
Reproducibility Considerations
Reproducibility is a core principle of scientific research. The National Institute of Standards and Technology maintains the Research Data Framework to promote best practices in data management and sharing 1. Following these practices ensures that your statistical analyses can be verified by others.
The EQUATOR Network provides reporting guidelines for health research, including recommendations for statistical methods 2. These guidelines help researchers report their methods clearly and completely.
Common Failure Patterns
Using the Chi-Square Test with Small Expected Counts
The most common error is using the chi-square test when expected counts are below 5. This can produce inflated type I error rates, leading to false positive conclusions. The problem is more severe when expected counts are very low, such as below 1.
Ignoring the Assumptions
Both tests assume that observations are independent. If your data violate this assumption, neither test is appropriate. For example, if you have repeated measurements from the same subjects, you need methods that account for the correlation.
Misinterpreting the p-Value
A common misunderstanding is treating the p-value as the probability that the null hypothesis is true. The p-value is actually the probability of observing the data, or more extreme data, given that the null hypothesis is true. This distinction is important for correct interpretation.
A review of p-value use in leading epidemiology journals found that outright statistical misinterpretations were not observed, but the authors identified opportunities for improvement. These included reducing reliance on binary significant versus non-significant language and pairing p-values with effect sizes 21.
Overlooking the One-Tailed Versus Two-Tailed Distinction
Fisher's exact test can be calculated as one-tailed or two-tailed. The one-tailed test is appropriate when you have a directional hypothesis, such as predicting that one group will have a higher rate than the other. The two-tailed test is appropriate when you do not have a directional hypothesis. Using the wrong version can lead to incorrect conclusions.
Limitations and Considerations
Computational Limits of Fisher's Exact Test
Fisher's exact test becomes computationally intensive for large tables or large sample sizes. The number of possible tables grows rapidly with the size of the margins. For large datasets, the chi-square test is more practical.
Modern software can handle Fisher's exact test for many practical situations, but there are limits. If you have a large table with many cells, the computation may take considerable time or memory. In these cases, the chi-square test is the better choice.
The Continuity Correction Debate
Some statisticians recommend using a continuity correction for the chi-square test in 2x2 tables. The correction reduces the test statistic to account for the discrete nature of the data. However, the correction can be overly conservative, making it harder to detect true associations.
The debate over continuity corrections reflects the broader question of how to balance type I and type II errors. Fisher's exact test avoids this debate by providing an exact p-value, but it can also be conservative in some situations.
Beyond 2x2 Tables
Both tests can be extended to tables with more than two rows or columns. The chi-square test handles larger tables naturally, while Fisher's exact test becomes more complex. For larger tables with sparse data, other methods such as exact logistic regression may be more appropriate.
A study on malignant melanoma distribution across anatomic sites used chi-square tests to compare distributions across time periods. The analysis involved tables with multiple categories, and the chi-square test was appropriate for the sample sizes involved 18.
Safety and Regulatory Context
Research Reporting Standards
Accurate statistical analysis is essential for research integrity. The National Center for Biotechnology Information provides access to biomedical literature and research resources that support rigorous scientific practice 4. PubMed, maintained by the National Library of Medicine, indexes peer-reviewed research and facilitates the dissemination of reliable findings 5.
The NC3Rs Experimental Design Assistant helps researchers design experiments that are statistically sound and ethically appropriate 3. Proper experimental design, including appropriate sample size calculation and analysis planning, is essential for producing reliable results.
Ethical Reporting of Results
Researchers have an ethical obligation to report their methods accurately and their results honestly. This includes stating which statistical tests were used and why. Selective reporting of results, such as only reporting significant findings, undermines the integrity of the scientific literature.
The EQUATOR Network promotes transparent and accurate reporting of health research through its reporting guidelines 2. Following these guidelines helps ensure that readers can assess the validity of research findings.
Professional Escalation Criteria
When to Consult a Statistician
Consider consulting a statistician in the following situations:
- Your table has more than two rows or columns
- You have sparse data with many low expected counts
- You are unsure whether your data meet the assumptions of either test
- You need to adjust for confounding variables
- You are analyzing clustered or correlated data
A statistician can help you select the appropriate method and interpret your results correctly.
When to Seek Additional Guidance
If your analysis involves complex sampling designs, missing data, or multiple comparisons, seek additional guidance. These situations require specialized methods beyond the basic choice between Fisher's exact test and the chi-square test.
The NC3Rs Experimental Design Assistant provides guidance on experimental design and statistical analysis 3. This resource can help you plan your study and avoid common statistical pitfalls.
Frequently Asked Questions
What is the main difference between Fisher's exact test and the chi-square test?
The main difference is in how they calculate the p-value. The chi-square test uses an approximation to the chi-square distribution, which is accurate when expected cell counts are 5 or greater. Fisher's exact test calculates the exact probability of the observed table given the marginal totals, which is accurate regardless of sample size. Fisher's exact test is preferred when expected counts are low because the chi-square approximation can be unreliable in these conditions.
How do I know if my expected cell counts are too low for the chi-square test?
Calculate the expected count for each cell by multiplying the row total by the column total and dividing by the grand total. If any expected count is below 5, the chi-square test may be unreliable. In this case, use Fisher's exact test instead. This rule applies to 2x2 tables, which are the most common application.
Can I use Fisher's exact test for tables larger than 2x2?
Yes, Fisher's exact test can be extended to larger tables, but the computational demands increase substantially. For tables with more than two rows or columns, the number of possible tables grows rapidly, and the calculation can become very slow. For larger tables with adequate expected counts, the chi-square test is more practical.
Does Fisher's exact test always give the same result as the chi-square test?
No, the two tests can give different results, especially when sample sizes are small or expected counts are low. The chi-square test relies on an approximation that becomes less accurate as expected counts decrease. Fisher's exact test provides an exact p-value and is more reliable in these situations. In large samples with adequate expected counts, the two tests usually give similar results.
What is the rule of 5 in the context of these tests?
The rule of 5 states that the chi-square test is valid when all expected cell counts are 5 or greater. This rule ensures that the chi-square approximation to the exact distribution is accurate. When any expected count falls below 5, the approximation can be poor, and Fisher's exact test is recommended instead.
Should I use a continuity correction with the chi-square test?
The Yates continuity correction is sometimes recommended for 2x2 tables with small samples. The correction reduces the chi-square statistic to account for the discrete nature of the data. However, the correction can be overly conservative, making it harder to detect true associations. Many statisticians now recommend Fisher's exact test instead of the Yates correction for small samples.
How do I report which test I used in my research paper?
In your methods section, state which test you used and why. For example, you might write that you used the chi-square test when expected cell counts were 5 or greater and Fisher's exact test when expected counts were below 5. This transparency allows readers to assess the validity of your analysis and reproduce your results.
What should I do if my data do not meet the assumptions of either test?
If your data violate the assumptions of both tests, such as having dependent observations or complex sampling designs, consult a statistician. Alternative methods may be more appropriate, such as generalized estimating equations, mixed models, or exact logistic regression. The NC3Rs Experimental Design Assistant can help you plan your analysis and avoid common pitfalls 3.
Related Articles
- Statistical Power And Sample Size
- Statistical Power And Sample Size
- Statistical Power And Sample Size
- Pcr Test
- Pcr Test
References and Further Reading
- Research Data Framework. National Institute of Standards and Technology.
- EQUATOR Network. EQUATOR Network.
- Experimental Design Assistant. NC3Rs.
- NCBI Literature Resources. National Center for Biotechnology Information.
- PubMed. National Library of Medicine.
- The "July Effect" in the Cardiac Catheterization Laboratory.. The American journal of cardiology, 2022.
- Trauma in Obstetrical Patients.. Journal of emergencies, trauma, and shock, 2021.
- Takotsubo-like cardiomyopathy in pheochromocytoma.. International journal of cardiology, 2011.
- Obstetrical Complications and Long-Term Cardiovascular Outcomes.. Current hypertension reports, 2020.
- Interpregnancy interval and abnormally invasive placentation.. Acta obstetricia et gynecologica Scandinavica, 2019.
- Augmentation of the Esophageal Sphincter Using LINX.. The American surgeon, 2022.
- Endometriosis Features in Women With and Without Migraine.. Journal of women's health (2002), 2023.
- Optimisation and clinical validation of a metagenomic third-generation sequencing approach for aetiological diagnosis in bronchoalveolar lavage fluid of patients with pneumonia.. EBioMedicine, 2025.
- The Physics, Information, and Computation of Perennial Learning: Kolmogorov Complexity, Information Distance, and Port-Hamiltonian Thermodynamics.. 2026.
- Pneumococcal Detection and Bacterial Co-Detection in Children After COVID-19: A Two-Year Multiplex PCR Study. 2026.
- Thermodynamic natural gradient descent (NGD-T) regulates natural-gradient steps by a geometric speed-cost bound.. 2026.
- Geodesic Execution Slippage: A Statistical Physics Framework for Cryptocurrency Liquidity Risk. 2026.
- Anatomic distribution and temporal trends of malignant melanoma among 960 cutaneous malignancies managed over 22 years at a tertiary plastic surgery department.. 2026.
- Impact of Gross Motor Coordination Exercises on Perceptual Processes and Praxis in Early School Children With Symptoms of Developmental Coordination Disorder: Preliminary Report of Randomized Controlled Study.. 2026.
- The Burden of Periprosthetic Fractures Following Total Hip and Knee Arthroplasty: Risk Factors, Trends, and Outcomes.. 2026.
- Exploring the proper use of p-values and confidence intervals in leading epidemiology journals.. 2026.
- Computed Tomography-Guided Methylene Blue Localization: Single vs. Multiple Lung Nodules. Frontiers in Medicine, 2021.
- Testosterone recovery after androgen deprivation therapy in localised prostate cancer: Long-term data from two randomised trials.. Radiotherapy and Oncology, 2024.
- The symptoms and interval of Omicron SARS-CoV-2 reinfection among healthcare workers in a hospital of Southern China: a cross-sectional study. BMC Infectious Diseases, 2024.
- Long-term clinical evaluation of direct resin composite restorations in vital vs. endodontically treated posterior teeth - Retrospective study up to 13 years.. Dental Materials, 2019.
- Lifestyle interventions to prevent adverse pregnancy outcomes in women at high risk for gestational diabetes mellitus: a randomized controlled trial. Frontiers in Immunology, 2023.
- Clinical and vascular features of stroke in Takayasu's arteritis: A 24-year retrospective study. Rheumatology and Immunology Research, 2023.
- Robotic-assisted laparoscopic adrenalectomy (RARLA): What advantages and disadvantages compared to retroperitoneal laparoscopic adrenalectomy (RLA)?. Frontiers in Endocrinology, 2023.
- Alcohol abuse and suicidal behaviour. Psychiatria Danubina, 2008.
- Comparison of one stitch vs two stitches for emergency cervical cerclage to prevent preterm birth in singleton pregnancies. Chinese Journal of Perinatal Medicine, 2023.
- Association between telemedicine and incidence of status epilepticus during the COVID-19 pandemic. Epilepsy and Behavior, 2021.
- Assessment of ultrasound-guided abdominal wall nerve block for postoperative pain control and optimization of opioid utilization in patients undergoing abdominal surgery. Pakistan Journal of Pharmaceutical Sciences, 2025.
- Safety and efficacy of oral anticoagulants in extreme weights. Thrombosis Research, 2023.
- Loneliness and risky behaviours among mobile fishers in Elmina, Ghana: a convergent parallel mixed-method study. BMC Public Health, 2024.
This article is educational and does not replace institutional policy, professional advice, or applicable safety and regulatory requirements.