Observed Frequencies (O)
Actual counts from your dataWhat you actually observed in each category combination
Example: 50 people who prefer Product A and live in City X
Calculate Chi-Square statistic, degrees of freedom, and p-value for goodness of fit and independence tests.
https://www.solvezi.com/statistics/chi-square-calculator
Test independence between categorical variables
| Row/Col | Col 1 | Col 2 | Col 3 | Row Total |
|---|---|---|---|---|
| Row 1 | 0 | |||
| Row 2 | 0 | |||
| Row 3 | 0 | |||
| Col Total | 0 | 0 | 0 | 0 |
Enter observed frequencies in the table above
Degrees of Freedom
0
(r - 1) × (c - 1)p-value
0.0000
Interpretation:
⚡ Enter observed frequencies to calculate Chi-Square
Chi-Square Formula:
χ² = Σ (O - E)² / E
Where O = Observed, E = Expected (Row Total × Col Total / Grand Total)
df = (rows - 1) × (columns - 1)
p < 0.05
Statistically Significant
Reject H₀
p ≥ 0.05
Not Significant
Fail to Reject H₀
Effect Size
Cramér's V
√(χ² / (n × min(r-1, c-1)))
Chi-Square Test Calculator • Test independence between categorical variables
Master the Chi-Square test of independence — learn when to use it, how to interpret results, understand assumptions, and apply to real-world categorical data analysis.
The Chi-Square test of independence is a statistical method used to determine whether there is a significant association between two categorical variables. It compares observed frequencies in a contingency table with expected frequencies under the null hypothesis.
"Are these two categorical variables independent, or is there a statistically significant relationship between them?"
The two categorical variables are independent (no association)
The two categorical variables are associated (not independent)
Actual counts from your dataWhat you actually observed in each category combination
Example: 50 people who prefer Product A and live in City X
(Row Total × Column Total) / Grand TotalWhat you'd expect if variables were independent
Example: If independent, 45 people expected in this cell
χ² = Σ (O - E)² / EMeasures total discrepancy between observed and expected
Example: Larger χ² = stronger association
df = (r - 1) × (c - 1)Number of independent pieces of information
Example: 3×3 table → df = 4
P(χ² ≥ observed | H₀ true)Probability of seeing this result by chance
Example: p < 0.05 = statistically significant
V = √[χ² / (n × min(r-1, c-1))]Measures strength of association
Example: V = 0.1 small, 0.3 medium, 0.5 large
Find meaningful customer segments
Test treatment effectiveness
Evaluate educational interventions
Study social patterns
Identify production problems
Compare marketing effectiveness
H₀: Variables are independent. H₁: Variables are associated.
Organize observed frequencies in rows and columns
E = (Row Total × Col Total) / Grand Total for each cell
χ² = Σ (O - E)² / E across all cells
df = (r - 1) × (c - 1)
Use chi-square distribution with calculated df
If p < α (usually 0.05), reject H₀
Calculate Cramér's V to measure association strength
Data should be randomly sampled from population
✓ Ensure unbiased sample collection
Each observation belongs to exactly one cell
✓ No overlapping category membership
≥ 5 expected frequency in all cells (or 80%)
✓ Check our expected frequencies table
Use raw frequencies, not proportions
✓ Enter counts, not percentages
Warning: If expected frequencies are too small (<5), the chi-square approximation may be inaccurate. Consider using Fisher's exact test or combining categories with low expected counts.
Weak or negligible association
Moderate association
Strong association
Formula: V = √[χ² / (n × min(r-1, c-1))] where n = total sample size, r = number of rows, c = number of columns. Values range from 0 (no association) to 1 (perfect association).
Simplest contingency table
Use: Two binary variables
Use Yates' correction for continuity
One binary, one three-level
Use: Treatment vs outcome categories
Common in clinical trials
Three levels each
Use: Standard market research
Our default example
Any rectangular table
Use: Complex category structures
Works with our calculator
Variables: Two categorical
Association between categorical variables
Variables: One categorical
Comparing to theoretical distribution
Variables: Two categorical
Small sample sizes, expected < 5
Variables: Categorical vs continuous
Comparing group means
Using percentages or proportions instead of counts
Always use raw frequency counts in the contingency table
Convert percentages back to counts using total sample size
Ignoring small expected frequencies
Check expected frequencies — if <5, consider Fisher's exact test
Combine categories with low expected counts
Confusing association with causation
Chi-square only indicates association, not causation
Use additional research to establish causality
Using chi-square with continuous variables
Chi-square requires categorical variables
Use regression or correlation for continuous data
A significant result (p < 0.05) means you reject the null hypothesis of independence. There is statistical evidence that the two categorical variables are associated — the observed pattern is unlikely to have occurred by chance alone. However, significance doesn't tell you the strength or direction of association.
The chi-square distribution approximates the true distribution of the test statistic only when expected frequencies are sufficiently large (typically ≥ 5). With smaller expected frequencies, the approximation becomes poor, increasing Type I error risk. If violated, consider Fisher's exact test or combining categories.
Fisher's exact test calculates exact p-values without approximation, making it preferable for small sample sizes or when expected frequencies are < 5. Chi-square is an approximation that works well for larger samples. Our calculator uses chi-square, which is appropriate when expected frequencies meet the assumptions.
Chi-square only tells you that an association exists overall. To identify which specific cells contribute to significance, examine standardized residuals (observed - expected / √expected). Values > 2 or < -2 indicate cells driving the significance. Post-hoc tests with Bonferroni correction can also be used.
Yates' correction adjusts the chi-square formula for 2×2 tables by subtracting 0.5 from |O - E| before squaring. It reduces the chi-square value slightly, making the test more conservative. It's recommended for 2×2 tables to prevent overestimation of significance, especially with small samples.
Report: χ²(df, N = total) = value, p = p-value, V = effect size. Example: 'A chi-square test of independence showed a significant association between gender and product preference, χ²(1, N = 150) = 12.34, p = .001, V = .29.' Include percentages or frequencies to illustrate the pattern.
Cramér's V is a normalized measure of association derived from chi-square: V = √(χ² / (n × min(r-1, c-1))). It ranges from 0 (no association) to 1 (perfect association). While chi-square depends on sample size, Cramér's V is a standardized effect size that allows comparison across studies.
Standard chi-square tests association between two variables only. For more than two variables, consider: 1) Sequential pairwise tests, 2) Three-way contingency tables with log-linear models, 3) Multiple correspondence analysis (MCA). Interpret with caution as multiple tests increase Type I error.
1857-1936
Developed the chi-square test (1900)
Father of mathematical statistics, also developed correlation coefficient
1890-1962
Refined chi-square and introduced Fisher's exact test
Pioneered design of experiments and maximum likelihood
1902-1994
Developed continuity correction for 2×2 tables (1934)
Worked with Fisher on experimental design
Did You Know? Karl Pearson first introduced the chi-square test in 1900 as a way to test goodness-of-fit. The test was revolutionary because it provided a mathematical method to assess whether observations fit theoretical expectations. Pearson also gave statistics the symbol χ (Greek letter chi).
A chi-square test of independence was performed to examine the relationship between gender and product preference. The relationship between these variables was significant, χ²(2, N = 150) = 12.34, p = .002, V = .29.Required elements:
Additional details:
Chi-Square test of independence calculator and complete guide. Test association between categorical variables, calculate chi-square statistic, p-value, degrees of freedom, and effect size (Cramér's V). Learn contingency table analysis, assumptions, interpretation, and reporting in APA format. Perfect for market research, medical studies, social sciences, and quality control applications.