Calculator Suite
Chi-Square Test Calculator
Chi-Square AnalysisPerform chi-square goodness of fit tests and tests of independence with comprehensive statistical analysis
Enter the actual counts for each category
Enter the theoretical expected counts for each category
Labels for each category (leave empty for auto-generated labels)
Educational Resources
Test Statistic
= Observed frequency in cell i
= Expected frequency in cell i
= Chi-square test statistic
Expected Frequency (Independence)
= Row i total
= Column j total
= Grand total
Degrees of Freedom
= Number of categories
= Number of rows, = Number of columns
Chi-square tests analyze categorical data frequencies. Use Goodness of Fit to test if observed frequencies match an expected distribution. Use Test of Independence to examine if two categorical variables are related. If p-value < 0.05, the result is statistically significant.
Select Test Type
Goodness of Fit (one variable) or Test of Independence (two variables).
Enter Your Data
For GoF: observed and expected frequencies. For Independence: contingency table.
Run the Test
Click "Run Chi-Square Test" to calculate χ² statistic and p-value.
Interpret Results
Check p-value, degrees of freedom, and Cramér's V (for independence tests).
📊 Example: Dice Fairness Test (Goodness of Fit)
Roll a die 60 times. If fair, expect 10 per side. Observed: [8, 12, 11, 9, 10, 10]
χ² statistic
1.20
df
5
p-value
0.945
Result
Not Significant
Interpretation: p = 0.945 > 0.05, so we cannot reject the hypothesis that the die is fair.
Key Assumptions:
- • Data from random sampling
- • Expected frequencies ≥ 5 in most cells
- • Independent observations
- • Categorical (not continuous) data
When to Use Alternatives:
- • Small expected frequencies: Fisher's exact test
- • 2×2 tables with small n: Yates' correction
- • Continuous data: Use t-test or ANOVA
- • Paired/matched data: McNemar's test
When should I use a chi-square test?
Use chi-square for categorical data to test if observed frequencies differ from expected (goodness of fit) or if two categorical variables are related (independence).
What are degrees of freedom in chi-square?
For goodness of fit: df = k - 1 (k = categories). For independence: df = (rows - 1) × (columns - 1).
What if expected frequencies are less than 5?
The chi-square approximation becomes unreliable. Consider combining categories or using Fisher's exact test.
What does Cramér's V tell me?
Cramér's V measures association strength (0-1). ~0.1 = weak, ~0.3 = moderate, ~0.5+ = strong association.
How is chi-square different from a t-test?
Chi-square analyzes categorical frequencies. T-tests compare means of continuous data. Use chi-square for categories, t-test for measurements.