Chi-Square Test Calculator

The chi-square test compares observed frequencies to expected frequencies across categories to determine whether an observed distribution is significantly different from what you expected. Enter observed and expected counts (comma-separated, same number of values) for each category. The calculator computes the chi-square statistic, degrees of freedom, and a reference critical value at the 5% significance level. You can then compare your statistic to the critical value or use a chi-square table for your exact degrees of freedom.

0.00
0.00
0.00

Chi-square formula

χ² = ∑ (O - E)² / E

Where O is the observed count in each cell/category and E is the expected count. Degrees of freedom for a goodness-of-fit test = number of categories minus 1. The statistic follows a chi-square distribution under the null hypothesis of no difference.

Interpreting the result

  • If the chi-square statistic exceeds the critical value at your chosen alpha level and degrees of freedom, reject the null hypothesis (the observed distribution differs significantly from expected).
  • A larger chi-square value indicates greater disagreement between observed and expected frequencies.
  • This calculator provides the critical value at alpha = 0.05. For other significance levels, consult a chi-square distribution table.
  • The chi-square test is one-tailed (we only care about values being too large, not too small).

Frequently asked questions

What is the chi-square test?

The chi-square (chi-squared) test is a statistical test used to determine whether observed frequencies in data differ significantly from expected frequencies. It is commonly used for goodness-of-fit tests (does data follow a specified distribution?) and tests of independence (are two categorical variables related?).

What is the formula for the chi-square statistic?

Chi-squared = sum of (O minus E) squared divided by E, where O is the observed frequency in each category and E is the expected frequency. Summing over all categories gives the test statistic. Larger values indicate greater discrepancy between observed and expected.

What are degrees of freedom?

For a goodness-of-fit test, degrees of freedom equal the number of categories minus 1 (minus additional estimated parameters). For a test of independence in a two-way table with r rows and c columns, df = (r-1)(c-1).

What critical value do I compare against?

Compare the chi-square statistic to the critical value from the chi-square distribution at your chosen significance level (usually 0.05) and your degrees of freedom. For example, at alpha = 0.05 and df = 3, the critical value is 7.815. If chi-squared exceeds this, the result is significant.

What are the assumptions of the chi-square test?

The chi-square test requires: observations are independent; each cell's expected frequency is at least 5 (commonly recommended); and data are counts, not proportions or percentages. When expected frequencies are small, use Fisher's exact test instead.

Official sources

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