statcompute

Distributions

Chi-Square Distribution Calculator

Tail probabilities and critical values for the chi-square distribution — the p-value behind every chi-square test.

Updated October 2026Runs in your browser — nothing is uploadedVerified against R
How you write decimals. Auto works it out from what you type and asks if it cannot tell.

The calculation runs in your browser, so this box needs JavaScript. The formula, the worked example and the interpretation below do not.

01

How to read this result

Chi-square lives on the positive numbers and is right-skewed. It is a sum of squared standard normals, so it cannot be negative, and its shape depends entirely on the degrees of freedom: sharply skewed at 1 or 2, increasingly symmetric as df grows.

The p-value is always the upper tail. Every chi-square test — independence, goodness of fit, variance — produces a statistic that grows under any departure from the null. All the evidence is in one tail, so there is no two-tailed version to choose.

Mean df, variance 2df. A quick sanity check: a chi-square statistic close to its degrees of freedom is unremarkable. χ² = 7 on 7 df is exactly average; χ² = 25 on 7 df is not.

With 1 degree of freedom it is the squared normal, which is why a two-tailed z-test and a 1-df chi-square test always give the same p-value. 1.96² = 3.84, the familiar 5% critical value.

02

The formula

f(x)=xk/2−1e−x/22k/2Γ(k/2),x>0
k
the degrees of freedom
Γ
the gamma function

The upper tail is the regularised incomplete gamma function Q(k/2, x/2), computed directly rather than as one minus the CDF so that tiny p-values keep their digits.

03

Worked example

A chi-square of 12.3 on 7 degrees of freedom

A goodness-of-fit test across eight categories produces χ² = 12.3 with 7 degrees of freedom. Is that unusual?

  1. The expected value of the statistic is its degrees of freedom.
    mean = 7, SD = √14 = 3.74
  2. 12.3 is about 1.4 standard deviations above the mean — worth checking, not obviously extreme.
    (12.3 − 7)/3.74 = 1.42
  3. Compute the exact upper tail.
    P(X > 12.3) = 0.0911
  4. Compare with the 5% critical value on 7 df.
    χ²* = 14.07
p-value 0.0911critical χ² (5%) 14.07mean of the distribution 7Conclusion not significant at 0.05

A statistic 75% larger than its expected value still gives p = 0.09. Chi-square distributions are wide, and small tables have little power to detect anything but large departures.

Checked against R's pchisq(12.3, 7, lower.tail = FALSE).

The calculator above is loaded with these numbers by the Load the worked example button.

04

Assumptions, and when to use something else

The distribution itself assumes nothing — it is a mathematical object. What assumes things is the test that produces the statistic: independent observations, counts rather than percentages, and expected counts large enough for the approximation to hold. See the chi-square test for those.

Degrees of freedom are the input most often entered wrongly: (rows − 1)(columns − 1) for a table of independence, categories − 1 for goodness of fit, and one fewer for each parameter estimated from the data.

  • You have a table rather than a statisticChi-square testComputes χ², the degrees of freedom and the p-value from the counts.
  • You want the p-value from a different statisticP-value calculatorz, t, chi-square and F together.
  • You are testing variancesLevene's testThe modern, more robust way to compare spreads across groups.
05

Questions people ask

Why is the chi-square test always one-tailed?

Because χ² is a sum of squares: any departure from the null, in any direction, makes it larger. A small χ² means the data fit the null better than chance would predict, which is not evidence against it — though a suspiciously small value can indicate fabricated data, which is how Fisher questioned Mendel's results.

What is the critical chi-square value for 5%?

It depends on the degrees of freedom: 3.841 at 1 df, 5.991 at 2, 11.070 at 5, 18.307 at 10. The critical-value mode computes it for any df with a table of common levels.

What is the relationship between chi-square and the normal distribution?

A chi-square with k degrees of freedom is the sum of k squared independent standard normals. With k = 1 that means χ² = z², which is why a 1-df chi-square test and a two-tailed z-test agree exactly.