Chi-Square Goodness of Fit Calculator
Enter the observed counts and the expected proportions they are tested against. The calculator returns the expected counts, the chi-square statistic, the p-value, and a conclusion in plain words, and warns in words when an expected count falls below 5.
Chi-square goodness of fit calculator
How this calculator works
The goodness of fit test asks whether a set of observed counts matches a stated split of proportions across categories: a die that lands evenly, a product mix that matches a plan, a sample that matches a population. Enter the observed counts in category order, then the expected proportions in the same order. The proportions must add to 1.
The expected count in each category is the total count times its proportion. The statistic adds, over the categories, the squared gap between observed and expected divided by the expected. The degrees of freedom are the number of categories minus one. When an expected count falls below 5, the page warns in words that the p-value runs rough rather than exact.
Worked example
Observed counts of 45, 35, and 20 against proportions of 0.5, 0.3, and 0.2 give expected counts of 50, 30, and 20. The chi-square statistic is 1.3333 at 2 degrees of freedom, and the p-value is 0.5134, above 0.05, so the test does not reject the stated proportions.
Values computed from the chi-square distribution. The method was checked against reference calculations: the entries in the worked example reproduce to four decimal places, and the full pair record sits in the package verification file.