Interactive module guide
Chi Square Independence Test Calculator — Free & Interactive
This chi square independence test calculator evaluates association in contingency tables from 2 by 2 up to 6 by 6 and reports expected counts, a p-value, and Cramer’s V.
Free · No sign-up · Calculations stay in your browser
A chi-square test of independence evaluates whether the row and column variables in a contingency table show evidence of association.
This calculator accepts contingency tables from 2×2 up to 6×6 nonnegative observed counts, computes expected counts under independence, and reports χ², (r−1)(c−1) degrees of freedom, a p-value, and Cramér’s V.
It does not accept percentages or paired outcomes, and sparse expected counts can make the asymptotic chi-square reference unreliable.
Use the chi square independence test calculator for counts cross-classified by two categorical variables, with independent observations and adequate expected cell frequencies.
When to use this chi square independence test calculator
Use it when
- Use the test when each observational unit contributes to exactly one of two row categories and one of two column categories. The table entries must be counts of distinct observations, not rates or means.
- The null says row and column classifications are independent in the population or randomization model. The alternative says an association exists; it does not specify direction or causation by itself.
- The chi-square approximation is most defensible when expected cell counts are not small. This calculator warns when any expected count is below five and suggests considering an exact method.
Choose another method when
- Do not use this independence test for paired binary responses, repeated observations, matched case-control data, or clustered counts. McNemar, conditional, generalized, or survey methods may be required.
- Avoid it when cells contain percentages or separately normalized rates. The calculation needs the joint count table and its marginal totals to construct expected frequencies.
Interactive tool
The calculator loads as you approach this section so the guide remains fast on mobile connections.
Example preview
Treatment group and recovery
- Inputs
- 2×2 counts: 36, 14, 25, and 25.
- Representative result
- χ²≈5.086 with df=1 and p≈0.0241.
Illustrative only. Load the interactive tool to enter your own values and review assumptions.
Watch the explanation
3:37 minThe player loads only after you press play. You can also watch on YouTube.
Read the complete transcript
The Chi-Square Test of Independence. Do treatment group and recovery status show evidence of association?
A chi-square test of independence evaluates whether the row and column variables in a contingency table show evidence of association. This calculator implements a 2 times 2 table of nonnegative observed counts, computes expected counts under independence, and reports chi squared, one degree of freedom, a p-value, and Cramér’s V. It does not accept percentages, paired outcomes, or larger tables, and sparse expected counts can make the asymptotic chi-square reference unreliable.
The statistic sums O i j minus E i j squared divided by E i j over the four cells. Squaring removes direction, and dividing by E scales each discrepancy relative to its expected size. For a 2 times 2 table, degrees of freedom equal 2 minus 1, times 2 minus 1, which equals 1. The p-value is the upper chi-square tail under independence and approximation conditions. It is not the probability that the variables are independent, nor does it show which cell caused the association without inspecting residual patterns. Cramér’s V here equals the square root of the quantity chi squared divided by N for the 2 times 2 table. It summarizes association magnitude on a zero-to-one scale, but context and base rates determine what counts as important. Use the test when each observational unit contributes to exactly one of two row categories and one of two column categories. The table entries must be counts of distinct observations, not rates or means. Read observed and expected tables together. Cells with the largest standardized discrepancies contribute most to chi squared, but raw differences alone can be misleading when expected counts vary. If p less than or equal to alpha, report evidence of association rather than saying one variable causes the other. If p greater than alpha, state that the table provides insufficient evidence of association; do not declare proven independence. Treat the expected-count warning as a limitation on the reference distribution. The calculator does not compute Fisher’s exact test, so a warning is not resolved by simply quoting more decimal places.
A study records independent participants in a 2 times 2 table, treatment group has 36 recovered and 14 not recovered; control has 25 recovered and 25 not recovered. The analysis plan tests independence at alpha equals 0.05. Label rows Treatment and Control, columns Recovered and Not recovered, and enter counts 36, 14, 25, and 25. The grand total is 100. Under independence, row totals are 50 and column totals are 61 and 39, producing expected counts 30.5, 19.5, 30.5, and 19.5. All exceed five. The calculator sums the four scaled discrepancies, obtains chi squared with df equals 1, and converts it to an upper-tail p-value. Cramér’s V provides a separate magnitude summary.
A small p-value would indicate that recovery status and group assignment are associated in this table. If assignment was randomized and follow-up unbiased, the design may support a treatment interpretation; the chi-square calculation alone does not. Report the actual recovery proportions and Cramér’s V alongside the test.
Try it free at Distri Scope dot com.
How to read the result
Read observed and expected tables together. Cells with the largest standardized discrepancies contribute most to χ², but raw differences alone can be misleading when expected counts vary.
If p≤α, report evidence of association rather than saying one variable causes the other. If p>α, state that the table provides insufficient evidence of association; do not declare proven independence.
Treat the expected-count warning as a limitation on the reference distribution. This chi-square module does not switch methods automatically; for a suitable 2×2 table, run the separate Fisher exact calculator rather than quoting more decimal places.
How to use the chi square independence test calculator
Label rows and columns so the table meaning remains visible, then enter four nonnegative whole-number counts. Every row and column must contain at least one observation, and the grand total must be positive.
Alpha sets the right-tail rejection rule. Unlike mean tests, there is no left- or two-tail selector because χ² is nonnegative and larger discrepancy from independence is more extreme.
Expected count Eij equals row total times column total divided by the grand total. It is computed under independence and should not be typed in place of the observed count.
Formula, hypotheses, and assumptions
Conditions to review
- Independence of observations
- Expected frequency ≥ 5 for each cell
- Variables are categorical
Calculator parameters
- Significance Level (α): default 0.05.
What the method is doing
The statistic sums (Oij−Eij)²/Eij over every cell. Squaring removes direction, and dividing by E scales each discrepancy relative to its expected size. Degrees of freedom equal (r−1)(c−1); for a 2×2 table that is 1.
The p-value is the upper chi-square tail under independence and approximation conditions. It is not the probability that the variables are independent, nor does it show which cell caused the association without inspecting residual patterns.
Cramér’s V equals sqrt(χ²/(N·min(r−1, c−1))), which reduces to sqrt(χ²/N) for a 2×2 table. It summarizes association magnitude on a zero-to-one scale, but context and base rates determine what counts as important.
Worked example: treatment group and recovery
A study records independent participants in a 2×2 table: treatment group has 36 recovered and 14 not recovered; control has 25 recovered and 25 not recovered. The analysis plan tests independence at α=0.05.
- 1Label rows Treatment and Control, columns Recovered and Not recovered, and enter counts 36, 14, 25, and 25. The grand total is 100.
- 2Under independence, row totals are 50 and column totals are 61 and 39, producing expected counts 30.5, 19.5, 30.5, and 19.5. All exceed five.
- 3The calculator sums the four scaled discrepancies, obtains χ² with df=1, and converts it to an upper-tail p-value. Cramér’s V provides a separate magnitude summary.
Interpretation
A small p-value would indicate that recovery status and group assignment are associated in this table. If assignment was randomized and follow-up unbiased, the design may support a treatment interpretation; the chi-square calculation alone does not. Report the actual recovery proportions and Cramér’s V alongside the test.
Common mistakes
- Duplicating one participant across cells violates independence and inflates the apparent sample size. The table counts observational units, not events that can repeat within a unit.
- A large χ² can result from a huge sample with a small practical association. Always inspect proportions and effect magnitude.
- Merging categories after seeing results or testing many table definitions changes the false-positive risk. Category rules should be substantively planned.
Limits and independent validation
This module handles tables up to 6×6 and uses the uncorrected Pearson chi-square statistic. Fisher’s exact test is available separately for 2×2 tables; continuity correction, residual diagnostics, stratification, and adjusted association estimates are not provided here.
Cramér’s V is not a risk ratio or odds ratio and has no direction. For decision making, domain-specific contrasts and uncertainty intervals may be more interpretable.
Before using the result
- Verify that counts are mutually exclusive, exhaustive for the analyzed sample, and independent. Check expected frequencies and explain any exclusions or category combinations.
- Recompute margins, expected counts, χ², df, p, and Cramér’s V independently. When expected counts are sparse, use an exact method rather than relying on this asymptotic result.
- Compare row percentages or column percentages using one clearly named denominator and preserve the original counts next to them. This makes the direction of association visible and prevents a large sample from turning a numerically small percentage gap into an overinterpreted finding. If allocation was not randomized, list plausible confounders before making a substantive claim.
Related modules and resources
Explore Other Hypothesis Tests
- One Sample Z-Test Calculator
- One Sample T-Test Calculator
- Two Sample Z-Test Calculator
- Two Sample T-Test Calculator
- Paired T-Test Calculator
- One-Way ANOVA Calculator
- Two-Way ANOVA with Replication
- Chi-Square Test Calculator
- Chi-Square Goodness-of-Fit Test
- F-Test Calculator
- One-Proportion Z-Test
- Two-Proportion Z-Test
- Exact Binomial Test
- Fisher’s Exact Test
- McNemar Test
- Mann-Whitney U Test
- Wilcoxon Signed-Rank Test
- Sign Test
- Kruskal-Wallis Test
- Friedman Test
- Pearson Correlation Test
- Spearman Correlation Test
- Kendall Tau Test
- Levene Test
- Brown-Forsythe Test
- Welch ANOVA
- Repeated Measures ANOVA
- TOST Equivalence Test
- Power & Sample Size
- Confidence Interval Calculator
- Critical Value Lookup
See every option in the Statistical Hypothesis Test Calculator or review the DistriScope methodology. Educational information; last reviewed 2026-08-09. Verify consequential calculations independently.