Statistics

Chi-Square Calculator

Assess how well observed counts agree with expected counts using the chi-square goodness-of-fit test.

chi-squaregoodness of fitcategorical
Chi-square Goodness of Fit

Enter observed counts and expected counts to test distribution fit.

Chi-square statistic
1.1111
Degrees of freedom
2
p-value
0.573753

Chi-square statistic

χ² = Σ (Oᵢ − Eᵢ)² / Eᵢ

The calculator also reports the degrees of freedom (categories − 1) and the corresponding right-tail p-value.

How to use

  1. Enter observed counts and matching expected counts.
  2. Ensure expected counts are positive and align with observed categories.
  3. Review χ², degrees of freedom, and the p-value.

Example

Input: Observed = 50,45,40; Expected = 45,45,45

Output: χ² ≈ 2.778, df = 2, p ≈ 0.249

FAQ & notes

Can I test contingency tables?

This calculator handles goodness-of-fit tests. For contingency tables, flatten the observed counts and compute expected frequencies first.

What if expected counts are zero?

Chi-square requires all expected counts to be positive. Combine categories or use Fisher’s exact test if counts are too small.