Chi-Square Test Calculator
Test whether two categorical variables are associated using a contingency table, chi-square statistic, degrees of freedom, and p-value.
About the chi-square test of independence
Chi-square independence examples
Contingency tables can represent survey answers, outcomes, or category preferences.
| Observed table | Test result | Interpretation |
|---|---|---|
| 10, 20; 20, 40 | χ² = 0, df = 1, p = 1 | Both rows have identical proportions, so observed and expected counts match. |
| 10, 10; 10, 30 | χ² = 3.75, df = 1, p ≈ 0.0528 | The evidence is close to, but above, a 0.05 significance threshold. |
| 30, 10; 10, 30 | χ² = 20, df = 1, p < 0.001 | The opposite row patterns provide strong evidence of association. |
How to run a chi-square test
- Arrange raw counts with one variable in rows and the other in columns.
- Enter commas between cells and semicolons between table rows.
- Select Calculate Chi-Square to compute the statistic and p-value.
- Compare the p-value with a significance level selected before analyzing the data.
Chi-square test FAQ
What does a small p-value mean?
It means the observed table would be unusual under the assumption of independence. It supports an association, but does not prove causation or quantify effect size.
Can I enter percentages instead of counts?
No. The test requires observed frequency counts because expected frequencies and sampling variability depend on the total sample size. Convert the source data back to counts first.
What are the degrees of freedom?
They determine which chi-square distribution is used for the p-value. For an r-by-c table, degrees of freedom equal (r − 1)(c − 1).
When are expected counts too small?
A common guideline requires every expected count to be at least one and at least 80% to be five or greater. When a small table violates that guidance, consider an exact test.
Does significance show a strong relationship?
Not necessarily. Significance is affected by sample size, so report an effect size such as Cramér's V as well. Context determines whether the association matters.