Code tool

Chi-Square Test Calculator

Statistical arithmetic aid: χ² = Σ(O−E)²/E. Goodness of fit uses matching observed and expected categories with df = k−1−p, where p is the number of parameters fitted from these counts; use p=0 only for fully specified expected proportions. 2×2 independence derives E from row and column totals and uses df=1, without Yates correction. This tool does not verify the model or sampling assumptions and provides no p-value, significance conclusion or causal judgment.

In-browser processingNo account requiredPrivacy details ↗

Statistical arithmetic aid: χ² = Σ(O−E)²/E. Goodness of fit uses matching observed and expected categories with df = k−1−p, where p is the number of parameters fitted from these counts; use p=0 only for fully specified expected proportions. 2×2 independence derives E from row and column totals and uses df=1, without Yates correction. This tool does not verify the model or sampling assumptions and provides no p-value, significance conclusion or causal judgment.

Separate numbers with commas, semicolons, spaces or newlines. All expected counts must be positive; no category is dropped. Results use six significant digits. Input remains in your browser.

Enter matching observed and expected category lists.

A QUICK WALKTHROUGH

How to use this tool

  1. Choose goodness of fit or 2×2 independence.
  2. Enter matching counts and fitted parameters, or the four table cells.
  3. Read χ², degrees of freedom and the per-cell contributions.

Chi-Square Test Calculator

Statistical arithmetic aid: χ² = Σ(O−E)²/E. Goodness of fit uses matching observed and expected categories with df = k−1−p, where p is the number of parameters fitted from these counts; use p=0 only for fully specified expected proportions. 2×2 independence derives E from row and column totals and uses df=1, without Yates correction. This tool does not verify the model or sampling assumptions and provides no p-value, significance conclusion or causal judgment.

Contribution (O−E)²/E

Separate numbers with commas, semicolons, spaces or newlines. All expected counts must be positive; no category is dropped. Results use six significant digits. Input remains in your browser.

2×2 independence

Enter four nonnegative integer counts. Every row and column total must be positive. E = row total × column total / N; df = 1. Pearson statistic without Yates correction. Some expected counts are below 5; the chi-square approximation may be unreliable.

GOOD TO KNOW

Common questions

Does it calculate a p-value?

No. It reports χ², degrees of freedom and contributions; it does not verify assumptions or give significance or causal conclusions.