Statistics

Chi-Square Calculator

Calculate the chi-square goodness-of-fit statistic.


Chi-Square Calculator

Advertisement

Calculates the chi-square statistic, comparing observed category counts against what you’d expect if a hypothesis were true.

How it works

For each category, the squared difference between observed and expected counts is divided by the expected count, and all categories are summed.

What this does not include

This reports the chi-square statistic itself — converting it to a p-value additionally requires the degrees of freedom and a critical-value table, which varies by how many categories are being compared.

How to use this calculator

  1. Enter the observed and expected count for each category.

A worked example

Three categories: observed 50/30/20 against expected 45/35/20 → chi-square = 1.2698.

Two categories that match their expected counts exactly (10 observed, 10 expected in both) → chi-square = 0, a perfect fit.

What the variables mean

Variable Meaning
Observed count What actually happened in each category
Expected count What the hypothesis predicted for that category

Edge cases worth knowing

An expected count of zero breaks the formula. Dividing by zero has no defined result, so a category with zero expected count makes the whole calculation invalid — the calculator returns no result rather than an infinite value.

A larger chi-square value means a bigger mismatch between observed and expected — turning that number into a formal conclusion (a p-value) additionally requires the degrees of freedom and a critical-value table, which this calculator doesn’t compute.

Frequently asked questions

What does a chi-square value of 0 mean?

A perfect fit — every observed count exactly matches its expected count.

Why square the differences?

Squaring makes every difference positive (so over- and under-counts don’t cancel out) and weights larger discrepancies more heavily than small ones.

What’s a common use for the chi-square test?

Testing whether observed survey or experimental results match an expected distribution, such as checking if a die is fair.

Be the first to rate this

Written by

J. Adeyemi

Statistics writer

J. Adeyemi writes the statistics and probability calculators, from descriptive summaries through to distributions and conditional probability. The recurring theme is scope: each page states precisely which question it answers, because most statistical mistakes come from applying a correct formula to the wrong question. Related-but-different measures get separate pages rather than being quietly merged.

Reviewed by

K. Novak

Calculator reviewer — statistics

K. Novak reviews the statistics and probability calculators, checking formula correctness and the scope boundary each page draws around itself. Closely related measures are routinely confused with one another, so review confirms that a page computing one of them says clearly that it is not computing the others.

How we write and review

Related calculators