Chi-Square Calculator
Goodness of fit, with the expected-count rule checked.
Work out Chi-Square. Goodness of fit, with the expected-count rule checked. Says what the result does not mean.
Comma separated, in the same order as the expected counts.
Chi-square statistic
2
p = 0.1573 · 1 degrees of freedom
χ² = Σ (observed − expected)² / expected, summed across categories. It measures how far a set of counts strays from what a hypothesis predicts. Degrees of freedom for a goodness-of-fit test is the number of categories minus one, because once all but one category is known the last is determined by the total.
How the Chi-Square Calculator works
Enter observed and expected counts for the chi-square statistic, degrees of freedom and p value. The page warns when any expected count falls below 5, which is the point at which the approximation stops being reliable.
Also known as: chi square test calculator · goodness of fit calculator · chi square p value calculator · observed vs expected calculator
Frequently asked questions
What is the chi-square statistic?
Σ (observed − expected)² / expected, summed across categories. It measures how far a set of counts strays from what a hypothesis predicts, weighting each category by how much was expected there.
Why must expected counts be at least 5?
Because chi-square approximates a discrete distribution with a continuous one, and that approximation degrades badly with small counts. Below 5 the p value is unreliable and Fisher's exact test is the better choice.
How many degrees of freedom?
Categories minus one for a goodness-of-fit test. Once all but one category is known the last is fixed by the total, so only k−1 are free.
Can chi-square use percentages?
No — it needs actual counts. Feeding it percentages makes the statistic depend on your choice of scale rather than on the evidence, and 60/40 from 10 observations is treated identically to 60/40 from 10,000.
Put this calculator on your own site
Free to use, on any site, commercial or not. Paste this where you want it to appear. It is a plain iframe, so it works in WordPress, Squarespace, Wix, Webflow, Ghost and anything else that accepts HTML.
<iframe src="https://www.thecalclibrary.com/embed/chi-square-calculator" width="100%" height="640" style="border:1px solid #e2e8f0;border-radius:12px" loading="lazy" title="Chi-Square Calculator"></iframe>
<p style="font:13px/1.5 system-ui,sans-serif;margin:6px 0 0;color:#64748b">Powered by <a href="https://www.thecalclibrary.com/chi-square-calculator" style="color:#64748b">Chi-Square Calculator</a> from The Calc Library</p>The only condition is that the credit line below the frame stays in place. That one line is what pays for the tool being free — it is how anyone else finds it.