Chi-Square Test Calculator
The chi-square (χ²) test of independence, developed by Karl Pearson, is a nonparametric hypothesis test that checks whether there is a statistically significant association between two categorical variables. The observed frequencies in a contingency table are compared with the expected frequencies that would arise if the variables were independent; the larger the gap, the larger χ² becomes and the weaker the independence hypothesis gets.
From a contingency table in which you paste one group's (category's) frequencies per line, this calculator returns the χ² statistic, the degrees of freedom, the p-value, and the Cramér V coefficient that expresses the strength of the association. It also produces the expected frequency table and warns you if any expected frequency falls below 5. It is built for researchers analyzing survey and thesis data.
Formula
Expected frequency: E = (Row Total × Column Total) / N χ² = Σ (Observed − Expected)² / Expected Degrees of freedom: df = (number of rows − 1) × (number of columns − 1) Cramér V = √( χ² / (N × min(rows − 1, columns − 1)) )
The most common mistake is entering percentages or means in the cells instead of frequencies (counts); chi-square applies to counts only. The test also loses its reliability when more than 20% of the cells have an expected frequency below 5.
How to Calculate
- Write each row of your contingency table on its own line in the box; separate the cell frequencies with commas or spaces.
- Press Calculate: χ², the degrees of freedom, the p-value, and Cramér V are computed instantly.
- Review the expected frequency table; the calculator warns you if any expected frequency is below 5.
- Decide from the p-value: if p < 0.05 there is a significant association between the variables.
- Use the ready-made finding sentence in the interpretation line (χ², df, N, p, V) in the results section of your thesis.
Worked Examples
Gender and product preference (2x2)
In a sample of 100 people, 30 women chose product A and 20 chose B, while 20 men chose A and 30 chose B. The result: χ²(1, N = 100) = 4.00, p = 0.046, Cramér V = 0.20 (a weak association). Every expected frequency is 25.00, so the conditions of the test are met; because p < 0.05, there is a significant association between gender and product preference.
Chi-square statistic (χ²): 4.000 · Degrees of freedom (df): 1 · p-value (two-tailed): p = 0.046
Education level and smoking (3x2)
Entering the smoker/non-smoker frequencies for three education levels (a total of N = 150) gives χ²(2, N = 150) = 9.38, p = 0.009, V = 0.25. Because p < 0.05, education level and smoking are associated; by Cramér V the association is weak.
Chi-square statistic (χ²): 9.375 · Degrees of freedom (df): 2 · p-value (two-tailed): p = 0.009
A non-significant result (2x3)
When two groups are spread almost evenly across three categories, the test comes out non-significant: χ²(2, N = 120) = 0.35, p = 0.840, V = 0.05. Because p ≥ 0.05, the independence hypothesis cannot be rejected; no association was found between the variables.
Chi-square statistic (χ²): 0.349 · Degrees of freedom (df): 2 · p-value (two-tailed): p = 0.840