How to use the p-value calculator
- Choose the statistic your test produced: t, z, chi-square, F or a correlation r.
- Enter its value and the degrees of freedom (for r, the number of pairs instead).
- Pick the tail that matches your alternative hypothesis and the significance level α. The p-value, the decision and the shaded curve update as you type.
What a p-value is
A hypothesis test starts from a null hypothesis, usually “no effect” or “no difference”, and asks how surprising your data would be if it were true. OpenStax’s Introductory Statistics defines it this way: “The p-value is the probability that, if the null hypothesis is true, the results from another randomly selected sample will be as extreme or more extreme as the results obtained from the given sample.”
On the curve, that probability is the shaded tail area beyond your statistic. A small area means results like yours would be rare if the null hypothesis were true. In the American Statistical Association’s words, “P-values can indicate how incompatible the data are with a specified statistical model.”
Comparing p with α
The significance level α is the cut-off you choose before testing, most often 0.05. It is the risk you accept of a Type I error: “rejecting the null hypothesis when the null hypothesis is true.” The decision rule is simple: “If α > p-value, reject H0. If α ≤ p-value, do not reject H0.”
For the starting example, t = 2.5 with 15 degrees of freedom, the two-tailed p-value is 0.02451, below 0.05, so the result is significant. The critical values tell the same story: ±2.1314, and 2.5 lies beyond them.
From data to a p-value: an example
Suppose a sample of 16 measurements has a mean of 52.5 and a standard deviation of 4, and you want to test whether the population mean differs from 50. The one-sample t statistic is t = (52.5 − 50) / (4 / √16) = 2.5 / 1 = 2.5, with 16 − 1 = 15 degrees of freedom. Entering t = 2.5 and 15 df, two-tailed, gives p = 0.02451. If the true mean were 50, a sample mean this far away, in either direction, would turn up only about 2.5% of the time.
When you write it up, give the test, the statistic with its degrees of freedom, the exact p-value and which tail you used, for example: t(15) = 2.5, p = 0.02451, two-tailed. Add the estimated difference with a confidence interval so readers can judge its size.
One tail or two
A two-tailed test asks whether the true value differs in either direction, so it counts both tails. A one-tailed test asks about one direction only and counts one tail, which halves the p-value when your statistic falls on that side: the same t = 2.5 gives p = 0.01225 right-tailed. Choose the tail from your hypothesis before looking at the data, never afterwards to make a result significant. If you pick a tail and your statistic lies on the other side, the p-value is above 0.5, and the calculator warns you.
Which distribution: z, t, chi-square, F or r
- z uses the standard normal curve, for large samples or a known population standard deviation. z = 1.96 gives a two-tailed p of 0.05, the source of the familiar 1.96 for 95% confidence.
- t uses Student’s t distribution and is the usual choice for means when the standard deviation comes from the sample. It has heavier tails than z, more so for small df.
- Chi-square is used for goodness-of-fit and independence tests on counts. Its curve “is nonsymmetrical and skewed to the right,” and “there is a different chi-square curve for each df.” These tests use the right tail: χ² = 12.6 with 6 df gives p = 0.04985.
- F compares variances, as in ANOVA. “There are two sets of degrees of freedom; one for the numerator and one for the denominator.” F = 4.2 with 3 and 20 df gives p = 0.01856.
- r tests a correlation. The calculator converts it to t = r √((n − 2)/(1 − r²)) with n − 2 df. For r = 0.6631 from 11 pairs, p = 0.02615, and the critical r at α = 0.05 is ±0.6021.
| df | α = 0.10 | α = 0.05 | α = 0.01 |
|---|---|---|---|
| 1 | 2.706 | 3.841 | 6.635 |
| 2 | 4.605 | 5.991 | 9.21 |
| 3 | 6.251 | 7.815 | 11.34 |
| 4 | 7.779 | 9.488 | 13.28 |
| 5 | 9.236 | 11.07 | 15.09 |
| 10 | 15.99 | 18.31 | 23.21 |
The same p-value in Excel or R
The calculator shows the matching formula for your numbers. In Excel 2010 and later, a two-tailed t p-value is =T.DIST.2T(t, df), a chi-square p-value is =CHISQ.DIST.RT(χ², df) and an F p-value is =F.DIST.RT(F, df1, df2). T.DIST.2T returns an error for a negative t, so give it the absolute value. In R the equivalents are 2 * pt(-abs(t), df), pchisq(x, df, lower.tail = FALSE) and pf(F, df1, df2, lower.tail = FALSE).
What a p-value doesn’t tell you
The ASA’s 2016 statement lists common misreadings. “P-values do not measure the probability that the studied hypothesis is true, or the probability that the data were produced by random chance alone.” Nor does a small p-value mean a big or important effect: “A p-value, or statistical significance, does not measure the size of an effect or the importance of a result.” With a large enough sample, a trivial difference can be highly significant. In the other direction, a p-value above α doesn’t prove the null hypothesis; it only means these data aren’t strong enough evidence against it, perhaps because the sample was small.
The same statement warns that “scientific conclusions and business or policy decisions should not be based only on whether a p-value passes a specific threshold.” Report the exact p-value, the size of the effect with a confidence interval, and how the study was designed, rather than just “significant” or “not significant”.
Your data stays on your device
Everything is worked out in your browser. Nothing you type is sent anywhere or stored.
Frequently asked questions
Is p = 0.05 significant?
Not at α = 0.05. The usual rule rejects the null hypothesis only when p is less than α, so p = 0.05 exactly is not below 0.05. In practice, a p-value right at the cut-off is weak evidence either way, and it is better to report the exact value.
Should I use a one-tailed or two-tailed test?
Use two tails unless you decided before seeing the data that only one direction matters, for example that a new method can only be better. The tail must match the alternative hypothesis: “not equal” is two-tailed, “greater than” is right-tailed and “less than” is left-tailed.
How do I find the degrees of freedom?
It depends on the test. A one-sample t test has n − 1, a correlation has n − 2, a chi-square goodness-of-fit test has the number of categories − 1, and a chi-square test of independence has (rows − 1) × (columns − 1). An F test has one df for the numerator and one for the denominator.
Why does my p-value show as a power of ten?
Very small p-values are shown in scientific notation so that the digits aren’t lost: 3.2 × 10⁻⁸ means 0.000000032. The calculator works out tail areas directly, so these small values stay accurate.
Can degrees of freedom be a decimal?
Yes. Welch’s t test, for example, often gives a fractional df such as 32.8. The calculator accepts it; Excel’s functions need whole numbers, so in that case only the R formula is shown.
Is anything I enter saved?
No. Everything is worked out in your browser and nothing you type is sent anywhere or stored.