Perform chi-square test of independence for categorical data analysis.
Last updated: November 14, 2026
Categorical data analysis
Chi-square test is used to test whether there is a significant relationship between two categorical variables. For example, is there a relationship between gender and product preference? Are education level and income independent?
How it works: Observed frequencies are compared with expected frequencies. If there's a large difference, variables are not independent. Degrees of freedom (df) = (rows-1) × (columns-1). Each cell should have at least 5 observations.
Applications and examples: Marketing research (age group → product preference), health research (treatment → recovery rate), social sciences (education → income relationship), quality control (shift → error rate), A/B testing (version → conversion rate).
Short answers to common questions
Use it to test relationship between two categorical variables. Examples: gender-product preference, education-income, age group-disease.
Observed frequency = your actual data. Expected frequency = what would be expected if variables were independent. Chi-square measures the difference between these.
Degrees of freedom (df) = (number of rows - 1) × (number of columns - 1). For example, for 2x2 table df = (2-1) × (2-1) = 1.
Each cell should have at least 5 observations. With fewer observations, results may not be reliable. In this case, Fisher's exact test should be used.
More tools for similar calculations
Enter data row by row, separated by comma or space
Conclusion
Significant relationship exists between variables (reject H₀)
| 12.00 | 18.00 |
| 28.00 | 42.00 |
Note: Chi-square test tests independence between categorical variables. If χ² > critical value or p < α, relationship exists between variables.