How to use the p-value calculator
- Choose the test statistic your test produced: z, t, chi-square or F.
- Enter its value and, for t, chi-square and F, the degrees of freedom.
- Pick two-tailed, left-tailed or right-tailed to match your alternative hypothesis. Chi-square and F tests are almost always right-tailed.
- Choose your significance level α (0.05 is the usual default) and click Calculate p-value.
- Read the decision and plain-English summary, and download the shaded graph if you need it for a report.
How the p-value is calculated
The p-value is an area under the curve of the test statistic's distribution, assuming the null hypothesis is true. Which area depends on the direction of your test. If your statistic has the value x:
Left-tailed: p = P(X ≤ x)
Right-tailed: p = P(X ≥ x) = 1 − P(X ≤ x)
Two-tailed: p = 2 × P(X ≥ |x|)
- p
- The p-value
- X
- A random variable that follows the test's distribution (z, t, χ² or F) when the null hypothesis is true
- x
- The test statistic you calculated from your data
- df
- Degrees of freedom, which set the exact shape of the t, χ² and F distributions
- α
- The significance level: the cutoff you compare the p-value with, set before the test
The two-tailed formula applies to symmetric distributions (z and t). Chi-square and F statistics can't be negative, so their tests are usually right-tailed.
Worked example
A cereal maker says its boxes contain 500 g on average. An inspector weighs a large sample and gets a test statistic of z = −2.17. Is the true mean different from 500 g, at α = 0.05?
-
"Different from" means a two-tailed test
p = 2 × P(Z ≥ |−2.17|) = 2 × P(Z ≥ 2.17)
-
Look up the area to the right of 2.17 under the standard normal curve
P(Z ≥ 2.17) = 1 − 0.9850 = 0.0150
-
Double it for two tails
p = 2 × 0.0150 = 0.0300
-
Compare with α
0.0300 < 0.05 → reject H0
What it means: if the boxes really averaged 500 g, a sample result this far from 500 g (in either direction) would happen only about 3% of the time. That's unlikely enough, at the 5% level, to conclude that the average fill differs from 500 g. Because z is negative, the boxes appear to be under-filled.
How to interpret a p-value
- p ≤ α: reject the null hypothesis. The result is statistically significant at that level.
- p > α: fail to reject the null hypothesis. The data don't provide strong enough evidence against it. This is not the same as proving the null hypothesis is true.
Some common mistakes to avoid:
- A p-value is not the probability that the null hypothesis is true, or that your result happened "by chance".
- A small p-value doesn't mean a large or important effect. With a big enough sample, tiny differences become significant. Report an effect size or confidence interval alongside it.
- Choose one-tailed or two-tailed, and α, before looking at the results, not after.
If you're planning a study rather than analyzing one, the sample size calculator helps you collect enough data to detect the effect you care about.