Chi-Square Calculator
Test of independence and goodness of fit, with expected counts, Cramér's V, and assumption warnings.
1. Choose the test
Two categorical variables — is there an association between them? Enter a contingency table of counts, e.g. treatment vs control by improved vs not.
2. Enter your counts
Whole-number frequencies, not percentages or averages. Every participant appears in exactly one cell.
| Total | |||
|---|---|---|---|
| 50 | |||
| 50 | |||
| Total | 45 | 55 | 100 |
Applies to 2×2 tables only. Conservative; some fields expect it, others consider it outdated.
3. Results
- χ²
- 7.919
- df
- 1
- p
- .005
- Cramér's V
- .281
significant at .05
small association
| Improved | No change | |
|---|---|---|
| Treatment | 30(exp 22.5) | 20(exp 27.5) |
| Control | 15(exp 22.5) | 35(exp 27.5) |
Statistically significant at the .05 level
The two variables are associated — the distribution across columns differs by row more than chance would explain. Chi-square doesn't tell you where the difference is; compare the observed and expected counts above to see which cells drive it.
Yates' correction applied
Because this is a 2×2 table, Yates' continuity correction was used, which makes the test slightly conservative. State this in your write-up — the uncorrected χ² would be larger. You can turn it off above if your field prefers the uncorrected value.
4. APA-formatted write-up
A chi-square test of independence examined the relationship between the row and column variables. The relationship was statistically significant, χ²(1, N = 100) = 7.92, p = .005, with Yates' continuity correction applied. The association was small in size, Cramér's V = .28. Inline: χ²(1, N = 100) = 7.92, p = .005, V = .28
When to use chi-square
Chi-square is the test for categorical data — counts of things in groups, not measurements. If your data is “how many people in each category”, chi-square is probably right. If it’s “what was the average score”, you want a t-test or ANOVA.
Typical uses:
- Is treatment group associated with recovery (yes/no)?
- Do men and women differ in their preferred study method?
- Are complaints evenly distributed across days of the week?
- Does programme of study relate to whether students use the library?
How it works
Chi-square compares what you observed against what you would expect if the variables were unrelated. Expected counts come from the row and column totals: if 45% of everyone improved, then under independence you’d expect 45% of each group to have improved. The statistic accumulates the squared gap between observed and expected across every cell, scaled by the expected count.
Large χ² means your table looks unlike the independence pattern. Because χ² grows with sample size, the p-value alone can’t tell you whether the association matters — which is what Cramér’s V is for.
Assumptions that actually bite
- Frequencies, not percentages. The single most common mistake. The test needs raw counts.
- Independent observations. Each participant appears in exactly one cell. If the same people are counted twice — before and after, say — chi-square is the wrong test; use McNemar’s test.
- Expected counts of at least 5. The approximation fails below this. The calculator flags every offending cell and shows the expected values so you can see the problem rather than trusting a number that has quietly become unreliable.
Reporting it in APA style
χ²(1, N = 100) = 8.42, p = .004, V = .29
Include degrees of freedom and the sample size in the parentheses — this is specific to chi-square and often forgotten. Follow it with Cramér’s V as the effect size, and say whether Yates’ correction was applied. The copy block above assembles all of this.
Then interpret in words. A significant chi-square means the variables are associated; it doesn’t say which direction or which category drives it. Point your reader at the cells with the largest observed-minus-expected gaps.
Frequently asked questions
- What's the difference between the two chi-square tests?
- A test of independence asks whether two categorical variables are associated — does treatment group relate to whether people improved? You enter a contingency table. A goodness-of-fit test asks whether one variable's distribution matches what you expected — are complaints spread evenly across weekdays? You enter one row of counts and, optionally, expected values.
- Can I enter percentages instead of counts?
- No, and this is the most common error with chi-square. The test works on raw frequencies because the sample size is what determines the p-value. Entering percentages effectively tells the test your sample size is 100, producing a meaningless result. Convert back to counts first.
- What does the expected count assumption mean?
- Chi-square approximates a continuous distribution, and that approximation breaks down when the expected count in a cell is small. The conventional rule is that all expected counts should be at least 5, or at minimum no more than 20% of cells below 5 with none below 1. The calculator computes every expected count and warns you when the rule is violated.
- My expected counts are too small. What now?
- For a 2×2 table, use Fisher's exact test — it gives an exact p-value with no expected-count requirement. For larger tables, combine sparse categories into a meaningful larger group (merge 'strongly agree' and 'agree', or group rare responses into 'Other'). Collecting more data works too, but merging is usually the practical answer. Don't just report the unreliable p-value.
- Should I use Yates' continuity correction?
- It applies only to 2×2 tables, where it makes the test more conservative — a larger p-value. It's applied by default here because that's the common convention and the safer direction to err. Some statisticians consider it unnecessarily conservative and prefer the uncorrected value or Fisher's exact test. Whichever you use, say which in your write-up.
- What is Cramér's V?
- The effect size for chi-square, running from 0 (no association) to 1 (perfect). Chi-square itself grows with sample size, so it can't tell you how strong an association is — with 10,000 people, a trivial association is significant. Cramér's V is sample-size independent. Its benchmarks scale with table size, which the calculator accounts for.
- My result is significant. Which cell caused it?
- Chi-square is an omnibus test: it tells you the table as a whole departs from independence, not where. To locate the source, compare each observed count to its expected count — the biggest discrepancies are the driver. For a formal answer, compute standardized residuals, treating any beyond about ±2 as a notable cell.
Related free tools
Sample Size Calculator
How many participants do you actually need? Four calculators covering surveys, group comparisons, proportions, and correlations.
T-Test Calculator
Independent, paired, and one-sample t-tests with exact p-values, confidence intervals, effect size, and APA output.
Effect Size Calculator
Cohen's d, Hedges' g, eta squared, and conversions between effect size metrics — with the interpretation benchmarks.
Need the whole analysis, not just this step?
Analytika picks the right test for your data, checks the assumptions, and writes up the results in APA format. Upload a dataset and ask a question in plain English.