Chi-Square Calculator

Calculate chi-square statistic and p-value. Free online chi-square test calculator.

The Chi-Square Calculator computes the chi-square statistic for goodness-of-fit and independence tests. Enter observed and expected frequencies to find the χ² value and p-value. This test assesses whether observed data significantly differs from expected values, essential for categorical data analysis.

Chi-Square Calculator

Formula: χ² = Σ (O − E)² ÷ E

Worked example

Observed counts (O)
50, 30, 20
Expected counts (E) — leave blank for equal expected counts
40, 40, 20
χ² statistic
5
Degrees of freedom2
p-value0.082085
Significant at α = 0.05?No — fail to reject the null hypothesis
Critical value at α = 0.055.9915
Step by step
  1. (50 − 40)² ÷ 40 = 2.5
  2. (30 − 40)² ÷ 40 = 2.5
  3. (20 − 20)² ÷ 20 = 0
  4. χ² = 2.5 + 2.5 + 0 = 5

Replace these values in the calculator above to compute your own numbers.

Common use cases

  • Testing categorical independence
  • Goodness-of-fit testing
  • Survey response analysis
  • Genetics ratio testing
  • Quality control inspection

How to use

  1. Enter observed frequencies
  2. Enter expected frequencies
  3. Click calculate for χ² statistic
  4. View degrees of freedom and p-value
  5. Interpret statistical significance

FAQ

What is chi-square?

χ² = Σ(O-E)²/E, summing squared differences between observed (O) and expected (E), divided by expected.

What are degrees of freedom?

For goodness-of-fit: k-1 (k categories). For independence: (rows-1)×(columns-1).

How do I interpret p-value?

If p < α (typically 0.05), reject null hypothesis—observed differs significantly from expected.

What are the requirements?

Expected frequencies should generally be ≥ 5. Use exact tests for smaller samples.