Mathematics · Statistics · Inferential Statistics
P-Value Calculator
Calculate the p-value from a z-score or t-score for one-tailed and two-tailed hypothesis tests.
Calculator
Formula
p is the p-value, \Phi is the standard normal CDF, and z is the test statistic. For a one-tailed test, omit the factor of 2.
Source: Standard frequentist hypothesis testing framework; see Casella & Berger, Statistical Inference (2nd ed.).
How it works
For a z-test, the p-value is computed from the standard normal distribution. The one-tailed p-value equals the area in the tail beyond |z|, while the two-tailed p-value doubles this area to account for both directions.
For a t-test, the same logic applies but using the Student's t-distribution with the specified degrees of freedom. As degrees of freedom increase, the t-distribution converges to the standard normal, so results for large df closely match the z-test.
Worked example
Suppose you run a two-sample z-test and obtain z = 2.05 with a two-tailed test.
1. Compute the area beyond |z| = 2.05 in the standard normal distribution: P(Z > 2.05) ≈ 0.0202.
2. Double for two tails: p = 2 × 0.0202 = 0.0404.
Since 0.0404 < 0.05, you reject the null hypothesis at the 5% significance level.
Limitations & notes
This calculator uses a numerical approximation for the error function and the regularized incomplete beta function, which may introduce small rounding errors (typically less than 0.0001) for extreme test statistics. It assumes the test statistic follows a normal or t-distribution; non-parametric or chi-squared tests require different methods. Always verify statistical significance against your chosen alpha level in the context of your study design.
Frequently asked questions
What p-value is considered statistically significant?
The most common threshold is 0.05, meaning there is less than a 5% probability of observing the data if the null hypothesis were true. Some fields use stricter thresholds such as 0.01 or 0.001.
When should I use a one-tailed vs. two-tailed test?
Use a one-tailed test only when you have a strong directional hypothesis before collecting data. Two-tailed tests are more conservative and appropriate for most exploratory analyses.
What degrees of freedom should I enter for a t-test?
For a one-sample t-test use n − 1, and for a two-sample t-test use n1 + n2 − 2 (or the Welch approximation). Enter 0 to use the standard normal (z-test) instead.
Does a low p-value prove my hypothesis is correct?
No — a low p-value only indicates the data are unlikely under the null hypothesis; it does not confirm your alternative hypothesis or measure effect size. Statistical significance should always be interpreted alongside practical significance.
Can I use this calculator for chi-squared or F-tests?
No — chi-squared and F distributions require different CDFs not implemented here. Use a dedicated calculator for those test types.
Last updated: 2025-01-15 · Formula verified against primary sources.