Chi-Square Goodness of Fit Calculator

Enter your observed and expected frequencies for up to 8 categories, and the Chi-Square Goodness of Fit Calculator computes the chi-square statistic (χ²), degrees of freedom, and p-value — telling you whether your data fits the expected distribution. Add category labels to keep your results organized.

The probability threshold for rejecting the null hypothesis.

Results

Chi-Square Statistic (χ²)

--

Degrees of Freedom

--

P-Value

--

Critical Value

--

Conclusion

--

Observed vs Expected Frequencies

Results Table

Frequently Asked Questions

What is the chi-square goodness of fit test?

The chi-square goodness of fit test determines whether observed frequency data matches a theoretically expected distribution. It computes a test statistic by comparing how far observed counts deviate from expected counts across categories. A large chi-square value suggests the data does not fit the expected distribution.

How do I find the expected frequencies?

Expected frequencies depend on your hypothesis. If you expect equal distribution, divide the total sample size by the number of categories. You can also base expected frequencies on prior research, theoretical proportions (e.g. Mendelian genetics ratios), or a known probability distribution. The expected values must sum to the same total as the observed values.

What does the p-value tell me in this test?

The p-value is the probability of observing a chi-square statistic as large as yours (or larger) if the null hypothesis were true. A p-value below your chosen significance level (e.g. 0.05) means you reject the null hypothesis and conclude the observed data does not fit the expected distribution.

What are degrees of freedom in a goodness of fit test?

Degrees of freedom equal the number of categories minus one (k − 1). For example, with 4 categories your degrees of freedom would be 3. This value determines which chi-square distribution is used to find the critical value and p-value.

What are the assumptions of the chi-square goodness of fit test?

The key assumptions are: (1) data consist of counts (not percentages or rates), (2) each observation belongs to exactly one category, (3) observations are independent, and (4) each expected frequency is at least 5. If expected counts are very small, consider combining categories or using an exact test instead.

How is the chi-square statistic calculated by hand?

For each category, subtract the expected count from the observed count, square the result, and divide by the expected count: (O − E)² / E. Sum these values across all categories to get the chi-square statistic. Then compare it to the critical value from a chi-square table using your degrees of freedom and significance level.

When should I use a goodness of fit test versus a test of independence?

Use the goodness of fit test when you have one categorical variable and want to compare your observed frequencies to a known or hypothesized distribution. Use the test of independence (also chi-square based) when you have two categorical variables and want to determine if they are associated with each other.

What significance level should I choose?

The most common choice is α = 0.05, meaning you accept a 5% chance of incorrectly rejecting the null hypothesis. Use α = 0.01 for stricter standards in fields like medicine or α = 0.10 when you want a more lenient threshold for exploratory research. Your choice should be made before collecting data.

More Statistics Tools