Chi-Square Explainer
Is there a relationship between two categories, like which signup page people saw and which plan they picked? The chi-square test compares your counts to what you'd expect if there were no relationship at all. Edit the example table below and watch every number update.
Hover (or tap) any part of the chart or the numbers below it to see where it comes from.
The rows and columns are related: a mismatch this big would happen by luck less than 5% of the time.
- The curve shows the χ² values luck alone produces when rows and columns are unrelated.
- The shaded right tail is the "too unlikely to be luck" zone. Only big χ² values count as evidence, so the test is one-sided.
- The pink line is your χ². The p-value is the area of the curve to its right.
- Drag "scale every count": same percentages, more people. χ² grows with sample size, which is why huge samples make tiny differences "significant". Cramér's V stays put.
Your data
Counts of people in each combination. Rename the rows and columns, change any count, or add up to 6 rows and columns. The scale slider above rewrites these counts, and typing here resets it.
Comparing just two success rates? The P-Value Explainer walks through that case.
How each row splits
If there were no relationship, every row would look like the "All rows" bar. The more the rows differ from it, the bigger χ² gets.
Observed vs expected
What you counted next to what "no relationship" predicts, and how much each cell adds to χ².
| Free | Pro | Team | Row total | |
|---|---|---|---|---|
| Page A | 120 / 103.3 exp +2.69 to χ² | 45 / 51.7 exp +0.86 to χ² | 15 / 25.0 exp +4.00 to χ² | 180 |
| Page B | 100 / 103.3 exp +0.11 to χ² | 60 / 51.7 exp +1.34 to χ² | 20 / 25.0 exp +1.00 to χ² | 180 |
| Page C | 90 / 103.3 exp +1.72 to χ² | 50 / 51.7 exp +0.05 to χ² | 40 / 25.0 exp +9.00 to χ² | 180 |
| Column total | 310 | 155 | 75 | 540 |
Each cell shows observed / expected. Cyan = more than expected, pink = fewer. Darker cells add more to χ².
How the numbers are calculated
Six steps from raw counts to a verdict, using the numbers in your table right now.
- 1
Totals
Add up each row, each column, and everyone.
rows: Page A 180 · Page B 180 · Page C 180columns: Free 310 · Pro 155 · Team 75N = 540 - 2
Expected counts
If rows and columns had nothing to do with each other, every row would split the same way as the overall column totals. That "no relationship" world gives each cell an expected count.
Page A · Free: 180 × 310 ÷ 540 = 103.3Every expected count is in the observed vs expected table above.
- 3
Each cell's mismatch
For each cell, square the gap between observed and expected, then divide by expected. Dividing keeps a gap of 10 in a big cell from counting as much as a gap of 10 in a small one.
Page A · Free: (120 − 103.3)² ÷ 103.3 = 2.69The biggest contributor is Page C · Team at 9.00: that's where your data departs most from "no relationship".
- 4
χ² and degrees of freedom
Add up every cell's mismatch to get χ².
χ² = 2.69 + 0.86 + 4.00 + 0.11 + 1.34 + 1.00 + 1.72 + 0.05 + 9.00 = 20.77Degrees of freedom count how many cells could change once the totals are locked in. They set which curve to compare against.
df = (3 − 1) × (3 − 1) = 4 - 5
p-value
The area of the df = 4 chi-square curve to the right of your χ². The cutoff for α = 0.05 is 9.49, so any χ² above that is significant.
p = P(χ² ≥ 20.77) < 0.001< 0.001 is below α = 0.05, so the relationship is statistically significant.
- 6
Effect size (Cramér's V)
χ² grows with sample size, so it can't tell you how strong the relationship is. Cramér's V can: 0 means none, 1 means perfectly linked. Roughly 0.1 is small, 0.3 medium, 0.5 large.
V = √( 20.77 ÷ (540 × 2) ) = 0.14