Chi-Square Distribution Calculator

Find probabilities for the chi-square distribution, or look up a critical value — a quick replacement for a printed chi-square table. Enter your values below, and see the formula, a worked example, and ready-to-use Python code underneath.

Enter your values

Please check your inputs.

Result

What the chi-square distribution tells you

The chi-square distribution describes the sum of several squared, independent standard normal values, which is why it turns up constantly in tests involving variances, counts, and categorical data. It's defined only for non-negative values and, unlike the normal distribution, is right-skewed — more strongly so at low degrees of freedom.

This calculator works as a chi-square table replacement: give it degrees of freedom and either a χ² value (to get a probability) or a target right-tail probability (to get the corresponding critical value). The chi-square test calculator is the tool to reach for when you have raw observed/expected category counts and want a full goodness-of-fit test.

Chi-square distribution notes

P(χ² ≤ x) and P(χ² ≥ x) are read from the chi-square distribution's cumulative distribution function for the given degrees of freedom (k).
Mean = k,  Variance = 2k
The critical value χ²₍α, k₎ is the value where the right-tail probability beyond it equals α — the number you'd look up in a printed chi-square table.

Python code

from scipy.stats import chi2
df = 5

chi2.cdf(9, df)           # P(\u03c7\u00b2 \u2264 9)
1 - chi2.cdf(9, df)       # P(\u03c7\u00b2 \u2265 9)
chi2.ppf(0.95, df)        # critical value for right-tail \u03b1 = 0.05

Worked example

With df = 5, find the critical value for a right-tail probability of α = 0.05, and check P(χ² ≤ 9).

  1. 1
    Find the critical value.
    For df = 5 and α = 0.05 (right tail), χ² = 11.0705 — the familiar chi-square table value.
  2. 2
    Check a specific value.
    P(χ² ≤ 9) with df = 5 comes out to 0.8909, so P(χ² ≥ 9) = 0.1091.

Since the mean of a chi-square distribution equals its degrees of freedom, a χ² value of 9 with df = 5 (mean 5) is somewhat above center — consistent with a right-tail probability of about 11%.

Frequently asked questions

Why is the chi-square distribution only defined for positive values?

The chi-square distribution arises from summing squared values, which can never be negative. As a result, it only takes values from 0 to positive infinity, and unlike the normal or t-distributions, it isn't symmetric — it's right-skewed, especially at low degrees of freedom.

How does degrees of freedom affect the shape of the distribution?

At low degrees of freedom, the distribution is strongly right-skewed with most probability mass near zero. As degrees of freedom increase, the distribution becomes more symmetric and starts to resemble a normal distribution centered near its degrees of freedom value.

When would I use this instead of the chi-square test calculator?

Use the chi-square test calculator when you have observed and expected category counts and want to run a full goodness-of-fit test. Use this calculator when you already have a chi-square statistic and degrees of freedom, or just need a critical value for a table, without entering raw category data.

What is the mean of a chi-square distribution?

The mean of a chi-square distribution equals its degrees of freedom, and its variance equals twice the degrees of freedom. This is a quick way to sanity-check whether a chi-square value seems unusually large for the given degrees of freedom.

Advertisement