Skip to content
LoveToCalc

Definition — what does that mean?

Chi-square statistic

One number for how far a set of observed counts lies from the counts you expected — the heart of the chi-square test.

In Swedish: Chi-två-värde

Chi-square statistic

The relation

χ²=Σ(Oi−Ei)²Ei

How far a set of observed counts sits from what a hypothesis predicted: for each category, the squared difference between observed and expected, divided by expected, added up.

Separate the numbers with spaces, commas or semicolons, for example 2.5, 4, 7

Separate the numbers with spaces, commas or semicolons, for example 2.5, 4, 7

χ²=2.8

χ² equals ((8 minus 10) squared divided by 10) plus ((12 minus 10) squared divided by 10) plus ((9 minus 10) squared divided by 10) plus ((11 minus 10) squared divided by 10) plus ((7 minus 10) squared divided by 10) plus ((13 minus 10) squared divided by 10), equals ((−2) squared divided by 10) plus (2 squared divided by 10) plus ((−1) squared divided by 10) plus (1 squared divided by 10) plus ((−3) squared divided by 10) plus (3 squared divided by 10), equals (4 divided by 10) plus (4 divided by 10) plus (1 divided by 10) plus (1 divided by 10) plus (9 divided by 10) plus (9 divided by 10), equals 0.4 plus 0.4 plus 0.1 plus 0.1 plus 0.9 plus 0.9, equals 2.8

Working5 steps

The formula

χ² = Σ (O − E)² / E

For each category, O is the observed count and E the expected one. Square the difference, divide by the expected count, and add up over all categories.

A die thrown 60 times gives 8, 12, 9, 11, 7 and 13; a fair die should give 10 of each: χ² = (4 + 4 + 1 + 1 + 9 + 9) / 10 = 2.8.

The calculator takes the two lists and pairs them up.

Reading the answer

Compare χ² with the chi-square table at the right degrees of freedom — for a single list of categories, the number of categories minus one.

The die has six faces, so 5 degrees of freedom; at the 5% level the critical value is 11.07. 2.8 is far below it: the throws are well within what a fair die produces.

A second example. A shop expects its three sizes to sell 40, 40 and 20 of every hundred; it sells 50, 30 and 20. χ² = 100 / 40 + 100 / 40 + 0 = 5. With 2 degrees of freedom the critical value is 5.991, so even this lopsided-looking result does not prove the expectation wrong at the 5% level.

Why divide by E

A difference of 5 means a lot when 10 were expected and almost nothing when 1,000 were. Dividing by E scales each square to the size of its category, which is also what makes the sum approximately follow the chi-square distribution.

Common mistakes

Questions people ask

Can χ² be negative? No. Every term is a square divided by a positive number, so the sum is 0 at best — a perfect match.

Does the same formula work for a contingency table? Yes. Each cell’s expected count is its row total times its column total divided by the grand total; then the sum runs over every cell.

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
χ²Σ(Oi−Ei)²Ei(8−10)²10+(12−10)²10+(9−10)²10+(11−10)²10+(7−10)²10+(13−10)²102.8

Chi-square table

Table

Chi-square table
df0.10.050.0250.010.005
12.7063.8415.0246.6357.879
24.6055.9917.3789.21010.597
36.2517.8159.34811.34512.838
47.7799.48811.14313.27714.860
59.23611.07012.83315.08616.750
610.64512.59214.44916.81218.548
712.01714.06716.01318.47520.278
813.36215.50717.53520.09021.955
914.68416.91919.02321.66623.589
1015.98718.30720.48323.20925.188
1117.27519.67521.92024.72526.757
1218.54921.02623.33726.21728.300
1319.81222.36224.73627.68829.819
1421.06423.68526.11929.14131.319
1522.30724.99627.48830.57832.801
1623.54226.29628.84532.00034.267
1724.76927.58730.19133.40935.718
1825.98928.86931.52634.80537.156
1927.20430.14432.85236.19138.582
2028.41231.41034.17037.56639.997
2129.61532.67135.47938.93241.401
2230.81333.92436.78140.28942.796
2332.00735.17238.07641.63844.181
2433.19636.41539.36442.98045.559
2534.38237.65240.64644.31446.928
2635.56338.88541.92345.64248.290
2736.74140.11343.19546.96349.645
2837.91641.33744.46148.27850.993
2939.08742.55745.72249.58852.336
3040.25643.77346.97950.89253.672
4051.80555.75859.34263.69166.766
5063.16767.50571.42076.15479.490
6074.39779.08283.29888.37991.952
8096.578101.879106.629112.329116.321
100118.498124.342129.561135.807140.169

Last reviewed October 6, 2026 ·How pages are reviewed

Statistics and probabilityAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.