Chi-Square Distribution Calculator
Find chi-square probabilities below or above a value, the right-tail p-value of a test statistic, or the critical value for a given significance level. Enter the degrees of freedom; the mean, variance, median and mode come with a shaded density chart.
Positive; the number of categories minus one for a goodness-of-fit test
Related Calculators
Chi-Square Table (χ² Critical Values)
Look up chi-square critical values for degrees of freedom 1 to 100 across ten common tail areas.
Chi-Square Calculator
Test observed counts against expected counts with a chi-square goodness-of-fit test.
Gamma Distribution Calculator
Gamma distribution probabilities and quantiles from the shape and scale or rate, with mean, variance, mode, skewness and a shaded density chart.
What the chi-square distribution is
A chi-square variable with k degrees of freedom is the sum of the squares of k independent standard normal variables. Because squares cannot be negative the distribution lives on positive values and is skewed to the right, more strongly the fewer the degrees of freedom. It is the reference distribution for the goodness-of-fit and independence tests and for inferences about a variance, and it is a gamma distribution with shape k/2 and scale 2 (see the gamma distribution calculator).
χ² = Z₁² + Z₂² + … + Z_k², with Z₁ … Z_k independent standard normal
f(x) = x^(k/2 − 1) e^(−x/2) / (2^(k/2) Γ(k/2)), for x > 0
Mean = k Variance = 2k Mode = k − 2 for k ≥ 2 Skewness = √(8 / k)
Which option gives which answer
| You want | Choose | Enter |
|---|---|---|
| p-value of a chi-square test | P(X ≥ x) | x = the test statistic |
| Critical value at significance level α | Find x from an upper-tail probability | p = α |
| Probability below a value | P(X ≤ x) | x = the value |
| Both factors for a confidence interval of a variance | Find x from an upper-tail probability, twice | p = α / 2, then p = 1 − α / 2 |
Chi-square tests reject for large statistics, so their p-value is the area to the right of the statistic. For a confidence interval of a population variance with n − 1 degrees of freedom, divide (n − 1)s² by the value with α/2 in the upper tail for the lower limit, and by the value with 1 − α/2 in the upper tail for the upper limit. The degrees of freedom calculator shows how to count the degrees of freedom for each test.
Critical values
| Degrees of freedom | 5% in the upper tail | 1% in the upper tail |
|---|---|---|
| 1 | 3.8415 | 6.6349 |
| 2 | 5.9915 | 9.2103 |
| 3 | 7.8147 | 11.3449 |
| 4 | 9.4877 | 13.2767 |
| 5 | 11.0705 | 15.0863 |
| 10 | 18.3070 | 23.2093 |
| 20 | 31.4104 | 37.5662 |
| 30 | 43.7730 | 50.8922 |
The complete table is on the chi-square table page. The critical value calculator covers z, t, chi-square and F values together.
Worked example
A chi-square test with 5 degrees of freedom is significant at the 5% level when its statistic exceeds 11.070498, the value with 5% of the area in the upper tail. Turned around, a statistic of 11.070498 has a p-value of 0.05. Load example shows this critical value together with the mean 5, the variance 10, the median 4.3515, the mode 3 and the skewness 1.2649. To turn a statistic into a p-value directly, use the chi-square test calculator or the p-value calculator.
Software equivalents
| Software | Left tail | Right tail (p-value) | Inverse |
|---|---|---|---|
| Excel / Sheets | CHISQ.DIST(x, df, TRUE) | CHISQ.DIST.RT(x, df) | CHISQ.INV(p, df) and CHISQ.INV.RT(α, df) |
| R | pchisq(x, df) | pchisq(x, df, lower.tail = FALSE) | qchisq(p, df) and qchisq(α, df, lower.tail = FALSE) |
| Python (SciPy) | scipy.stats.chi2.cdf(x, df) | scipy.stats.chi2.sf(x, df) | scipy.stats.chi2.ppf(p, df) and scipy.stats.chi2.isf(α, df) |
| TI-84 | χ²cdf(0, x, df) | χ²cdf(x, 1E99, df) | no built-in inverse |
The TI-84 function is described on the χ²cdf page.
Frequently Asked Questions
How do I calculate a p-value from a chi-square statistic?
Choose P(X ≥ x), enter the test statistic as x and the degrees of freedom. The result is the area to the right of the statistic, which is the p-value for chi-square tests of goodness of fit and independence.
How do I find the chi-square critical value?
Choose the option that finds x from an upper-tail probability, enter your significance level α as p and the degrees of freedom. With 5 degrees of freedom and α = 0.05 the critical value is 11.070498.
How many degrees of freedom does a chi-square test have?
A goodness-of-fit test has the number of categories minus one, minus one more for each parameter estimated from the data. A test of independence on an r × c table has (r − 1)(c − 1). A confidence interval for a variance uses n − 1.
Why is the chi-square distribution skewed to the right?
It is a sum of squares, so it cannot be negative, and a single large normal value produces a very large square. The skewness is √(8/k), which shrinks as the degrees of freedom grow, so the shape becomes closer to a normal curve for large k.
What are the mean and variance of a chi-square distribution?
The mean equals the degrees of freedom k and the variance is 2k. The mode is k − 2 when k is at least 2. With k = 5 these are 5, 10 and 3.
How is the chi-square distribution related to the gamma distribution?
A chi-square distribution with k degrees of freedom is a gamma distribution with shape k/2 and scale 2. Non-integer degrees of freedom are therefore allowed, and the calculator accepts any positive number.
Embed This Calculator
Add this free calculator to your course page or LMS.
Adjust the height value to fit your page.