WorkedMathGlossary

Chi-Square Calculator

Enter your observed and expected values below to instantly get the chi-square statistic.

The Chi-Square Formula

χ² = Σ (O − E)² / E. For each category, subtract expected from observed, square it, divide by expected, then add up every category's contribution.

Worked example

Observed: 10, 20, 30, 40. Expected: 20, 20, 20, 20.

(10−20)²/20 + (20−20)²/20 + (30−20)²/20 + (40−20)²/20 = 5 + 0 + 5 + 20 = 30

χ² = 30

Frequently Asked Questions

What is a chi-square goodness-of-fit test?

It tests whether observed data matches an expected distribution. A large chi-square statistic means the observed values are far from what was expected; a small one means they're close.

What is the chi-square formula?

χ² = Σ (O − E)² / E, summed over every category, where O is the observed count and E is the expected count.

What do you do with the chi-square statistic once you have it?

Compare it to a critical value from a chi-square distribution table, based on your degrees of freedom (number of categories minus 1) and chosen significance level. If your statistic exceeds the critical value, the difference between observed and expected is considered statistically significant.

Related Calculators

View all calculators →

Related Terms