The p-value is the probability of getting a test statistic at least as extreme as the one you observed, assuming the null hypothesis is true. A small p-value means your data would be surprising under ; if it is at or below the significance level you chose in advance, the result is called statistically significant and is rejected.
Most statistical tests end with one of four statistics, and this calculator converts any of them into a p-value:
- z — tests on proportions, means with a known standard deviation, large-sample tests, the z-score of an observation;
- Student's t — t-tests on means and regression coefficients, with its degrees of freedom;
- chi-square χ² — goodness of fit, independence in contingency tables, a single variance;
- Fisher's F — ANOVA, comparison of two variances, the overall regression test.
Enter the value of the statistic, the degrees of freedom when needed, and the direction of the alternative hypothesis. You get the p-value, the decision at your , both tail probabilities and a quick table of decisions at 10 %, 5 %, 1 % and 0.1 %. Very small p-values are shown in scientific notation instead of being rounded to zero.
How to use this calculator
- Pick the distribution of your test statistic: z, t, χ² or F.
- Type the value of the statistic from your test output or hand calculation.
- Choose the alternative: right-tailed ("greater than"), left-tailed ("less than") or two-tailed ("different from"). Chi-square and ANOVA tests are almost always right-tailed.
- Enter the degrees of freedom — one value for t and χ², two for F. Not sure? Use the degrees of freedom calculator.
- Set α (0.05 by default) and read the p-value and decision.
The formula
With the cumulative distribution function of the statistic under and the observed value:
For z and t, symmetric around 0, the two-tailed value is . The distribution functions are evaluated with the regularized incomplete gamma function and beta function (DLMF §8.2, §8.17), using the series and continued fractions of Numerical Recipes §6.2–6.4:
Each tail is computed directly rather than as 1 minus the other, so p-values like keep their precision.
Worked example
z test, two-tailed. gives 0.0500 — the boundary of significance at 5 %. A right-tailed test with gives 0.0062.
t test. with 10 degrees of freedom, two-tailed: 0.0734. The same would be significant with , but not here: with only 11 observations the t distribution has heavier tails.
Chi-square. with 1 degree of freedom: 0.0500, the familiar 5 % critical value. A 3 × 3 contingency table (4 df) with gives 0.0140.
ANOVA F. with 2 and 27 degrees of freedom: 0.0258, significant at 5 %.
What a p-value is not
The American Statistical Association's 2016 statement lists the most common misreadings. A p-value is not the probability that is true, nor the probability that the result happened "by chance". It does not measure the size or importance of an effect: with a huge sample, a trivial difference gets a tiny p-value. And does not prove that there is no effect — only that the data cannot rule out .
Report the exact p-value (for example ) rather than only "", together with an effect size and a confidence interval. Decide on and on one- or two-tailed testing before looking at the data; choosing them afterwards inflates false positives.
One-tailed or two-tailed?
A two-tailed test asks whether the parameter is different from the null value in either direction; a one-tailed test only looks in one direction stated in advance. For z and t, the one-tailed p-value is half the two-tailed one when the statistic lies on the predicted side — tempting, but justified only when an effect in the opposite direction would be treated exactly like no effect.
Chi-square tests of independence or goodness of fit and ANOVA F tests are right-tailed by construction: any departure from makes the statistic larger. A left-tailed chi-square p-value is used only in special cases, such as checking whether data fit a model suspiciously well.
Frequently asked questions
How do I get a p-value from a z-score?
For a two-tailed test, p = 2 × (1 − Φ(|z|)), where Φ is the standard normal distribution function. For z = 1.96 this gives 0.0500. For a right-tailed test, p = 1 − Φ(z); for a left-tailed test, p = Φ(z).
Is p = 0.05 significant?
By the usual convention a result is significant when p ≤ α, so p = 0.05 is exactly on the boundary at α = 0.05. In practice, a value that close to the threshold is weak evidence either way and should be reported as it is.
Why do I need degrees of freedom?
The t, chi-square and F distributions are families of curves; the degrees of freedom select the member. The same t = 2.0 gives p ≈ 0.073 with 10 df but p ≈ 0.048 with 100 df.
What is the difference between the p-value and α?
α is a threshold you fix before the study — the false-positive rate you accept. The p-value comes from the data. You reject H₀ when p ≤ α.
Why does the calculator show p in scientific notation?
Very small p-values, such as 3.2 × 10⁻⁹, would round to 0.0000 with four decimals. A p-value is never exactly zero, so the calculator keeps its order of magnitude visible.
Sources
- Wasserstein RL, Lazar NA (2016), The ASA statement on p-values: context, process, and purpose, The American Statistician 70(2):129–133
- NIST Digital Library of Mathematical Functions, §8.2 Incomplete gamma functions and §8.17 Incomplete beta functions
- Press WH et al., Numerical Recipes, 3rd ed. (2007), §6.2 Incomplete gamma function and §6.4 Incomplete beta function
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.7 Tables for probability distributions
Last updated: