How to use this calculator
Free Chi-square goodness-of-fit calculator. Compare observed category counts with expected counts under a specified distribution.
- Enter Observed counts, comma-separated, Expected counts, comma-separated. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Compare category counts with a specified pattern
The goodness-of-fit statistic summarizes how far observed category counts depart from expected counts. The category order matters because each observed count is paired with the expected count in the same position.
Inputs for this calculation
- Observed counts, comma-separated: Enter one nonnegative count per category, in the order you want to compare.
- Expected counts, comma-separated: Enter the matching expected frequency for each category. Expected values must be positive and should add to the observed total.
Formula and method
For each category, calculate (observed − expected)² ÷ expected, then add those contributions: χ² = Σ(O − E)²/E. With three categories and no fitted parameters, the reference degrees of freedom are 3 − 1 = 2.
Worked example
For observed counts 18, 22, and 20 versus expected counts 20, 20, and 20, the three contributions are 0.10, 0.10, and 0.00. Their sum is χ² = 0.40; with 2 degrees of freedom the calculator reports an approximate p-value of 0.8187.
Reading the result
A small statistic means the observed counts are close to the supplied pattern relative to expected-count scale. A large statistic signals a larger discrepancy, but the p-value also depends on the reference distribution and test assumptions.
Assumptions and limits
The chi-square approximation can be unreliable when expected category counts are very small. Combine categories only when the grouping is substantively defensible, or use a method designed for sparse counts.
Method references
Frequently asked questions
Do expected counts need to add to the observed total?
Yes for the usual frequency-table test: the expected frequencies should describe the same total number of observations as the observed counts.
Does a large p-value prove the model is correct?
No. It means these data do not show a large discrepancy under this test; it does not prove the proposed distribution or its assumptions.
How do I use the Chi-square goodness-of-fit calculator?
Enter Observed counts, comma-separated, Expected counts, comma-separated. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Chi-square goodness-of-fit?
For observed counts 18, 22, and 20 versus expected counts 20, 20, and 20, the three contributions are 0.10, 0.10, and 0.00. Their sum is χ² = 0.40; with 2 degrees of freedom the calculator reports an approximate p-value of 0.8187.
What does the Chi-square goodness-of-fit calculator calculate?
Free Chi-square goodness-of-fit calculator. Compare observed category counts with expected counts under a specified distribution.