chi test calculator

Enter at least two categories.
If left blank, the calculator assumes equal expected counts across categories.

What this chi test calculator does

This chi test calculator performs a chi-square goodness-of-fit test. It compares your observed counts against expected counts and tells you whether the difference is likely due to random chance.

In plain English: if your observed pattern is very different from what you expected, the chi-square statistic gets large, the p-value gets small, and you may reject your null hypothesis.

How to use the calculator

  • Step 1: Enter observed category counts.
  • Step 2: Enter expected counts (or leave blank for equal distribution).
  • Step 3: Set your significance level (commonly 0.05).
  • Step 4: Click Calculate Chi-Square.

The output includes: chi-square statistic, degrees of freedom, p-value, sample size, effect size (Cohen’s w), and a decision statement based on your alpha level.

How the chi-square statistic is calculated

The test statistic is:

χ² = ∑ (Oi - Ei)² / Ei

where Oi is observed count and Ei is expected count for category i. Degrees of freedom are k - 1, where k is the number of categories.

Interpreting your results

p-value

The p-value tells you how surprising your data would be if the null hypothesis were true. Smaller p-values indicate stronger evidence against the null.

Decision rule

  • If p < α: reject the null hypothesis.
  • If p ≥ α: fail to reject the null hypothesis.

Effect size

Cohen’s w gives practical magnitude: around 0.10 (small), 0.30 (medium), 0.50 (large), though context matters.

Assumptions and best practices

  • Data are counts (not percentages as final input values).
  • Categories are mutually exclusive.
  • Observations are independent.
  • Expected cell counts should generally be at least 5.

If expected counts are very small in several categories, consider combining categories or using an exact method.

Quick example

Suppose a four-outcome process should be equally likely, and you observe: 18, 22, 20, and 40. If expected counts are 25 each, this calculator will show a large chi-square value and a small p-value, suggesting the outcomes are not equally distributed.

FAQ

Can I enter expected proportions instead of counts?

Yes. If your expected numbers don’t sum to the observed total, this calculator rescales them proportionally.

Does this page run in my browser only?

Yes. All calculations run client-side with JavaScript in this single page.

Is this calculator for a contingency table test of independence?

No. This version is for the one-sample goodness-of-fit chi-square test.

🔗 Related Calculators