Chi-Square p-Value Calculator
Enter χ² and its degrees of freedom to get the exact p-value. Useful when a paper or an exam question gives you the statistic but not the p-value.
Checked on November 21, 2026. Results computed by our statistics engine, version 1.0.0.
On this page
What the p-value is
For tests of independence and goodness of fit, large values of χ² count against the null hypothesis, so the p-value is the area under the chi-square curve to the right of your statistic: the probability of a χ² at least that large if the null hypothesis were true. The calculator shades that area.
The example above uses χ² = 12.99 with 4 degrees of freedom, the rounded statistic from the OpenStax volunteer table on the test of independence page. The exact upper-tail p is 0.0113. A table would only tell you that p is between 0.01 and 0.025.
Why exact beats a table range
Printed tables give a handful of columns, so you can only say "p < 0.05" or "between 0.01 and 0.025". Journals now ask for exact p-values, and APA style asks for exact values to two or three decimals, with p < .001 for anything smaller. The value here is computed to about twelve significant figures, the accuracy of R's pchisq and SciPy's chi2.sf (R pchisq documentation, SciPy gammainc).
For a check you can do in your head: χ² = 3.841 with 1 degree of freedom sits at the 5% point, so p comes back as 0.0500.
How it is computed
The upper tail of the chi-square distribution with k degrees of freedom equals Q(k/2, χ²/2), the regularized upper incomplete gamma function (NIST DLMF chapter 8). We evaluate it with a power series or a continued fraction, whichever converges faster, and compute the tail you ask for directly rather than as 1 minus the other tail. That is what keeps very small p-values accurate: a statistic of 1,000 with 10 degrees of freedom gives p = 1.870 × 10−208, where a naive subtraction would print 0.
Degrees of freedom need not be whole numbers. That is rare in chi-square tests but appears in some approximations, and the calculation handles it.
Upper or lower tail?
- Upper tail: the p-value for tests of independence, homogeneity, goodness of fit, McNemar and the G-test. This is almost always what you want.
- Lower tail: used for a suspiciously good fit (counts closer to expected than chance allows) and in tests about a variance.
- Two-tailed: only for tests about a variance, where both very small and very large χ² count against the null. Double the smaller tail.
From p back to a statistic
To go the other way, from a significance level to the χ² you need to beat, use the critical value calculator, or the printable chi-square table. The chi-square distribution guide shows how the curve changes shape with the degrees of freedom.
Common questions
Why is my p-value 1 minus the table value?
Some tables list the area to the left. For chi-square tests you need the area to the right, the upper tail.
Can p be exactly zero?
No. Very large χ² values give extremely small p-values, which we show in scientific notation rather than as 0.000.
Sources
- R documentation: the chi-squared distribution (pchisq, qchisq) checked November 21, 2026
- SciPy documentation: scipy.special.gammainc checked November 21, 2026
- NIST Digital Library of Mathematical Functions, chapter 8: incomplete gamma and related functions checked November 21, 2026