Mathematics
P-value calculator
Enter the test statistic: the p-value appears at once, with the curve and the area it stands for. Drag the slider and watch the area grow or shrink.
What the p-value tells you
The p-value is the probability of a result at least as extreme as the one observed if the null hypothesis were true. On the chart it is the shaded area under the curve beyond the test statistic: the further the statistic is from zero, the smaller the area.
It is compared with the significance level α chosen before looking at the data, usually 0.05. If p is below α the result is called statistically significant and the null hypothesis is rejected; otherwise the data are not enough to reject it, which is not the same as proving it.
A z test is used when the population standard deviation is known or the sample is large; a t test when it is estimated from the sample, with n − 1 degrees of freedom. A two-tailed test looks for a difference in either direction, a one-tailed test only in the direction the hypothesis names.
Common mistakes
- Reading p as the probability that the null hypothesis is true: it is the probability of the data, assuming the hypothesis.
- Switching to one tail after seeing the data to push p below 0.05.
- Confusing statistical significance with practical importance: with huge samples, tiny differences give small p-values.
Frequently asked questions
What p-value counts as significant?
It depends on α, set before the analysis. The usual value is 0.05; medicine and physics often use stricter thresholds such as 0.01 or far less.
When should I use z and when t?
Use t when the standard deviation is estimated from the sample, which is almost always the case with real data. With many degrees of freedom t is practically identical to the normal.
Why is the two-tailed p-value double?
Because it counts results extreme in both directions: the area beyond |statistic| on the right plus the mirror area on the left.
How this calculation works
With F the cumulative distribution function of the chosen distribution and T the statistic: left tail p = F(T), right tail p = 1 − F(T), two tails p = 2·min(F(T), 1 − F(T)). The normal is computed through the incomplete gamma function, Student's t through the regularised incomplete beta function; critical values come from inverting F.
Related calculators
Descriptive statistics
Mean, median, mode, standard deviation, quartiles and frequency distribution.
Confidence interval
Confidence interval for a mean with z or t, margin of error, and a simulation showing what 95% means.
Probability
Classical and conditional probability, Bayes and the binomial distribution.