Math

Chi-Square Calculator

Test categorical counts for fit or independence in seconds

Leave blank to assume equal expected counts across categories.

Enter observed counts to run the test.

Chi-Square Tests In Plain English

A chi-square test compares observed counts with the counts you would expect if there were no pattern or no relationship. This calculator supports both the goodness-of-fit test and the test of independence, so you can work with a single category distribution or a full contingency table.

Goodness Of Fit

In a goodness-of-fit test, you provide observed counts and optional expected counts. If you leave expected counts blank, the tool assumes equal expected frequencies across categories.

Test Of Independence

For independence testing, enter a contingency table using rows on separate lines. The calculator computes row totals, column totals, the expected table, the chi-square statistic, the p-value, and Cramer's V.

Frequently Asked Questions

What is the chi-square test used for?
The chi-square test is used for categorical data. It can test whether observed counts differ from expected counts or whether two categorical variables are associated in a contingency table.
When should I use goodness of fit versus independence?
Use goodness of fit when one variable has several categories and you want to compare the observed distribution with an expected distribution. Use the independence test when you have a contingency table with rows and columns and want to test whether the variables are related.
What effect size does this tool report?
For goodness of fit the tool reports phi. For contingency tables it reports Cramer's V, which adjusts the effect size for the table shape.
Do expected counts matter?
Yes. Very small expected counts can make the asymptotic chi-square approximation less reliable. If many expected cells are below 5, consider collapsing categories or using an exact test where appropriate.