ToolPatch

One page. One job. Done.

← Back to all tools
Data & Statistics Statistical calculation

Chi-Square GOF Calculator

Calculate chi-square goodness-of-fit statistic from observed vs expected counts.

Data & Statistics

Chi-Square Goodness-of-Fit Calculator tests whether observed categorical counts match an expected distribution. Observed counts are the frequencies actually collected, while expected counts come from a theory, historical ratio, model, or stated probability distribution. The chi-square statistic sums the squared differences between observed and expected counts after scaling by expected counts, so larger discrepancies contribute more evidence against the model. Degrees of freedom depend on the number of categories and any estimated parameters. The p-value describes how unusual the observed mismatch would be if the expected distribution were correct. This test is useful for categorical model checks, but expected counts should generally be large enough and observations should be independent.

Permalink

Input guidance

Enter the values requested by the form.

How to use this tool

  1. Enter the values requested by the form.
  2. Run the tool and review the labelled output.
  3. Check assumptions, units, and edge cases before relying on the result.

Chi-Square GOF Inputs

Result

Chi-square: 2.000000

df: 3

Chi-Square Goodness-of-Fit Tests

Observed Versus Expected Counts

A chi-square goodness-of-fit test compares observed category counts with counts expected under a specified model. It asks whether the differences between observed and expected frequencies are larger than ordinary random variation would suggest.

Examples include testing whether a die appears fair, whether customer choices match a forecasted distribution, or whether defects are spread across categories as expected. The data are counts, not percentages or continuous measurements.

The Chi-Square Statistic

The test statistic sums squared differences between observed and expected counts, scaled by expected counts. Larger discrepancies contribute more, especially when they are large relative to expectation.

The statistic is compared with a chi-square distribution. Degrees of freedom generally equal the number of categories minus one, adjusted further if parameters were estimated from the data. The p-value indicates how unusual the observed mismatch would be if the expected model were true.

Expected Count Conditions

The chi-square approximation works best when expected counts are not too small. Very small expected counts can make the approximation unreliable because the continuous chi-square distribution is standing in for discrete count behavior.

A common rule of thumb is that expected counts should generally be at least 5 in most or all categories. When categories are sparse, combining categories or using exact methods may be more appropriate.

Interpreting Lack of Fit

A significant result says the observed distribution does not fit the expected distribution well, but it does not automatically explain why. Residuals by category help identify where the mismatch is largest.

Good interpretation returns to the model. Were the expected proportions justified? Were observations independent? Were categories complete and mutually exclusive? The test detects mismatch; domain knowledge explains it.

Formula or method

How to interpret the result

Review note and limitations

Related tools and workflows

Related statistics tools help check nearby samples, distributions, intervals, tests, or visual summaries in the same analysis. Start with ANOVA One Way Calculator, Bayes Theorem Calculator, and Confidence Interval Calculator when you need a quick follow-up check.