Free statistics calculators
Ad

Chi-Square Test Calculator

Enter observed and expected frequencies to calculate chi-square and p-value.

Chi-square statistic —
Degrees of freedom —
P-value —
Significant at α = 0.05? —
χ² = Σ (Oᵢ − Eᵢ)² / Eᵢ. Degrees of freedom = number of categories − 1.

Get your results + weekly data tips

One email per week. Tips, tool deals, new calculators. Unsubscribe anytime.

Free tools, useful tips. We recommend products we'd actually use.

Ad

How the Chi-Square Test Works

The chi-square goodness-of-fit test compares observed frequencies to expected frequencies. A large chi-square value means the observed data differs significantly from what was expected.

Enter your observed counts and expected counts separated by commas. The calculator finds the chi-square statistic, degrees of freedom, and p-value.

The chi-square test checks whether observed frequencies differ from expected frequencies by more than chance. The test statistic χ² = Σ(O − E)² / E, summed across all cells in your contingency table. A larger χ² means a larger discrepancy between observed and expected.

Example: a die is rolled 60 times. You observe: 1→8, 2→12, 3→9, 4→11, 5→10, 6→10. Expected each face 10 times. χ² = (8−10)²/10 + (12−10)²/10 + (9−10)²/10 + (11−10)²/10 + (10−10)²/10 + (10−10)²/10 = 0.4 + 0.4 + 0.1 + 0.1 + 0 + 0 = 1.0. With df = 6−1 = 5, p ≈ 0.96. No evidence the die is unfair.

Degrees of freedom (df) for a goodness-of-fit test = number of categories − 1. For a 2×2 contingency table, df = (rows−1)(columns−1) = 1. The critical value at α=0.05 with df=5 is 11.07 — you need χ² > 11.07 to reject the null.

Rule of thumb: each cell should have an expected frequency of at least 5. If cells have smaller expected counts, consider combining categories or using Fisher's exact test instead.

See also: P-Value Calculator · Sample Size Calculator