Chi-Square Calculator

Run a chi-square goodness-of-fit test on observed versus expected counts.

What the Chi-Square Calculator does

The chi-square goodness-of-fit test compares observed category counts against what a hypothesis predicts. Large discrepancies produce a large statistic and a small p-value, indicating the data does not fit the expected pattern.

Formula

  • χ² = Σ((Observed − Expected)² ÷ Expected)
  • Degrees of freedom = Number of categories − 1
  • Cramér's V = √(χ² ÷ (N × df))

Inputs explained

InputUnitRequiredNotes
Observed frequenciestextYesSeparate values with commas, spaces or new lines.
Expected frequenciestextOptionalLeave blank to assume all categories are equally likely.
Significance levelone of 3 optionsYes—

How to use it

  1. Choose Significance level.
  2. Enter Observed frequencies.
  3. Optionally add Expected frequencies.
  4. Select Calculate.

Worked example

Rolling a die 60 times and observing 8, 9, 12, 10, 11, 10.

Observed
8, 9, 12, 10, 11, 10
Expected
(blank — assumes 10 each)

χ² = 1.0 with 5 df, p ≈ 0.963 — entirely consistent with a fair die.

Reading the result

  • Cramér's V gives an effect-size figure independent of sample size — unlike the chi-square statistic, which grows with N for a fixed proportional discrepancy, V lets tests with different totals be compared on how strongly the pattern departs from expected.
  • The per-category (O−E)²/E column is where the FAQ's own advice plays out — the largest single contribution identifies which category drives a significant result.

Assumptions and limitations

  • Leaving "expected" blank assumes every category is equally likely — a real assumption being made silently, mentioned in the notes only after the fact rather than flagged before computing.

Common mistakes

  • Interpreting a significant chi-square result as identifying which category is the problem on its own — the FAQ says to check the per-category contributions instead.
  • Trusting the p-value at face value when one or more expected frequencies fall below 5 — the calculator still computes a result, but the notes flag it as unreliable in that case.

Frequently asked questions

What if expected frequencies are below 5?

The approximation becomes unreliable. Combine small categories, or use Fisher's exact test for small contingency tables.

Does a significant result tell me which category is wrong?

No. Check the per-category contributions in the table — the largest values show where the observed data departs most from expectation.

Related calculators