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

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 wantChooseEnter
p-value of a chi-square testP(X ≥ x)x = the test statistic
Critical value at significance level αFind x from an upper-tail probabilityp = α
Probability below a valueP(X ≤ x)x = the value
Both factors for a confidence interval of a varianceFind x from an upper-tail probability, twicep = α / 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 freedom5% in the upper tail1% in the upper tail
13.84156.6349
25.99159.2103
37.814711.3449
49.487713.2767
511.070515.0863
1018.307023.2093
2031.410437.5662
3043.773050.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

SoftwareLeft tailRight tail (p-value)Inverse
Excel / SheetsCHISQ.DIST(x, df, TRUE)CHISQ.DIST.RT(x, df)CHISQ.INV(p, df) and CHISQ.INV.RT(α, df)
Rpchisq(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.