🔬Chi-Square Test Calculator

Expected frequencies, χ², degrees of freedom and association strength

How to use the chi-square test calculator

Paste an observed contingency table with one row per line and the calculator builds the expected frequencies itself before returning the chi-square statistic and the p-value. There is no need to supply expected counts. Each cell gets row total times column total divided by the grand total, which is exactly the test of independence you want for two categorical variables such as gender against preference.

Degrees of freedom are the number of rows minus one times the number of columns minus one. The verdict compares the p-value against the significance level you pick, and Cramér's V reports the strength of the association in a way that is less sensitive to table size. For a 2×2 table the Yates continuity correction can be switched on, and it is applied only when the table really is 2×2 and reported only when it was applied.

Whenever a cell has an expected frequency under 5 the chi-square approximation becomes unreliable, so the offending cells are counted and flagged. A row or column that totals zero drives its expected frequencies to zero and makes the division impossible, so that case is explained instead of calculated. The p-value is a numerical approximation of the chi-square upper tail via incomplete gamma functions and matches printed critical values to four decimals.

Frequently asked questions

Do I have to enter expected frequencies?

No. Enter the observed counts only and the expected frequencies are derived from the row and column totals and shown in a table.

What should I do about the expected frequency warning?

Merge categories so cells grow, collect a larger sample, or for a 2×2 table switch to a Fisher exact test.

Why does a row that totals zero stop the calculation?

Expected frequency is row total times column total divided by the grand total, so a zero row total makes it zero, and chi-square divides by the expected frequency.