Chi-Square Calculator

The chi-square calculator performs a goodness-of-fit test by comparing observed frequencies to expected frequencies. The formula is chi^2 = Sum((O-E)^2/E). Enter observed frequencies (comma-separated) and expected frequencies (comma-separated). The calculator computes the chi-square statistic, degrees of freedom, and an approximate p-value. A p-value less than 0.05 typically indicates the observed frequencies differ significantly from the expected frequencies.

e.g., 90,95,110,105,100,100
e.g., 100,100,100,100,100,100
3.50
5
0.6200

Formula

chi² = Sum((O - E)² / E)
df = number of categories - 1

Contingency table

Chi-square calculator: frequently asked questions

What is a chi-square test?

A chi-square test compares observed frequencies to expected frequencies to determine if they differ significantly. The formula is chi^2 = Sum((O-E)^2/E), where O is observed frequency and E is expected frequency.

What does the chi-square statistic tell me?

A larger chi-square statistic indicates a bigger difference between observed and expected frequencies. A small chi-square suggests the data fits the expected distribution well. You compare it to a critical value or p-value to test significance.

What are degrees of freedom in chi-square?

Degrees of freedom = number of categories - 1. For a goodness-of-fit test, df = k - 1, where k is the number of categories. You need this to find the p-value.

When is chi-square used?

Chi-square is used to test if observed categorical data fit a hypothesized distribution (goodness-of-fit test), or to test if two categorical variables are independent (test of independence).

What are expected frequencies?

Expected frequencies are what you would expect if the null hypothesis is true. For example, rolling a fair die 600 times should give 100 of each outcome. These are calculated based on your hypothesis.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 14 June 2026. See our methodology.