StatGardenREF. DESK
Calculators/Statistics/p-value from a test statistic
Statistics

p-value from a test statistic calculator

Converts a z, t, chi-square or F test statistic into a p-value, for any tail direction.

What this calculator does

A p-value is the probability of seeing a test statistic at least as extreme as the one observed, if the null hypothesis were actually true. It is not the probability that the null hypothesis is true, and it is not the probability that the result happened by chance in some vaguer sense; it is a statement about how surprising the data would be under a specific assumption.

This calculator skips the raw sample data and starts from the test statistic itself, since that is the number most textbook problems and statistical software already hand you. Pick the distribution the statistic follows, enter its value and degrees of freedom where relevant, and choose which tail (or both) the test is checking.

The formula

Formulaz: p = 1 − Φ(|z|), doubled for two-tailed. t: uses the regularised incomplete beta function with the given degrees of freedom. Chi-square and F: upper-tail probability from the gamma and beta functions respectively.

For a z-statistic, the p-value comes directly from the standard normal distribution. For t, chi-square and F statistics, the calculator evaluates the corresponding distribution using the regularised incomplete beta and gamma functions with the degrees of freedom supplied, then reads off the area in the requested tail. A two-tailed p-value doubles the smaller one-tailed area.

TermMeaning
Test statisticThe number a statistical test produces, such as z, t, χ² or F, that measures how far the sample result sits from what the null hypothesis predicts.
Degrees of freedomA parameter of the t, chi-square and F distributions, usually tied to sample size, that controls the exact shape of the curve.
TailWhich direction counts as "more extreme": above the statistic (right), below it (left), or either direction (two-tailed).

The inputs explained

FieldWhat to enter
Test statistic typeThe distribution the test statistic follows. Chi-square and F statistics are never negative, since both are built from squared or ratio quantities.
Test statistic valueThe test statistic value itself, exactly as reported by the test or the software that produced it.
TailTwo-tailed for a "different from" hypothesis, right-tailed for "greater than", left-tailed for "less than". Chi-square and F tests conventionally use the upper (right) tail.
Degrees of freedom (t, chi-square) or numerator df (F)Degrees of freedom for a t or chi-square test, or the numerator degrees of freedom for an F test.
Denominator degrees of freedom (F only)Denominator degrees of freedom, used only for the F distribution.

When to use it

Checking a result from statistical software

Software often reports the test statistic and degrees of freedom but rounds or omits the exact p-value. Feeding the same numbers in here reproduces it independently.

Working through a textbook problem

Many worked problems give you z or t directly and ask for the p-value, without expecting you to compute the raw data statistics first.

Comparing a statistic against more than one significance level

Rather than looking up separate critical values for α = 0.05 and α = 0.01, the exact p-value can be compared against any threshold at once.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How the two-tailed p-value changes with a t-statistic (df = 20)

A fixed 20 degrees of freedom, across a range of t-statistic values.

20 degrees of freedom, two-tailed test
t-statisticp-value (two-tailed)Significant at α = 0.05?
1.00.3293No
1.50.1492No
2.00.0593No
2.50.0212Yes
3.00.0071Yes
3.50.0023Yes
The p-value falls as the t-statistic moves further from zero, since a larger statistic is a rarer result under the null hypothesis.

How the two-tailed p-value changes with degrees of freedom, for t = 2.0

The same t-statistic of 2.0, evaluated at a range of degrees of freedom.

t-statistic fixed at 2.0, two-tailed test
Degrees of freedomp-value (two-tailed)Significant at α = 0.05?
50.1019No
100.0734No
200.0593No
300.0546No
600.0500No
1200.0478Yes
The same t-statistic produces a smaller p-value as degrees of freedom rise, because the t-distribution narrows towards the standard normal as the sample grows.

Questions

What counts as a "significant" p-value?

By convention many fields use α = 0.05 as a threshold, but that cutoff is a convention, not a law of statistics. Some fields use a stricter threshold, and a p-value just above or below any cutoff is not meaningfully different from one just on the other side.

Is a smaller p-value always more important?

No. A very small p-value can come from a trivial effect measured on a huge sample, and a larger p-value can hide a real effect measured on a small one. The p-value speaks to statistical significance, not to the size or practical importance of the effect.

Why do I need degrees of freedom for some distributions but not others?

The standard normal distribution has a single fixed shape, so a z-statistic needs nothing else. The t, chi-square and F distributions change shape with sample size, which is what degrees of freedom controls, so the p-value cannot be found without it.

Should I use a one-tailed or two-tailed test?

That decision belongs to how the hypothesis was framed before looking at the data, not to whichever tail gives a smaller p-value afterwards. A two-tailed test is the safer default when there is no strong prior reason to expect the effect in one direction only.

For a worked z or t test starting from raw sample statistics rather than a pre-computed test statistic, see the z-test for a single mean or t-statistic calculator. For a chi-square test built from category counts, see the chi-square goodness of fit calculator.