How to use the Chi-Square Calculator
- 1. Choose the testPick independence for a table, or goodness of fit for one row of counts.
- 2. Paste your countsEnter one row per line, separated by commas or spaces.
- 3. Read the decisionGet χ², df, p-value and whether to reject the null hypothesis.
How the test works
The chi-square statistic compares observed counts with the counts you would expect if there were no relationship: χ² = Σ (O − E)² ÷ E. For a contingency table, each expected count is (row total × column total) ÷ grand total, and the degrees of freedom are (rows − 1) × (columns − 1).
Worked example: 100 people, 50 who saw ad A and 50 who saw ad B. 20 of the A group and 30 of the B group clicked. Every expected count is 25, so χ² = 4 × (5² ÷ 25) = 4 with df = 1, and the p-value is 0.0455. At α = 0.05 that is significant: click rate and ad version look related.
Assumptions and good practice
- Counts, not percentages. Enter raw frequencies. Percentages give wrong results.
- Independent observations. Each person or item should be counted once.
- Expected counts of 5 or more. The tool warns you if any are smaller. Merge categories or use Fisher's exact test then.
- No Yates correction. Some textbooks apply it to 2×2 tables, which gives a slightly larger p-value.
For goodness of fit, leave the expected box blank to test whether all categories are equally likely (a fair die, say), or enter expected proportions like 25, 25, 50. A small p-value tells you the pattern is unlikely under the null hypothesis; it does not tell you how strong the relationship is. To compare two group means instead, use the t-test calculator.
Frequently asked questions
How is the p-value calculated?
From the chi-square distribution with your degrees of freedom, using the regularised gamma function. It matches statistics software to at least four decimals.
Can I use it for survey data?
Yes, as long as you enter counts of respondents in each category, not percentages.
Is the Chi-Square Calculator free?
Yes, the Chi-Square Calculator is free. The first time you see your first result, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.