Statistical Test
Chi-Square Calculator
Test whether two categorical variables are independent. Upload your data and get the chi-square statistic, p-value, and effect size in seconds — no formulas required.
Try it now — drop your data file
CSV or Excel. Your data stays in your browser.
Drop your spreadsheet here
CSV or Excel · up to 50 MB
What is the chi-square test?
The chi-square (χ²) test of independence determines whether there is a statistically significant association between two categorical variables. It compares the frequencies you actually observe in your data against the frequencies you would expect if the two variables were completely unrelated.
Developed by Karl Pearson in 1900, it remains one of the most widely used tests in social science, market research, and epidemiology. If you've ever asked “does product preference vary by age group?” or “is smoking status related to disease outcome?” you need a chi-square test.
The test produces a p-value: if p < 0.05 (the conventional threshold), you reject the null hypothesis and conclude the variables are not independent. But statistical significance alone doesn't tell you how strong the relationship is — that's what Cramér's V is for.
When to use it
- Both variables are categorical (nominal or ordinal).
- You have a sufficiently large sample — at least 5 expected observations in each cell. If not, use Fisher's exact test instead.
- Observations are independent (each participant contributes to only one cell).
- You want to test association, not direction or strength.
For small samples or sparse tables, consider the Fisher's exact test instead.
Formula
Pearson chi-square statistic
χ² = ∑ (O − E)² / E
O = observed cell frequency
E = expected cell frequency = (row total × column total) / grand total
df = (rows − 1) × (columns − 1)
Interpreting the results
p > 0.05
Not significant
Insufficient evidence to conclude an association exists. The pattern may be due to chance.
p ≤ 0.05
Significant
The association is unlikely to be due to chance. Report the effect size to convey its magnitude.
p ≤ 0.001
Highly significant
Very strong evidence of an association. Still check effect size — it may be trivially small with a large dataset.
Always pair the chi-square p-value with an effect size such as Cramér's V. A large dataset can produce a significant p-value even for a negligibly small association.