🧮
🧮 Math & statistics

Chi-Square Distribution Calculator (p-value & critical value)

Results update as you type.

Your numbers

Understanding the chi-square distribution calculator — concept and principle

A chi-square distribution calculator converts a χ² test statistic and its degrees of freedom into a right-tail p-value, and returns the critical χ² value for a chosen significance level α. It is used with the chi-square goodness-of-fit test, the test of independence for contingency tables, and tests and confidence intervals for a variance.

Chi-square distribution with 3 degrees of freedomThe right tail beyond 7.8 has area 0.0503; the 5% critical value is 7.815.χ² with df = 3: three squared z’s addedz₁²+z₂²+z₃²→ df = 3χ² = 7.8p = 0.050302461012147.8critical value at α = 0.05: 7.8157.8 < 7.815 → p = 0.0503just above 0.05: not significant
The p-value is the right-tail area beyond 7.8: 0.0503, a hair above the 5% line at 7.815.

How it is calculated

F is the chi-square cumulative distribution function, computed with the regularized lower incomplete gamma function: F(x; k) = P(k/2, x/2). Degrees of freedom are k − 1 for a goodness-of-fit test with k categories (minus any estimated parameters) and (r − 1)(c − 1) for an r × c table. The statistic cannot be negative.

The principle

If Z₁, …, Z_k are independent standard normal variables, the sum Z₁² + … + Z_k² follows a chi-square distribution with k degrees of freedom. In a contingency-table or goodness-of-fit test, each term (observed − expected)² ÷ expected behaves approximately like a squared standard normal when expected counts are large enough, so their sum is approximately χ². The distribution is skewed to the right, has mean k and variance 2k, and becomes more symmetric as k grows. Only large values signal a poor fit, which is why the test uses the right tail.

Worked example

  1. Inputs: χ² = 7.8, df = 3, α = 0.05.
  2. F(7.8; 3) = P(1.5, 3.9) ≈ 0.94967.
  3. p-value = 1 − 0.94967 ≈ 0.0503.
  4. Critical value: F(c; 3) = 0.95 gives c ≈ 7.8147.
How p-value (right tail) changes with χ² statisticHow p-value changes with χ² statistic00.20.40.61.953.95.857.89.7511.715.6Example: 0.0503310979χ² statistic
Each point is the calculator re-run with only “χ² statistic” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
χ² statisticp-value (right tail)
1.950.5828489711
3.90.2724667583
5.850.1191405311
7.80.0503310979
9.750.0208152531
11.70.0084847789
15.60.0013694899

How to read the result

Here p ≈ 0.0503 is slightly above 0.05 and χ² = 7.8 is slightly below the critical 7.815, so the null hypothesis is not rejected at the 5% level, by a very small margin. Reference critical values at α = 0.05: 3.841 (df 1), 5.991 (df 2), 7.815 (df 3), 9.488 (df 4). A statistic close to df is what you would expect under the null hypothesis.

Common mistakes

Keep in mind: The chi-square approximation is unreliable with small expected counts, where Fisher's exact test is often preferred. A non-significant result does not prove the variables are independent.

Frequently asked questions

Why is the chi-square test one-tailed?

The statistic grows with the mismatch between observed and expected counts, so only large values count as evidence against the null hypothesis.

What does a very small χ² mean?

The fit is unusually close. Extremely small values can sometimes point to data that are too good to be true.

What is the mean of a chi-square distribution?

It equals the degrees of freedom, and the variance is twice that.

Sources: Pearson, K., Philosophical Magazine, Series 5, 50(302), 1900 · NIST/SEMATECH e-Handbook of Statistical Methods, Section 1.3.6.6.6 Chi-Square Distribution

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →