Chi-Square Calculator

Chi-square goodness-of-fit statistic.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

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

1
Step 1
Enter the observed counts, separated by commas.
2
Step 2
Enter the expected counts in the same order.
3
Step 3
Press Calculate.

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?
2.66667 with 2 degrees of freedom.
What is χ² for observed 18, 22, 20, 40 and expected 25 each?
12.32 with 3 degrees of freedom.
What happens if the lists are different lengths?
The tool asks for matching observed and expected lists.

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 YouTube
  • Finding mean, median, and mode

    Khan Academy

    Core descriptive stats for mean/median/mode tools.

    Watch on YouTube