Skip to content
FiftyCalc Free calculators for all 50 states

Chi-Square Calculator

Test cases replayed : 4 of 4 match · Methodology · No outside source listed

Enter the chi-square statistic and the degrees of freedom of your test to get its p-value.

Result

Sample figures

Right-tailed p-value P(χ² ≥ statistic)—

Cumulative probability P(χ² ≤ statistic) —

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Chi-Square Calculator

Chi-square statistic (χ²): enter 0 or more. Prefilled example: 7.81.

Degrees of freedom: enter a number from 1 to 1,000. Prefilled example: 3.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Chi-square statistic (χ²): enter 0 or more.
  2. Degrees of freedom: enter a number from 1 to 1,000.
  3. Read the result: Right-tailed p-value P(χ² ≥ statistic); the panel also shows Cumulative probability P(χ² ≤ statistic).

How this calculator works

The p-value of a chi-square test is P(X ≥ χ²) for a chi-square distribution with k degrees of freedom: Q(k/2, χ²/2), the regularized upper incomplete gamma function, evaluated with the series and continued fraction of Numerical Recipes.

Degrees of freedom: categories − 1 for a goodness-of-fit test; (rows − 1) × (columns − 1) for a test of independence in a contingency table.

The formula

  1. P=1−chi2cdf⁡(2×(c2),2×(df2))
Symbols used in the formula
SymbolMeaning
cChi-square statistic (χ²)
dfDegrees of freedom
PRight-tailed p-value P(χ² ≥ statistic)
chi2cdf(x, k)the probability that a chi-square variable with k degrees of freedom is at most x.

Worked example

Chi-square statistic (χ²)7.81
Degrees of freedom3
Cumulative probability P(χ² ≤ statistic)0.9499
  1. P=1−chi2cdf⁡(2×(7.812),2×(32))=0.0501061

Right-tailed p-value P(χ² ≥ statistic) 0.0501

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What is the p-value of χ² = 7.81 with 3 degrees of freedom?

About 0.0501, right at the usual 0.05 threshold: 7.815 is the 5% critical value for 3 degrees of freedom.

How many degrees of freedom does a 2 × 2 table have?

(2 − 1) × (2 − 1) = 1.

Questions answered

Related calculators