What is a P-Value from Chi-Square Calculator?
A p-value from chi-square calculator turns a χ² statistic and its degrees of freedom into a p-value. For goodness-of-fit and independence tests the p-value is the area to the right of χ² under the chi-square curve, because only large values signal a poor fit: χ² = 10.05 with df = 4 gives p = 0.0396, which is significant at α = 0.05. Left-tailed and two-tailed p-values are available for tests about a single variance.
What the P-Value from Chi-Square Calculator does
Enter a chi-square statistic and its degrees of freedom to get the right-tail, left-tail and two-tailed p-values, the critical value at your α, the reject or fail-to-reject decision, and a χ² curve with the p-value area shaded. A table shows whether the result is significant at each common α level, and the steps show the incomplete-gamma calculation with your numbers. It works as a chi-square p-value calculator, a chi-square to p-value converter or a p-value calculator for a chi-square test: the input is always χ² and df.
Use it after computing χ² by hand, or when software or a textbook reports the statistic without its p-value: goodness-of-fit tests, tests of independence or homogeneity in a contingency table, likelihood-ratio (G) tests, McNemar’s test and tests about one population variance. For variance tests you can switch to a left-tailed or two-tailed p-value.
How to use the P-Value from Chi-Square Calculator
- Enter the Chi-square statistic (χ²). It can never be negative.
- Enter the Degrees of freedom (df): k − 1 for k categories (minus one more per estimated parameter), (r − 1)(c − 1) for an r × c table, or n − 1 for a variance test. The Degrees of Freedom Calculator works it out if you are unsure.
- Leave Tail on Right for goodness-of-fit and independence tests. Choose Left or Two-tailed only for a test about a variance.
- Optionally enter Significance level (α) and read the p-value, decision and shaded curve.
How to calculate the p-value from chi-square
To find the p-value from a chi-square statistic (often typed as x² or chi2) you need χ², the degrees of freedom and the direction of the test. The p-value is the probability that a χ²(df) variable is at least as large as the value you observed, assuming H₀ is true.
- Compute the statistic. For counts, χ² = Σ (O − E)² / E over every cell or category.
- Work out df. Goodness of fit: categories − 1 − estimated parameters. Independence in an r × c table: (r − 1)(c − 1). One variance: n − 1.
- Find the right-tail area. p = P(χ² ≥ your value) = 1 − CDF. A calculator or software gives it exactly. With a printed chi-square table, find your df row and the two columns your χ² falls between; the p-value lies between their tail areas (for example 0.025 < p < 0.05).
- By hand for even df. When df is even the tail area has a closed form: p = e^(−χ²/2) × Σ (χ²/2)ⁱ / i!, summed from i = 0 to df/2 − 1. For df = 2 this is simply p = e^(−χ²/2); χ² = 3.2 gives p = e^(−1.6) = 0.2019.
- Compare with α. If p ≤ α, reject H₀. If p > α, fail to reject H₀.
Chi-square p-value table
Right-tail p-values for a few chi-square statistics and degrees of freedom. Read across from your df to the χ² nearest your statistic; for an exact value enter it in the calculator above. The same χ² is far less significant at higher df, because the mean of a χ²(df) variable is df.
| df | χ² = 2 | χ² = 4 | χ² = 6 | χ² = 8 | χ² = 10 | χ² = 15 | χ² = 20 |
|---|---|---|---|---|---|---|---|
| 1 | 0.1573 | 0.0455 | 0.0143 | 0.0047 | 0.0016 | 0.0001 | 0.000008 |
| 2 | 0.3679 | 0.1353 | 0.0498 | 0.0183 | 0.0067 | 0.0006 | 0.000045 |
| 3 | 0.5724 | 0.2615 | 0.1116 | 0.0460 | 0.0186 | 0.0018 | 0.0002 |
| 4 | 0.7358 | 0.4060 | 0.1991 | 0.0916 | 0.0404 | 0.0047 | 0.0005 |
| 5 | 0.8491 | 0.5494 | 0.3062 | 0.1562 | 0.0752 | 0.0104 | 0.0012 |
| 6 | 0.9197 | 0.6767 | 0.4232 | 0.2381 | 0.1247 | 0.0203 | 0.0028 |
| 8 | 0.9810 | 0.8571 | 0.6472 | 0.4335 | 0.2650 | 0.0591 | 0.0103 |
| 10 | 0.9963 | 0.9473 | 0.8153 | 0.6288 | 0.4405 | 0.1321 | 0.0293 |
Chi-square p-value formula
The chi-square CDF with k degrees of freedom is a regularized incomplete gamma function. Every p-value below is built from it.
| Symbol | Meaning |
|---|---|
| x | observed chi-square statistic |
| k (df) | degrees of freedom, any positive number |
| γ(a, z) | lower incomplete gamma function |
| Oᵢ, Eᵢ | observed and expected counts in category i |
The two-tailed rule doubles the smaller tail because the χ² curve is skewed: equal areas in each tail do not sit at equal distances from the centre. This is the equal-tail convention that matches the usual two-sided confidence interval for a variance.
The distribution follows the NIST/SEMATECH e-Handbook definition of the chi-square distribution. Critical values here agree with its table of chi-square critical values, and the p-values match R’s pchisq and SciPy’s chi2.sf.
Worked example
Worked example: customers by weekday
Problem. A shop expects customers to be spread evenly over five weekdays. Of 200 customers, it counts 55, 30, 34, 45 and 36 on Monday to Friday. Is the spread uneven at α = 0.05?
- 01Expected count per day: 200 / 5 = 40.
- 02χ² = (15² + 10² + 6² + 5² + 4²) / 40 = (225 + 100 + 36 + 25 + 16) / 40 = 402 / 40 = 10.05.
- 03df = k − 1 = 5 − 1 = 4, and the test is right-tailed.
- 04df is even, so p = e^(−5.025) × (1 + 5.025) = 0.006572 × 6.025 = 0.0396. The CDF route gives the same: γ(2, 5.025) / Γ(2) = 0.960406 and 1 − 0.960406 = 0.0396.
- 05The critical value for α = 0.05 with 4 df is 9.4877, and 10.05 > 9.4877.
Answer. p ≈ 0.0396 < 0.05, so reject H₀: customer numbers are not evenly spread across the week. Monday, with 15 more customers than expected, contributes most of the χ².
What the p-value in a chi-square test means
Yes, every chi-square test has a p-value. It is the probability of getting a χ² statistic at least as large as the one observed if the null hypothesis were true: for a goodness-of-fit test, that the counts follow the claimed proportions; for a test of independence, that the two variables are unrelated.
The 0.05 in a chi-square test is the significance level α, the false-positive rate you accept. A p-value of 0.05 or less means a statistic this large would turn up in at most 5% of samples if H₀ were true, so you reject H₀ and call the result statistically significant. For df = 1 that happens once χ² reaches 3.841; for df = 4, once it reaches 9.488.
A large p-value, such as χ² = 0.814 with df = 5 (p = 0.9761), means the counts are close to what H₀ predicts. It does not prove H₀ is true. A small p-value says the data depart from H₀ somewhere, not where or by how much, so check the individual (O − E)² / E contributions and an effect size such as Cramér’s V.
Judging χ² against its degrees of freedom
A chi-square variable with df degrees of freedom has mean df and standard deviation √(2·df). So a χ² close to its df is unremarkable, while a χ² about twice its df is significant only once df is moderately large. The table shows the right-tail p-value in both situations.
| df | p when χ² = df | p when χ² = 2 × df |
|---|---|---|
| 1 | 0.3173 | 0.1573 |
| 2 | 0.3679 | 0.1353 |
| 5 | 0.4159 | 0.0752 |
| 10 | 0.4405 | 0.0293 |
| 20 | 0.4579 | 0.0050 |
| 50 | 0.4734 | 0.000035 |
When is a chi-square test left-tailed or two-tailed?
Goodness-of-fit and independence statistics add up squared differences between observed and expected counts, so any departure from H₀ makes χ² bigger. Only the right tail counts as evidence, and a two-tailed p-value would be wrong for these tests.
The test of a single variance is different. Its statistic χ² = (n − 1)s² / σ₀² is small when the sample variance is below the claimed σ₀² and large when it is above. H₁: σ² < σ₀² uses the left tail, H₁: σ² > σ₀² the right tail, and H₁: σ² ≠ σ₀² doubles whichever tail is smaller. For example, χ² = 8.9 with df = 19 has a left-tail area of 0.0249, so the two-tailed p-value is 0.0498.
Chi-square p-value in Excel, R, Python and on a TI-84
Every package computes the same right-tail area. The examples use χ² = 10.05 and df = 4, which all return 0.0396.
| Tool | Right-tailed p-value | Left-tailed p-value |
|---|---|---|
| Excel / Google Sheets | =CHISQ.DIST.RT(10.05, 4) | =CHISQ.DIST(10.05, 4, TRUE) |
| R | pchisq(10.05, 4, lower.tail = FALSE) | pchisq(10.05, 4) |
| Python (SciPy) | chi2.sf(10.05, 4) | chi2.cdf(10.05, 4) |
| TI-83 / TI-84 | χ²cdf(10.05, 1E99, 4) | χ²cdf(0, 10.05, 4) |
Common use cases
- Finishing a goodness-of-fit test for dice, genetics ratios, market shares or survey answers.
- Getting the p-value for a chi-square test of independence on a contingency table.
- Testing whether a process variance meets a specification, with a left, right or two-tailed alternative.
- Converting likelihood-ratio or deviance statistics from logistic and log-linear models, which are approximately χ² under H₀.
Assumptions and limitations
- The χ² approximation for count data needs large enough expected counts; a common rule is that every expected count is at least 5. For small 2 × 2 tables use Fisher’s exact test.
- The df must be right. Subtract one extra degree of freedom for every parameter estimated from the data in a goodness-of-fit test.
- If you use the Yates continuity correction on a 2 × 2 table, apply it when computing χ², then enter the corrected statistic with df = 1. The p-value step is the same either way.
- The variance test is very sensitive to non-normal data, unlike the count-based tests. With skewed or heavy-tailed data its p-value can be badly off.
- A significant χ² says the counts depart from H₀ somewhere, not where or by how much. Look at the individual (O − E)² / E contributions and an effect size such as Cramér’s V.
Frequently asked questions
How do you calculate the p-value from chi-square?
Does a chi-square test have a p-value?
What does 0.05 mean in a chi-square test?
Is a chi-square test always right-tailed?
How do I find a chi-square p-value without a table?
What chi-square value is significant at 0.05?
Why does a two-tailed chi-square p-value double the smaller tail?
Can the chi-square statistic be zero?
Cite this page
Statculator. (2026, November 14). P-Value from Chi-Square Calculator. Retrieved November 14, 2026, from https://statculator.com/p-values-critical-values/p-value-from-chi-square-calculator/