Chi-square calculator
Test association of two categorical variables. 2×2 or up to 5×5 — χ² and p-value
Enter survey data
E.g. 2×2: first row "50 30", second "20 40". Or paste from Excel.
Assumptions and limitations
- Expected frequency in each cell at least 5 (for 2×2 better at least 10). Otherwise the result may be inaccurate.
- Input: non-negative integers. Rows and columns from 2 to 5.
In SurveyNinja, NPS, CSAT and more are calculated automatically. Create a survey in 5 minutes and get real-time analytics.
Start freeData is not stored — calculation runs in your browser.
Chi-square and association
What we test
Null hypothesis: variables are independent. If p-value < 0.05, we reject H₀ and consider the association statistically significant.
Formula
χ² = Σ (O − E)² / E, where O = observed frequency, E = expected under independence: E = (row sum × column sum) / N.
Degrees of freedom
df = (rows − 1) × (columns − 1). For 2×2 table df = 1.
When to use
Cross-tabulations in surveys: gender × brand choice, age × response type. Not suitable for ordinal variables with many levels — use other methods.
Chi-square calculation examples
1 Association present (gender × purchase)
2 No association
3 3×2 table (age × yes/no)
4 Weak signal
5 Strong association (brand × region)
6 2×3 table (channel × outcome)
Interpreting p-value
If in 2×2 table expected frequency in a cell < 5, χ² may be inaccurate; consider Fisher's exact test.
Frequently asked questions about chi-square
What does chi-square show?
How to enter the table?
Why expected frequencies at least 5?
Chi-square vs A/B test — what's the difference?
What is p-value?
Automate your metrics
In SurveyNinja, NPS, CSAT and more are calculated automatically. Create a survey in 5 minutes and get real-time analytics.
Start free