ToolPatch

One page. One job. Done.

← Back to all tools
Statistics

Chi-Square GOF Calculator

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

Formula reviewed: 2026-02-14 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 Pattern

Enter values in the left panel, keep units explicit, run the calculation, then copy or share the result. Invalid fields are highlighted immediately.

How to use this tool

  1. Enter Observed counts, Expected counts for the chi square gof calculator, keeping units, dates, or text format consistent with the form labels.
  2. Confirm sample size, ordering, and distribution assumptions before relying on the calculated result.
  3. Click "Run the tool" and review Chi-Square GOF Inputs, Result for the primary output.
  4. Check the statistical assumptions and sample context before using the result in a report or decision.

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.

How to interpret the result

Confidence and limitations

Formula References

Assumptions

Explore more versions

Tailored guides for specific audiences, regions, and scenarios.

Related tools and workflows