Chi-square calculator
Paste a table of counts. The calculator runs Pearson chi-square and, when the expected counts are too small for it to be trusted, tells you so and gives Fisher's exact test.
When to use this
Two categorical variables, counted. Treatment arm versus whether the patient responded; sex versus whether the item was correct; three age bands versus four symptom grades. The data are counts of cases in cells, not measurements.
A worked example where the choice of test changes the answer
Two arms, ten and seventeen participants. Two responded in the first arm, ten in the second. The smallest expected count is 4.44 — just below the threshold.
| Test | Result | At α = .05 |
|---|---|---|
| Pearson chi-square | χ²(1) = 3.844, p = .050 | On the line |
| Fisher's exact test | p = .107 | Not significant |
Cramér's V for the same table is .377, a moderate association — which shows why the effect size belongs next to the p value, not after it.
Neither test is wrong. They answer the question with different machinery, and with cells this thin the approximation behind chi-square is the weaker one.
Why expected counts decide which test you report
The chi-square statistic is compared against a continuous distribution, but counts are discrete. With small expected counts the tail of that distribution is a poor fit, and the computed p value comes out too small. Fisher's exact test computes the probability of the observed table directly, so it has no approximation to fail.
For tables larger than 2×2 there is no exact fallback here. Collapse categories on a principled basis, or report chi-square while stating the smallest expected count.
What to report
χ²(1) = 3.84, p = .050, N = 27, with the smallest expected count when it is small, and Cramér's V as the effect size. If you used Fisher's exact test, report the exact p value and say so.
Frequently asked
When should I use Fisher's exact test instead of chi-square?
In a 2×2 table, whenever any expected count is below about five. The calculator checks this for you and shows both values when it applies.
Does the table have to be 2×2?
No — any number of rows and columns with equal lengths works for chi-square. Fisher's exact test is only computed for 2×2.
What if my counts are percentages?
Then it is not a chi-square problem. Convert back to counts, or model proportions with logistic regression.
Is my data uploaded?
No. The calculation runs in JavaScript on this page.
When you have a file rather than counts
The StatsToTable app reads a .sav, .xlsx or
.csv, builds the contingency table for you, applies the expected-count rule, and
exports a three-line table. One report export a month is free.
Which test should I use? · t test calculator · chi-square calculator · ANOVA calculator · correlation calculator · p value calculator