Skip to main content

p-value Calculator

A p-value is the probability of seeing a test statistic at least as extreme as the one you measured, assuming the null hypothesis is true. This calculator takes a statistic you already have and works out that probability for you, using whichever reference distribution your test calls for.

This chooses the reference distribution.

Not used for chi-square or F, which are always upper-tailed.

The number of categories minus 1 for a goodness-of-fit test.

Between −1 and 1, excluding the endpoints.

The number of paired observations behind r.

What Is the p-value Calculator?

A p-value is a probability calculated under an assumption. Specifically, it is the probability of observing a test statistic at least as extreme as the one measured, given that the null hypothesis is true.

It is a single number summarising how badly the data fit the null, and it is the most misused quantity in statistics — so much so that ASA statements have warned about it twice.

How Does the p-value Calculator Work?

Identify the reference distribution your test uses. A z statistic is read against the standard normal; a t statistic against Student’s t with the relevant degrees of freedom; a goodness-of-fit statistic against chi-square; a variance ratio against F.

Locate the statistic on that curve and measure the tail area. A two-sided test counts both tails, a one-sided test counts only the predicted direction. Chi-square and F have only an upper tail because their statistics are non-negative.

Compare that area with your chosen significance level. Smaller than alpha means rejecting the null hypothesis. For a correlation, first convert r to a t statistic using n − 2 degrees of freedom so the same procedure applies.

p-value Calculator Formula & Variables

The core mathematical equation utilized by this calculator is expressed as:

p=P(Tdf≥∣t∣)t=rn−21−r2p = \Prob\left(T_{df} \ge |t|\right) \qquad t = \frac{r\sqrt{n-2}}{\sqrt{1-r^2}}

Variable Definitions

SymbolVariable Meaning & Units
pprobability of a result at least this extreme if H₀ holds
ttest statistic, on whichever scale the test uses
dfdegrees of freedom of the reference distribution
rPearson correlation coefficient
nnumber of observations

The p-value is a tail area, not a property of your data. Which tail depends on the alternative hypothesis: a two-sided test counts both tails, a one-sided test counts only the direction you predicted. For a correlation, the t conversion puts r on the same scale as a t statistic so the same tail area applies.

How to Use the p-value Calculator

  1. Work out which statistic you have and which test produced it. The reference distribution must match, or the p-value will be wrong.
  2. Set the alternative hypothesis before entering anything. If the test was one-sided, a two-sided p-value roughly doubles and may cross your threshold.
  3. Enter the degrees of freedom. For a t statistic they come from the sample sizes; for chi-square from the number of categories minus one; for F from both group sizes minus one.
  4. Read the decision, then go back to the effect size. Significance without magnitude is rarely the useful part of a result.

Step-by-Step Example Calculation

A z statistic of 1.96 with a two-sided test

Input Values:

mode:z
direction:two_sided
alpha:0.05
statistic:1.96
Worked Steps: The two-tailed area beyond ±1.96 is 0.0500, which sits just below the 5% threshold — the borderline result every statistics textbook opens with.

Understanding Your Result

A small p-value means the data are hard to explain under the null hypothesis. It is not a statement about how likely the null is, nor about how big the effect is.

The critical value shown alongside is the statistic that would have produced exactly alpha. If yours exceeds it, the result is significant — a useful cross-check on the p-value.

The percentage figure is the same number in different units. A p-value of 0.05 is a 5% long-run rate of results at least this extreme under the null.

Factors That Affect the Result

  • The size of the statistic, which combines the effect with its precision.
  • The degrees of freedom. With few of them, the reference distribution is heavy-tailed and p-values are larger than the normal would suggest.
  • Sample size. Larger samples push the same real effect towards smaller p-values without the effect itself changing.
  • Which tail you count. Reading one tail instead of two roughly halves the p-value.

When Should You Use This Calculator?

  • You have a reported statistic and want the p-value that goes with it.
  • Converting a regression or correlation output into a plain-language significance statement.
  • Checking your own p-value against a different reference distribution.
  • Any situation where the choice of reference distribution is the thing you need to be sure about.

Assumptions & Limitations

  • The p-value is valid only under the null hypothesis and its assumptions. With small samples and skewed data the reference distribution may not be accurate.
  • A p-value depends on the exact alternative hypothesis chosen, and it is common to report the two-sided version regardless of what was tested.
  • Interpretation requires the effect size and a confidence interval. A p-value alone cannot distinguish a trivial effect from an important one.
  • Multiplicity is invisible in any single p-value. Testing twenty outcomes and reporting the smallest one produces one p-value below 0.05 by chance alone.

Frequently Asked Questions

Calculation Accuracy & Reference Note

Tail areas are computed from accurate implementations of the normal, incomplete beta, incomplete gamma and regularised incomplete beta functions.

Standard Reference: Standard normal, Student’s t, chi-square and F reference distributions.