About Chi-Square Test Calculator
A chi-square test compares observed categorical counts with the counts expected under a null model. This workspace supports a contingency-table test of independence for tables from 2×2 up to 6×6, and a goodness-of-fit test against fixed expected counts that you supply.
The contingency mode reports expected counts, chi-square, degrees of freedom, the upper-tail p-value and Cramér's V, and warns when expected cells are small. The fit mode reports standardized residuals. Both modes display their assumptions and a clear note that a p-value is not the probability the null is true and not proof of independence, fit or causation.
What this tool does
Contingency tables up to 6×6
Choose 2 to 6 rows and columns, enter observed counts, and see the expected count in every cell alongside the observed value.
Goodness-of-fit mode
Paste observed and expected counts for two or more categories; the totals must match and every expected count must be positive.
Expected-count warning
Cells with expected counts below 5 are counted and flagged, because the chi-square approximation can be unreliable with small expected counts.
Cramér's V and residuals
Contingency mode reports Cramér's V for association strength; goodness-of-fit mode reports a standardized residual for each category.
Working and degrees of freedom
The substituted formula shows how chi-square, df = (r−1)(c−1) or k−1, and the upper-tail p-value were obtained.
Assumptions and scope panel
Independence, categorical data, expected-count guidelines and the absence of post-hoc or exact tests are stated next to the result.
How to use Chi-Square Test Calculator
- 01
Choose the test mode
Use the contingency mode to test whether two categorical variables are associated, or goodness of fit to compare one categorical variable with fixed expected proportions.
- 02
Enter the observed counts
For a contingency table, choose the shape and fill every cell with a whole-number count. For goodness of fit, paste observed and expected counts separated by commas or spaces.
- 03
Check the expected counts
Review the expected column or the observed (expected) table and the low-expected-count warning before interpreting the p-value.
- 04
Read chi-square, df and p
The main p-value is the upper-tail probability from the chi-square distribution with the displayed degrees of freedom.
- 05
Interpret within the assumptions
A small p-value is evidence against the null model under these assumptions, not proof of causation, and a large p-value does not prove independence or a correct fit.
How this tool works
- Works with
- COUNTS → CHI-SQUARE TEST
- Processing
- Client-side, in your browser. Nothing is uploaded.
- Requirements
- A modern browser with JavaScript enabled · Whole-number count data for a contingency table, or matched observed and expected counts for the goodness-of-fit mode
Limitations worth knowing
- Contingency mode uses the chi-square approximation only; Fisher's exact test and other small-cell exact methods are not included.
- No post-hoc cell comparisons, adjusted residuals with multiple-testing correction, or effect-size confidence intervals are provided.
- The test assumes independent observations and a random sample; clustered, repeated-measures or complex-survey data need different methods.
- A significant result says the counts are unusual under the null model, not that one variable causes the other or that no other explanation exists.
Privacy and file handling
The observed and expected counts are calculated entirely in this browser tab. Nothing is uploaded, stored or logged, and the workspace makes no network request with your table. Closing the page clears the counts and the result.
Read the full privacy policy
