Enter your contingency table counts, test whether two categorical variables are associated, and get χ², degrees of freedom, p-value, and Cramér's V — all in your browser.
Fill in your contingency table and press Calculate to run the chi-square test.
Watch: Chi-Square Tests and Non-Parametric Methods
A supervisor suspects the type of defect depends on which shift made the part. Enter the lab to see whether the counts back that up — or whether shift and defect are unrelated.
Set the number of rows and columns, then type the count in each cell of your table. Row and column totals are calculated automatically.
For each cell, the calculator works out what you'd expect to see if the categories were completely unrelated — using just the row and column totals.
It compares what you actually got to what was expected. The bigger the gap, the stronger the evidence of a real link. The result tells you whether the categories are genuinely connected, and how strong that connection is.
Use the calculator above to test whether two categorical variables are related. The chi-square test of independence is one of the most widely used statistical tests in quality and operations — it tells you whether the pattern you see in your data is likely to be genuine or just random chance.
The chi-square test of independence asks: could the pattern in this contingency table have arisen by chance if the two variables were unrelated? You compare observed cell counts to expected counts — the counts you would see if the variables were independent. A large χ² means the observed pattern is far from what chance predicts, giving a small p-value and evidence of a real association.
The test first works out the counts you would expect in each cell if the two categories had no connection at all, based purely on the row and column totals. It then compares those expected counts with the counts you actually observed. The bigger the gaps between observed and expected, the larger the chi-square statistic and the smaller the p-value. A p-value below 0.05 says the two categories really are linked. Cramér's V then rates how strong that link is on a simple 0-to-1 scale.
A quality team wonders if the type of defect (scratch, dent, or misalignment) varies by shift. They count defects across three shifts over a month and build a simple table of counts.
The Chi-Square test gives p = 0.03. Because that's below 0.05, there is a real link — defect type is not the same across all shifts.
What to do with this: Dig into which shift has the unusual pattern. Maybe the afternoon shift rushes the final 30 minutes, causing more scratches. Now you know where to focus.
The chi-square test turns a table of counts into a statistical decision. Instead of eyeballing percentages and debating whether a difference is "real", you get an objective p-value and effect size. This prevents both over-reacting to noise and ignoring genuine patterns in your categorical data.
Use the chi-square test when both variables are categorical (e.g. shift vs defect type, supplier vs product grade, department vs complaint category). It is ideal in the Analyse phase of DMAIC to test whether a suspected categorical X is truly associated with Y, before investing in a corrective action.
Chi-square is the standard hypothesis test for categorical data in Six Sigma. It sits alongside t-tests (for means) and F-tests (for variances) in the Analyse phase toolkit. A significant result identifies a candidate root cause; a follow-up Pareto or fishbone analysis then focuses the improvement work.
If χ² is significant, examine which cells contributed most to the statistic — the cells with the largest (O−E)²/E are where the categories diverge most. Build a Pareto chart or bar chart to visualise the pattern, then investigate the operational reason behind the cells that stand out. If the result is not significant, the variables may genuinely be independent — or your sample may be too small to detect a real effect.
Combine the chi-square test with Pareto analysis, fishbone diagrams, and a DMAIC structure for a complete categorical data investigation.
A chi-square test of independence tests whether two categorical variables are related or independent. You collect counts of observations that fall into combinations of categories (a contingency table), then compare the observed counts to what you would expect if the variables had no relationship. A low p-value (below your chosen significance level, typically 0.05) means the association is statistically significant.
Observed counts are the actual counts you measured. Expected counts are the counts you would get if the two variables were completely independent — calculated as (row total × column total) divided by the grand total for each cell. The chi-square statistic measures how far the observed counts are from the expected counts; a large departure gives a large χ² and a small p-value.
The chi-square distribution approximation works well when expected cell counts are 5 or more. If any expected count is below 5, the approximation can be unreliable and you may get a misleading p-value. In that situation, consider combining categories to increase counts, collecting more data, or using Fisher's exact test (which works for any sample size but is limited to 2×2 tables).
Cramér's V is an effect size measure for chi-square tests, ranging from 0 (no association) to 1 (perfect association). It tells you how strong the relationship is, independent of sample size. As a rough guide: V below 0.10 is negligible, 0.10–0.20 is weak, 0.20–0.40 is moderate, and above 0.40 is strong. A statistically significant chi-square result does not guarantee a practically meaningful association — always check Cramér's V alongside the p-value.
A significant chi-square result is the start, not the end. Structured improvement training shows you how to translate a statistical finding into a root cause and a lasting fix.
Explore more practical calculators for quality, statistics, and improvement.
Want to master hypothesis testing with categorical data inside a structured improvement project? The Black Belt course covers advanced statistics, hypothesis testing, and the full analytical toolkit.
View Black Belt →