χ² Chi-Square Test Calculator
Compute chi-square statistic, expected frequencies, degrees of freedom, and p-value for a 2×2 to 4×4 contingency table.
Expected Frequencies
Chi-Square Formula
How to Perform a Chi-Square Test
-
1Set Table SizeSelect the number of rows and columns that match your data categories.
-
2Enter Observed CountsFill in each cell with the frequency count you observed in your data.
-
3Review Expected FrequenciesThe calculator shows what frequencies would be expected if the variables were independent.
-
4Interpret the ResultIf p < 0.05, reject H₀ — there is a statistically significant association between the variables.
Frequently Asked Questions
The chi-square test of independence determines whether two categorical variables are associated. For example, whether treatment type and recovery outcome are related, or whether gender and product preference are independent.
H₀ states that the two categorical variables are independent — knowing one variable tells you nothing about the other. A significant result means the variables are associated.
Expected frequencies are what you would expect in each cell if H₀ were true (complete independence). They are calculated from the row totals, column totals, and grand total.
The test requires that expected frequencies are ≥ 5 in at least 80% of cells, and no cell has an expected frequency < 1. If these assumptions are violated, consider Fisher's exact test instead.
Yates' continuity correction adjusts the chi-square formula for 2×2 tables to reduce overestimation of significance. It subtracts 0.5 from |O−E| before squaring, making the test more conservative.
Related Calculators
T-Test Calculator
Perform one-sample, two-sample, and paired t-tests with p-value and confidence interval.
ANOVA Calculator
Perform one-way ANOVA test to compare means across multiple groups.
Normal Distribution Calculator
Calculate probabilities and percentiles for the normal (Gaussian) distribution.