How to use
This chi-square goodness-of-fit calculator compares observed and expected frequencies for the same categories. It sums squared deviations weighted by expected counts and computes the right-tail p-value from the chi-square distribution.
- Enter observed frequencies.
- Enter positive expected frequencies of the same length.
- Make sure categories line up in the same order.
- Calculate χ², df, p-value and both totals.
How it is calculated
Example
Example: observed 20,30,50 versus expected 25,25,50 gives χ²=2. If no parameters were estimated from the same data, df=2 here.
Important notes
The df=k−1 rule applies to a basic goodness-of-fit test when no parameters are estimated from the data. Estimated parameters or very small expected counts can require different degrees of freedom or methods. Expected and observed totals should normally be compatible.
Frequently asked questions
Is this a test of independence?
No. This version is for goodness of fit across one set of categories.
Can an expected value be zero?
No, because E appears in the denominator.
Why is the p-value right-tailed?
Larger χ² values indicate larger departures from expectation.
Should the totals match?
In a standard goodness-of-fit setup, expected counts should represent the same or a compatible total.