Chi-Square Goodness of Fit
Enter observed and expected category counts to compute the chi-square statistic, degrees of freedom, and p-value for a goodness-of-fit test.
Category Frequencies
Label
Observed
Expected
Enter frequencies and click Run Test to see results.
Chi-Square (χ²)
—
Degrees of Freedom
—
P-Value
—
Category Breakdown
Summary
Enter observed and expected category counts to compute the chi-square statistic, degrees of freedom, and p-value for a goodness-of-fit test.
How it works
- Choose the number of categories (2 to 10).
- Enter a label, the observed count, and the expected count or proportion for each category.
- Select whether your expected values are counts or proportions; the tool normalizes proportions to the grand total automatically.
- Click "Run Test" — the tool calculates the chi-square statistic as the sum of (observed - expected)^2 / expected across all categories.
- Degrees of freedom equal the number of categories minus 1 (minus any estimated parameters if applicable).
- The p-value is derived from the chi-square distribution; compare it to your chosen significance level.
Use cases
- Test whether a six-sided die is fair by comparing roll frequencies to a uniform distribution.
- Check whether customer complaint categories match historical proportions.
- Validate whether website traffic follows a predicted day-of-week pattern.
- Test whether genetic phenotype ratios fit a Mendelian 3:1 ratio.
- Evaluate whether survey response distributions match prior-year benchmarks.
- Determine if observed color preferences match a theorized distribution.
Frequently Asked Questions
Last updated: 2026-06-10 ·
Reviewed by Nham Vu