Chi-Square Calculator
Chi-square goodness-of-fit statistic.
About this tool
Enter observed and expected counts to get the chi-square statistic and its degrees of freedom. Observed 18, 22, 20, 40 against an even 25 each gives χ² = 12.32 with 3 degrees of freedom.
How to use
How it works
Each category contributes (O − E)² ÷ E. In the example: 1.96 + 0.36 + 1 + 9 = 12.32. Degrees of freedom are the number of categories minus 1, here 3. Compare χ² with a table: the 5% critical value at 3 df is 7.815, so 12.32 is significant.
χ² = Σ (O − E)² ÷ E df = categories − 1
Worked example
A fair die test
- Input
- observed 16,18,16,14,12,12; expected 14.6667 each
- Output
- χ² = 2, df = 5
- Walkthrough
- Each term is (O − 14.6667)² ÷ 14.6667. The six terms add to about 2.0, well below the 5% critical value of 11.07 at 5 df.
Limitations
- The two lists must be the same length with at least two categories; every expected count must be positive and observed counts cannot be negative.
- Returns the statistic and df only; look up the p-value in a table.
- Counts, not percentages: the test needs raw frequencies.
Questions
What is χ² for observed 10, 20, 30 and expected 15, 20, 25?
What is χ² for observed 18, 22, 20, 40 and expected 25 each?
What happens if the lists are different lengths?
Features
- Statistic and df
- Any number of categories
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Derivative as a concept
Khan Academy
Calculus entry point for derivative-related tools.
Watch on YouTubeFinding mean, median, and mode
Khan Academy
Core descriptive stats for mean/median/mode tools.
Watch on YouTube
- Standard Normal Distribution
Math is Fun
Z-score background for normal-distribution calculators.
- OpenStax Math
OpenStax
Free textbooks for algebra through calculus.