Statistics

Chi-Square Calculator

Run a chi-square (χ²) goodness-of-fit test or a chi-square test of independence for contingency tables. Get the χ² statistic, degrees of freedom, p-value, critical χ², expected counts, cell/category contributions, and effect size (Cohen’s w / Cramér’s V).

Goodness of Fit (k categories) Independence (r×c table) Critical χ² + p-value Residuals + Effect Size
Note: χ² tests assume independent observations and generally require sufficiently large expected counts (often “most ≥ 5”). If expected counts are small, consider combining categories or using exact alternatives when appropriate.

Run a Chi-Square Test

Choose a mode, enter observed counts (and expected proportions/counts if needed), then calculate. Chi-square tests are right-tailed, so the p-value is computed from the upper tail.

Category Observed (O) Expected proportion (pᵢ)
Goodness of fit compares observed counts to expected counts (often derived from expected proportions). The test statistic is χ² = Σ (O−E)²/E. Degrees of freedom are df = k − 1 − m (k categories, m parameters estimated from data).
The independence test checks whether two categorical variables are related. Enter observed counts in the r×c table. Expected counts are Eᵢⱼ = (row total × column total) / n. Degrees of freedom: df = (r−1)(c−1).
This section is handy when you already know df and you need a critical χ² threshold or a p-value for a given χ² statistic. Chi-square tests use the right tail: p = P(Χ² ≥ χ²_observed).
α (right-tail) Meaning Typical use
0.10Less strict thresholdExploratory screening
0.05Common defaultStandard hypothesis testing
0.01More strict thresholdHigh-stakes decisions / multiple testing caution