Statistics

Chi Square Calculator

Counts versus expectations, both classic trials: does a distribution fit (goodness of fit) and are two categorical variables associated (independence) — with the Cochran expected-count guard applied to YOUR table.

Chi Square Calculator

Results recalculate instantly on every keystroke. Nothing you type is transmitted.

Counts
Chi-square
—
Degrees of freedom—
p-value—
Cell by cell—
The reading—
The guardrails—

What this result does not account for

  • Approximation guardrails stated (Cochran); no exact/Fisher fallback implemented
  • Counts only — no paired or McNemar designs
● Zero-Server Execution Updated 11 Aug 2026 Reviewed by Sana Khalid IEEE-754 Double Precision

In short: A die rolled 60 times gives counts 8; 12; 9; 11; 13; 7 against an expected 10 each: chi-square = (4 + 4 + 1 + 1 + 9 + 9)/10 = 2.8 on df = 5, p = 0.730786 — nothing argues against fair. For association, a 2×3 table “12,15,9; 8,11,14” builds expected counts from the row-column margins (12 vs E 10.434783 in the first cell), sums to chi-square 2.376399 on df 2, p = 0.304770, with Cramér’s V = 0.185582 rating the association weak at best. Every cell’s contribution is printed, so you can see which category drove the verdict.

Formula

χ² = Σ(O − E)²/E · df = k − 1 (fit) · df = (r−1)(c−1) (independence) · V = √(χ²/(N·min))

E for independence comes from the margins: row total × column total / N. p comes from the incomplete gamma, computed — never tabulated.

Worked Example

  1. Pick the question: goodness of fit or independence.
  2. Enter counts — a list, or table rows ‘;’-joined.
  3. Optionally give expected counts (fit mode; blank = uniform).
  4. Read chi-square, p, every cell contribution, and the Cochran guardrail.

Fit: 8;12;9;11;13;7 vs 10 each — χ² = 2.8, df 5, p = 0.730786. Independence: 12,15,9; 8,11,14 — χ² = 2.376399, df 2, p = 0.304770, V = 0.185582.

Strengths & Limits Of This Model

Where this engine is strong

  • Both classic modes from one input grammar
  • Every cell contribution printed, not just the total

Where it stops

  • No Yates correction (deliberately — stated)
  • No residual drilling beyond per-cell contributions

Risk & accuracy notice. A chi-square verdict inherits your binning and your category choices. The page prices the counts you gave it — not the ones you might have chosen differently after seeing the data.

Practical Use Cases

Dice, RNG and allocation checks

does reality match the claimed shares?

Survey crosstabs

is choice associated with segment?

A/B bucket counts

categorical outcomes, two variables

Methodology & Editorial Standards

Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.

This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.

Sana Khalid Principal Front-End Engineer · ApexConverter

Statistical inference, experiment design and numerical stability. Last reviewed: 11 August 2026.

Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.


Chi Square Calculator — 8 Expert FAQs

8 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.

Why the expected-count guardrail at all?

Because chi-square is an APPROXIMATION that leans on each expected count being big enough for its discreteness to wash out. The Cochran working rule: no cell with E below 1, and no more than a fifth of the cells below 5. Break it and the p-value looks precise while the approximation under it has quietly failed.

Where do the expected counts come from?

In fit mode, from your claim — uniform if you say nothing, or your stated shares (scaled to the observed total). In independence mode, from the data’s own margins: row total times column total over N, which is exactly what no-association predicts.

What does Cramér’s V add?

A p-value only says whether association is surprising; V says how BIG it is, on a 0-to-1 scale. The default table scores V = 0.185582 — detectable in principle, negligible in practice. Significance without V is how tiny associations get sold as findings.

Why not Yates’ continuity correction for small 2×2 tables?

It overcorrects: modern guidance is that Yates pulls p-values toward conservatism hard enough to hide real effects. The honest small-sample route is an exact test, which this page does not implement — it says so and lets the Cochran guardrail steer you away from the regime instead.

Can I test continuous data with this?

Not directly — chi-square eats COUNTS. Continuous measurements belong to the t/ANOVA world; if you bin them first, the binning choices you made become part of the test, and different bins can flip the verdict.

What if a category got zero observations?

Zero OBSERVED is fine — it contributes (0−E)²/E. Zero EXPECTED is fatal: the formula divides by it. The page refuses that case by name and asks you to drop the impossible category or gather data.

Fit mode and independence mode — same formula, different questions?

Exactly. Fit asks whether ONE list disagrees with a claimed distribution (df = categories − 1). Independence asks whether TWO categorical variables move together in a table (df = (rows−1)(cols−1)). The arithmetic of (O−E)²/E is shared; the null hypotheses are different claims entirely.

How large should my total count be?

There is no single floor — the working rule lives at the cell level: every expected count ≥ 1, at most a fifth below 5. Twenty observations can pass in a 2×2 with balanced cells; five hundred can fail in a sparse table. The guard card counts YOUR cells.

Related Statistics Engines