Calculates the chi-square statistic, comparing observed category counts against what you’d expect if a hypothesis were true.
How it works
For each category, the squared difference between observed and expected counts is divided by the expected count, and all categories are summed.
What this does not include
This reports the chi-square statistic itself — converting it to a p-value additionally requires the degrees of freedom and a critical-value table, which varies by how many categories are being compared.
How to use this calculator
- Enter the observed and expected count for each category.
A worked example
Three categories: observed 50/30/20 against expected 45/35/20 → chi-square = 1.2698.
Two categories that match their expected counts exactly (10 observed, 10 expected in both) → chi-square = 0, a perfect fit.
What the variables mean
| Variable | Meaning |
|---|---|
| Observed count | What actually happened in each category |
| Expected count | What the hypothesis predicted for that category |
Edge cases worth knowing
An expected count of zero breaks the formula. Dividing by zero has no defined result, so a category with zero expected count makes the whole calculation invalid — the calculator returns no result rather than an infinite value.
A larger chi-square value means a bigger mismatch between observed and expected — turning that number into a formal conclusion (a p-value) additionally requires the degrees of freedom and a critical-value table, which this calculator doesn’t compute.
Frequently asked questions
What does a chi-square value of 0 mean?
A perfect fit — every observed count exactly matches its expected count.
Why square the differences?
Squaring makes every difference positive (so over- and under-counts don’t cancel out) and weights larger discrepancies more heavily than small ones.
What’s a common use for the chi-square test?
Testing whether observed survey or experimental results match an expected distribution, such as checking if a die is fair.