Chi-Square Goodness of Fit Calculator
Reviewed by CalcMulti Editorial Team·Last updated: ·← Statistics Hub
The chi-square goodness of fit test determines whether observed category frequencies match a theoretically expected distribution. It answers: "Does my data fit the expected pattern?"
Enter up to 10 categories with their observed counts. Specify expected counts (or leave blank for equal distribution). The calculator computes χ², degrees of freedom, p-value, and effect size.
Formula
χ² = Σ (Oᵢ − Eᵢ)² / Eᵢ df = k − 1
- Oᵢ
- observed frequency in category i
- Eᵢ
- expected frequency in category i
- k
- number of categories
- df
- degrees of freedom = k − 1
- w
- Cohen's w = √(χ²/n) — effect size
Enter Category Data
Leave "Expected" blank for a uniform distribution (equal expected frequencies).
| Category | Observed | Expected (opt.) | |
|---|---|---|---|
Chi-Square Goodness of Fit: Formula
χ² = Σ (Oᵢ − Eᵢ)² / Eᵢ
df = k − 1 · Effect size: w = √(χ²/n)
| Symbol | Meaning |
|---|---|
| Oᵢ | Observed count in category i (from your data) |
| Eᵢ | Expected count in category i under H₀ (can be theoretical or uniform) |
| k | Number of categories |
| df | Degrees of freedom = k − 1 (one constraint: observed total is fixed) |
| Cohen's w | √(χ²/n): small ≥ 0.1 · medium ≥ 0.3 · large ≥ 0.5 |
Worked Example: Are Support Tickets Uniform Across Weekdays?
A support team logs tickets by day: Mon 18, Tue 22, Wed 15, Thu 25, Fri 20 (n = 100). Is there a significant difference in ticket volume across days (H₀: uniform distribution)?
| Day | O | E (uniform) | O − E | (O−E)²/E |
|---|---|---|---|---|
| Mon | 18 | 20 | -2 | 0.200 |
| Tue | 22 | 20 | 2 | 0.200 |
| Wed | 15 | 20 | -5 | 1.250 |
| Thu | 25 | 20 | 5 | 1.250 |
| Fri | 20 | 20 | 0 | 0.000 |
| Total | 100 | 100 | 2.900 |
χ² = 2.900, df = 5 − 1 = 4
Critical value at α = 0.05, df = 4: χ²crit = 9.488
Conclusion: 2.900 < 9.488 → Fail to reject H₀. No significant variation across weekdays (p ≈ 0.575).
Assumptions & Chi-Square Critical Values
Assumptions
- Categories are mutually exclusive and exhaustive
- Observations are independent
- All expected frequencies ≥ 5 (rule of thumb)
- At minimum, no expected cell is 0
- Data are counts (not proportions or percentages)
χ² critical values (α = 0.05)
| df (k−1) | χ²0.05 | χ²0.01 |
|---|---|---|
| 1 | 3.841 | 6.635 |
| 2 | 5.991 | 9.210 |
| 3 | 7.815 | 11.345 |
| 4 | 9.488 | 13.277 |
| 5 | 11.070 | 15.086 |
| 6 | 12.592 | 16.812 |
| 9 | 16.919 | 21.666 |
Related Calculators
Independence test for two categorical variables
Degrees of Freedom ExplainedWhy df = k−1 for goodness of fit
Two-Proportion Z-TestCompare two proportions directly
Normality Test CalculatorTest if data follows normal distribution
P-Value ExplainedInterpret your chi-square p-value
Statistics HubAll statistics calculators
Disclaimer
All expected frequencies should be ≥ 5. Combine categories if this condition is violated.