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.
Use the Chi-Square Goodness of Fit
Category Frequencies
Label
Observed
Expected
Enter frequencies and click Run Test to see results.
Chi-Square (χ²)
—
Degrees of Freedom
—
P-Value
—
Category Breakdown
Summary
The chi-square goodness of fit test checks whether a set of observed categorical frequencies matches a hypothesized distribution. You supply the observed count for each category and either raw expected counts or proportions, and the tool calculates the chi-square statistic and the corresponding p-value. A small p-value (typically below 0.05) indicates the data do not follow the expected distribution.
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-13 · Reviewed by Nham Vu