Home » Statistics & Probability Calculators » Chi-Square Goodness of Fit Calculator

Chi-Square Goodness of Fit Calculator

Home › Statistics & Probability Calculators › Chi-Square Goodness of Fit Calculator

Chi-Square Goodness of Fit Calculator

The chi-square goodness-of-fit test checks whether the counts observed in several categories match the counts you would expect under a claimed distribution: is a die fair, do birth months follow the calendar, does a sample of M&M colours match the stated mix? Enter the observed counts and, optionally, the expected counts or proportions; leave the expected box blank for equal expected counts.

The calculator scales expected proportions to the observed total, builds the (O − E)²/E table, sums it to get χ² with k − 1 degrees of freedom, and finds the p-value from the chi-square distribution. It also warns when any expected count is below 5, the usual condition for the approximation to be reliable.

The test is always right-tailed: large deviations from the expected pattern make χ² big and the p-value small. When categories form a two-way table rather than a single list, use the chi-square test of independence.

Separate values with commas, spaces or new lines.

Leave blank for equal expected counts. Proportions are scaled to the observed total.

Result and step-by-step solution

χ²(5) = 3.7
p = 0.5934
Fail to reject H₀ at α = 0.05. The observed counts are consistent with the expected distribution; the differences could be sampling variation.
  1. State the hypotheses
    H₀: the observed counts follow the expected distribution. H₁: they do not.
  2. Expected counts
    Total n = 120 across 6 categories. All expected counts are at least 5.
  3. Compute (O − E)² ÷ E for each category
    CategoryObserved (O)Expected (E)O − E(O − E)²/E
    Category 1222020.2
    Category 21720−30.45
    Category 3202000
    Category 4262061.8
    Category 51520−51.25
    Category 6202000
  4. Sum the terms
    χ² = Σ(O − E)²/E = 3.7, df = k − 1 = 5
  5. p-value
    P(χ²5 ≥ 3.7) = 0.5934
  6. Decision
    p = 0.5934 ≥ α = 0.05. Critical value χ²0.05,5 = 11.0705.

Frequently asked questions

What are the degrees of freedom?
k − 1, where k is the number of categories. If you estimated parameters of the expected distribution from the data, subtract one more for each estimated parameter.
Can I enter expected values as percentages?
Yes. Enter 50, 30, 20 or 0.5, 0.3, 0.2; the calculator scales them so they add to the observed total.
What if an expected count is less than 5?
The chi-square approximation becomes unreliable. Combine small categories or use an exact multinomial test.
Is the goodness-of-fit test one-tailed or two-tailed?
It is a one-tailed (right-tailed) test on the chi-square distribution, because any departure from the expected counts, in either direction, increases χ².

Last reviewed: September 25, 2026. Calculations run in your browser and were validated against SciPy.

Scroll to Top