Chi-Square Calculator

Enter observed and expected frequencies (same count, comma-separated). Expected values must be > 0.

Chi-Square Test — Formula

Goodness-of-fit formula

χ² = Σ (O − E)² / E
df = k − 1 (where k = number of categories)

Example: 4 categories, each expected 25

Observed: 25, 30, 20, 25  →  χ² = (0 + 1 + 1 + 0) = 2, df = 3, p ≈ 0.57 (not significant)

Related Calculators

When to Use a Chi-Square Test

The chi-square test checks whether observed data fits an expected distribution, or whether two categorical variables are independent. Use the goodness-of-fit test when you have one variable and want to see if its distribution matches a theoretical one — for example, testing if a die is fair by rolling it 60 times and expecting 10 of each face. Use the test of independence when you have two categorical variables in a contingency table — for example, testing if gender and product preference are related.

Key assumptions: observations must be independent, all expected frequencies should be ≥ 5 (for small samples, use Fisher's exact test instead), and the data must be counts, not percentages.

Interpreting Chi-Square Results

The chi-square statistic (χ²) measures total deviation between observed and expected counts. A larger χ² means a bigger difference. The p-value tells you the probability of seeing a χ² this large if the null hypothesis is true. The standard threshold is p < 0.05 — below that, you reject the null hypothesis.

p-valueInterpretation
p > 0.05Fail to reject null — data fits expected distribution
p < 0.05Reject null at 5% significance — significant difference
p < 0.01Reject null at 1% significance — strong evidence

Interpreting Chi-Square Test Results

The chi-square (χ²) statistic measures how much observed frequencies deviate from expected frequencies. A χ² value near 0 means observations match expectations closely. A large χ² value indicates a significant discrepancy. To determine significance, compare your χ² value to the critical value for your chosen significance level (typically α = 0.05) and degrees of freedom (df = number of categories minus 1). If χ² > critical value, reject the null hypothesis — the difference is statistically significant.

The p-value is the probability of observing a χ² value as extreme as yours if the null hypothesis were true. A p-value below 0.05 is conventionally considered statistically significant. For a 2×2 contingency table, df = 1; the critical value at α = 0.05 is 3.841. Common applications include testing whether a die is fair, whether disease rates differ across age groups, and whether survey responses are independent of demographics.

Chi-Square Critical Values (α = 0.05)

Degrees of FreedomCritical ValueReject H₀ if χ² >
13.8413.841
25.9915.991
37.8157.815
49.4889.488
511.07011.070
1018.30718.307
Have Feedback or a Suggestion? Contact Us
Top