P-Value Calculator
A z statistic of 2.1 in a two-tailed test has a p-value of 0.03573. That is at or below the usual significance level α = 0.05, so you reject the null hypothesis; at α = 0.01 the same result would fail to reject it. The p-value is the probability, if the null hypothesis is true, of a test statistic at least as extreme as the one you observed: here each tail beyond |z| = 2.1 holds 0.01786, and a two-tailed test counts both. Enter your own z or t statistic (with its degrees of freedom), pick a left, right or two-tailed test and your α, or switch to critical values to get the cut-off for a significance level.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
Two-tailed z-test, z = 2.1
P-value 0.03573
p = 0.03573 is at or below α = 0.05, so reject the null hypothesis: the result is statistically significant at the 5% level.
- P-value
- 0.03573
- Left-tail area P(Z ≤ z)
- 0.9821
- Right-tail area P(Z ≥ z)
- 0.01786
- Two-tailed P(|Z| ≥ |z|)
- 0.03573
- Significance level α
- 0.05 (5%)
- Critical value z* at α
- ±1.960
- Decision
- Reject the null hypothesis
Choose the tail and α before looking at the data. A p-value is not the probability that the null hypothesis is true.
The working
- Test statistic: z = 2.1, standard normal distribution.
- Two-tailed: p = P(|Z| ≥ |z|) = 2 × P(Z ≥ |z|). The tail beyond |z| = 2.1 has area 0.01786, doubled to 0.03573.
- Critical value at α = 0.05: z* = ±1.960, so the rejection region is z < −1.960 or z > 1.960.
- p = 0.03573 is at or below α = 0.05, so reject the null hypothesis: the result is statistically significant at the 5% level.
Critical z-values for common significance levels
| Significance level α | Confidence level (two-tailed) | Two-tailed critical value ±z* | One-tailed critical value z* |
|---|---|---|---|
| 0.1 | 90% | ±1.645 | 1.282 |
| 0.05 | 95% | ±1.960 | 1.645 |
| 0.025 | 97.5% | ±2.241 | 1.960 |
| 0.01 | 99% | ±2.576 | 2.326 |
| 0.005 | 99.5% | ±2.807 | 2.576 |
| 0.001 | 99.9% | ±3.291 | 3.090 |
| 0.0001 | 99.99% | ±3.891 | 3.719 |
Critical t-values by degrees of freedom
| Degrees of freedom | Two-tailed α = 0.05 | Two-tailed α = 0.01 | One-tailed α = 0.05 | One-tailed α = 0.01 |
|---|---|---|---|---|
| 1 | ±12.706 | ±63.657 | 6.314 | 31.821 |
| 2 | ±4.303 | ±9.925 | 2.920 | 6.965 |
| 3 | ±3.182 | ±5.841 | 2.353 | 4.541 |
| 4 | ±2.776 | ±4.604 | 2.132 | 3.747 |
| 5 | ±2.571 | ±4.032 | 2.015 | 3.365 |
| 6 | ±2.447 | ±3.707 | 1.943 | 3.143 |
| 7 | ±2.365 | ±3.499 | 1.895 | 2.998 |
| 8 | ±2.306 | ±3.355 | 1.860 | 2.896 |
| 9 | ±2.262 | ±3.250 | 1.833 | 2.821 |
| 10 | ±2.228 | ±3.169 | 1.812 | 2.764 |
| 12 | ±2.179 | ±3.055 | 1.782 | 2.681 |
| 15 | ±2.131 | ±2.947 | 1.753 | 2.602 |
| 20 | ±2.086 | ±2.845 | 1.725 | 2.528 |
| 25 | ±2.060 | ±2.787 | 1.708 | 2.485 |
| 30 | ±2.042 | ±2.750 | 1.697 | 2.457 |
| ∞ (z) | ±1.960 | ±2.576 | 1.645 | 2.326 |
P-values for common z statistics
| z | Right-tailed p-value P(Z ≥ z) | Two-tailed p-value P(|Z| ≥ |z|) | Significant at α = 0.05 (two-tailed)? |
|---|---|---|---|
| 0.5 | 0.3085 | 0.6171 | No |
| 1 | 0.1587 | 0.3173 | No |
| 1.28 | 0.1003 | 0.2005 | No |
| 1.645 | 0.04998 | 0.09997 | No |
| 1.96 | 0.02500 | 0.05000 | Yes |
| 2.326 | 0.01001 | 0.02002 | Yes |
| 2.576 | 0.004998 | 0.009995 | Yes |
| 3 | 0.001350 | 0.002700 | Yes |
| 3.291 | 0.0004992 | 0.0009983 | Yes |
| 4 | 3.167e-5 | 6.334e-5 | Yes |
| 5 | 2.867e-7 | 5.733e-7 | Yes |
Eight worked examples
| Test statistic | Test | α | p-value | Decision | What it shows |
|---|---|---|---|---|---|
| z = 2.1 | Two-tailed | 0.05 | 0.03573 | Reject the null hypothesis | The calculator’s own example: significant at 5% |
| z = −2.33 | Left-tailed | 0.01 | 0.009903 | Reject the null hypothesis | A left-tailed test uses the area below a negative z |
| z = 1.5 | Two-tailed | 0.05 | 0.1336 | Fail to reject the null hypothesis | Not far enough from 0: fail to reject |
| z = 9 | Two-tailed | 0.05 | < 1e-16 | Reject the null hypothesis | A far tail is shown as a bound |
| t = 2.2, df = 24 | Two-tailed | 0.05 | 0.03768 | Reject the null hypothesis | The same statistic as a z, but heavier tails |
| t = −1.8, df = 12 | Left-tailed | 0.05 | 0.04852 | Reject the null hypothesis | Small df: left-tailed and significant |
| t = 3.5, df = 9 | Right-tailed | 0.01 | 0.003362 | Reject the null hypothesis | Right-tailed at the stricter 1% level |
| t = 0.85, df = 40 | Two-tailed | 0.05 | 0.4004 | Fail to reject the null hypothesis | A large p-value: fail to reject |
What a p-value is not
| Misreading | What the p-value actually says |
|---|---|
| “p = 0.03573 means there is a 3.573% chance the null hypothesis is true.” | The p-value is computed by assuming the null hypothesis is true. It is the probability of data this extreme given the null hypothesis, not the probability of the null hypothesis given the data. |
| “It is the probability the result happened by chance.” | It is the probability of a result at least this extreme under one specific model (the null hypothesis plus the test’s assumptions). A different model, or a broken assumption, changes it. |
| “A p-value above α proves there is no effect.” | It means the sample did not give enough evidence against the null hypothesis. A small sample can miss a real difference, so you fail to reject; you do not accept the null hypothesis. |
| “A small p-value means a large or important effect.” | The p-value mixes effect size with sample size. A huge sample can give a tiny p-value for a trivial difference, and a small sample a large one for a big difference. Report the effect size and an interval too. |
| “A p-value just below α and one just above it are opposite findings.” | α is a convention chosen in advance. Two p-values on either side of it carry almost the same evidence; report the p-value itself, not only the verdict. |
| “The p-value is the chance of a false positive.” | The false-positive (type I error) rate you accept is α, fixed before the data. The p-value is what the data gave, and it can be used only in comparison with α. |
| “1 − p is the probability the finding will replicate.” | Nothing in the p-value says how likely another sample is to give the same verdict. |
How to find a p-value from a test statistic
- State the hypotheses and choose the tail. Write the null hypothesis and the alternative before looking at the data. “Different from” means a two-tailed test; “less than” is left-tailed and “greater than” is right-tailed. The example is two-tailed.
- Compute the test statistic. For a z-test use z = (x̄ − μ₀) ÷ (σ ÷ √n) when the population standard deviation σ is known; for a t-test use t = (x̄ − μ₀) ÷ (s ÷ √n) with s from the sample and n − 1 degrees of freedom. A z-score calculator or standard deviation calculator can give the ingredients.
- Enter the statistic. Pick z or t in the calculator, type the statistic (2.1 in the example) and, for t, the degrees of freedom. Choose the tail that matches your alternative.
- Read the p-value. The calculator shows the p-value for your tail (0.03573 here) and all three tail areas: left 0.9821, right 0.01786 and two-tailed 0.03573. The working lists the formula it used.
- Compare with α and state the conclusion. With α = 0.05, 0.03573 is below it, so reject the null hypothesis. If the p-value had been above α (for example z = 1.5 gives 0.1336), the conclusion would be to fail to reject it, never to accept it.
Frequently asked questions
- What is a p-value?
- A p-value is the probability, assuming the null hypothesis is true, of getting a test statistic at least as extreme as the one you observed. A small p-value means data like yours would be unusual if the null hypothesis were true, which is evidence against it. For z = 2.1 in a two-tailed test the p-value is 0.03573: if the null hypothesis were true, about 3.57 in 100 samples would give a statistic at least that far from 0 in either direction.
- How do I find the p-value from a z-score?
- Look up the area in the tail of the standard normal curve beyond your z. For a right-tailed test it is P(Z ≥ z), for a left-tailed test P(Z ≤ z), and for a two-tailed test twice the area beyond |z|. For z = 2.1 the area beyond is 0.01786, so the right-tailed p-value is 0.01786, the left-tailed one is 0.9821 and the two-tailed one is 0.03573. The calculator computes the area with an erfc approximation instead of a printed table, so it works for any z, not only two decimals.
- How do I find the p-value from a t statistic?
- Choose t, type the statistic and the degrees of freedom (n − 1 for a one-sample test; Welch’s approximate df, which need not be a whole number, for two samples with unequal variances). The t distribution has heavier tails than the normal, so the same statistic gives a larger p-value: t = 2.2 with 24 degrees of freedom gives 0.03768 two-tailed, against 0.02781 for z = 2.2. As the degrees of freedom grow the t distribution approaches the normal one.
- Should I use a one-tailed or a two-tailed p-value?
- Use two-tailed when the alternative is simply “different” and an unusually high or unusually low statistic would both count against the null hypothesis, and one-tailed only when you decided in advance that one direction is the only one of interest. For z = 2.1 the two-tailed p-value is 0.03573 and the right-tailed one is 0.01786, exactly half. Picking the tail after seeing the data inflates the false-positive rate. If the statistic falls on the wrong side of a one-tailed alternative the p-value is above 0.5 (z = −2.1 right-tailed gives 0.9821).
- What significance level α should I use?
- α is the false-positive rate you are willing to accept when the null hypothesis is true, and you set it before collecting data. 0.05 is the common default, 0.01 is stricter and 0.10 more lenient; the right choice depends on how costly a wrong rejection is in your field. The p-value 0.03573 passes α = 0.05 but not α = 0.01, which shows why α must be chosen first rather than tuned to the result.
- What does “fail to reject the null hypothesis” mean, and why not “accept”?
- A test can only show that the data are unlikely under the null hypothesis. When the p-value is above α the data are not unlikely enough, so you fail to reject it, as for z = 1.5 (p = 0.1336, α = 0.05) or t = 0.85 with 40 degrees of freedom (p = 0.4004). That is not evidence the null hypothesis is true: the sample may simply be too small to detect a real difference. “Accept” overstates what a non-significant result shows, so the calculator always words it as fail to reject.
- What is a p-value not telling me?
- It is not the probability that the null hypothesis is true, not the probability that the result was due to chance, not the size or importance of an effect, and not a measure of whether a result will replicate. The table above lists the common misreadings. A p-value only measures how surprising the statistic is under one model, so check the assumptions of the test and report the effect size and an interval with it.
- Which z gives a p-value of exactly 0.05?
- For a two-tailed test the cut-off is z = 1.960, more exactly 1.95996; the rounded z = 1.96 gives p = 0.0499958, just under 0.05. For a right-tailed test the cut-off is z = 1.645. Any statistic farther from 0 than these cut-offs has p below 0.05. For t the cut-off depends on the degrees of freedom: 2.064 with 24, as the critical value table shows.
- What is the critical value approach and does it give the same answer?
- Instead of comparing a p-value with α you compare the statistic with the critical value, the cut-off with area α in the tail. For a two-tailed z-test at α = 0.05 the cut-offs are ±1.960, so z = 2.1 is beyond it and you reject; the p-value gives the same decision because the p-value is below α exactly when the statistic is past the critical value. For a right-tailed z-test at α = 0.05 the cut-off is 1.645 and for a two-tailed t-test with 24 degrees of freedom it is ±2.064. The critical value mode of the calculator gives these for any α and df.
- Why does the calculator show “p < 1e-16” for some statistics?
- A far-tail probability, such as the two-tailed p-value of z = 9 (2.257e-19), is computed but means little: real data never follow the normal model that precisely that far out, so the exact digits are not worth reporting. Values below 1e-16 are shown as a bound, and the full figure stays in the scientific-notation row. Below 1e-300 the tail underflows and the bound “< 1e-300” is shown. Statistics in the usual range keep the digits you choose, such as 2.867e-7 for z = 5 right-tailed.
- When should I use z and when t?
- Use z when the population standard deviation is known, or for large-sample tests on proportions where the normal approximation is standard. Use t when the standard deviation is estimated from the sample, which is the usual case for means; the smaller the sample, the more t differs from z. Chi-square, F and exact tests need their own distributions, which this calculator does not cover.
- Does the sample size change the p-value?
- Yes, through the test statistic. For a fixed difference from the null value, a larger sample gives a larger |z| or |t| and so a smaller p-value, which is why a very large sample can make a trivial difference “significant”. The p-value alone says nothing about whether the difference matters in practice; pair it with the size of the difference and a confidence interval.
How it works
Normal tails: the survival function of the standard normal is Q(z) = ½ erfc(z ÷ √2). erfc is computed with W. J. Cody’s rational Chebyshev approximations (Mathematics of Computation 23, 1969), which keep their relative accuracy far into the tail instead of subtracting from 1; tested against mpmath, the relative error is below 1e-12 for every z up to 37.5, down to probabilities near 1e-308. Student t tails: for t ≥ 0 and ν degrees of freedom, P(T > t) = ½ I_x(ν ÷ 2, ½) with x = ν ÷ (ν + t²), the regularized incomplete beta function evaluated by the modified Lentz continued fraction of Numerical Recipes, with ln Γ from the Lanczos approximation and, for large ν, from Stirling’s series written as a difference so that no large numbers cancel. Tested against mpmath the relative error is below 1e-13 for up to 1,000 degrees of freedom, below 1e-12 at 100,000 and below 1e-10 at 10,000,000, which is the limit the calculator accepts. Definitions: left-tailed p = P(S ≤ s); right-tailed p = P(S ≥ s); two-tailed p = P(|S| ≥ |s|) = 2 × the smaller tail, for the symmetric z and t distributions. The null hypothesis is rejected when p ≤ α; otherwise the calculator says it fails to reject. Critical values are the inverses: for the normal distribution Peter Acklam’s rational approximation refined by one Halley step; for t Newton’s method kept inside a bracket and started from the Cornish-Fisher expansion (Abramowitz and Stegun 26.7.5), with closed forms for 1 and 2 degrees of freedom. Critical values agree with mpmath to better than 1e-11. Display: p-values are shown to the digits you pick, in fixed notation from 0.0001 and in scientific notation below; values under 1e-16 are shown as a bound. Degrees of freedom may be any number from 1 to 10,000,000 so that Welch’s approximation can be used. Everything is computed in double-precision arithmetic in your browser. The page is a calculating aid: the choice of test, its assumptions and the interpretation of a p-value remain with the person using it.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.7.2 Critical values of the Student’s t distribution
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.7.1 Cumulative distribution function of the standard normal distribution
- R. L. Wasserstein and N. A. Lazar, The ASA statement on p-values: context, process, and purpose, The American Statistician 70 (2016)
- W. J. Cody, Rational Chebyshev approximations for the error function, Mathematics of Computation 23 (1969)
- Peter J. Acklam, An algorithm for computing the inverse normal cumulative distribution function
- P-value, Wikipedia
- Student’s t-distribution, Wikipedia
- Incomplete beta function, Wikipedia
Guides
- What Is a P-Value? Meaning, Examples and Common MistakesA p-value is the probability of data at least this extreme if the null hypothesis were true, not the chance the null is true. z-test and t-test examples.
More free tools
- Confidence Interval CalculatorConfidence interval for a mean (z or t, from summary stats or a list) or a proportion (Wald, Wilson), with margin of error, standard error and the working.
- Sample Size CalculatorFind the sample size for a survey from confidence level, margin of error and expected proportion, with finite population correction, or the margin from n.
- Z-Score CalculatorFind a z-score from a value, mean and SD or a list of numbers, with percentile, left-tail, right-tail and two-tailed probability and a normal curve.
- Normal Distribution CalculatorNormal distribution probabilities from a mean and standard deviation: below, above, between two values, outside a range, or the value at a percentile.
- Chi-Square CalculatorChi-square test of independence or goodness of fit from your counts: statistic, p-value, expected counts, Cramér’s V and critical values at your alpha.
- Binomial Distribution CalculatorBinomial probability P(X = k), P(X ≤ k) and P(X ≥ k) for up to 1,000 trials, with mean, standard deviation, mode, exact fractions and a bar chart.
More: Statistics, probability and gradesAll math & numbersAll toolsHome & DIY calculators