Skip to main content
ponderloop

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

Type the test statistic from your z-test or t-test. Negative values and E notation such as 1.5e-3 work. For a t statistic also give the degrees of freedom.

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

  1. Test statistic: z = 2.1, standard normal distribution.
  2. Two-tailed: p = P(|Z| ≥ |z|) = 2 × P(Z ≥ |z|). The tail beyond |z| = 2.1 has area 0.01786, doubled to 0.03573.
  3. Critical value at α = 0.05: z* = ±1.960, so the rejection region is z < −1.960 or z > 1.960.
  4. 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

The z-value that leaves the stated area in the tail, from the inverse of the normal distribution, to three decimals as in a printed table.
Significance level αConfidence level (two-tailed)Two-tailed critical value ±z*One-tailed critical value z*
0.190%±1.6451.282
0.0595%±1.9601.645
0.02597.5%±2.2411.960
0.0199%±2.5762.326
0.00599.5%±2.8072.576
0.00199.9%±3.2913.090
0.000199.99%±3.8913.719

Critical t-values by degrees of freedom

Student’s t critical values for df 1 to 30 at the two most-used levels, computed by inverting the t distribution; the last row is the z limit as df grows without bound.
Degrees of freedomTwo-tailed α = 0.05Two-tailed α = 0.01One-tailed α = 0.05One-tailed α = 0.01
1±12.706±63.6576.31431.821
2±4.303±9.9252.9206.965
3±3.182±5.8412.3534.541
4±2.776±4.6042.1323.747
5±2.571±4.0322.0153.365
6±2.447±3.7071.9433.143
7±2.365±3.4991.8952.998
8±2.306±3.3551.8602.896
9±2.262±3.2501.8332.821
10±2.228±3.1691.8122.764
12±2.179±3.0551.7822.681
15±2.131±2.9471.7532.602
20±2.086±2.8451.7252.528
25±2.060±2.7871.7082.485
30±2.042±2.7501.6972.457
∞ (z)±1.960±2.5761.6452.326

P-values for common z statistics

Right-tailed and two-tailed p-values for a z statistic, to four significant digits; a left-tailed p-value for a negative z equals the right-tailed value of its absolute value.
zRight-tailed p-value P(Z ≥ z)Two-tailed p-value P(|Z| ≥ |z|)Significant at α = 0.05 (two-tailed)?
0.50.30850.6171No
10.15870.3173No
1.280.10030.2005No
1.6450.049980.09997No
1.960.025000.05000Yes
2.3260.010010.02002Yes
2.5760.0049980.009995Yes
30.0013500.002700Yes
3.2910.00049920.0009983Yes
43.167e-56.334e-5Yes
52.867e-75.733e-7Yes

Eight worked examples

Each row is the calculator’s own answer for the statistic, tail and significance level in the row.
Test statisticTestαp-valueDecisionWhat it shows
z = 2.1Two-tailed0.050.03573Reject the null hypothesisThe calculator’s own example: significant at 5%
z = −2.33Left-tailed0.010.009903Reject the null hypothesisA left-tailed test uses the area below a negative z
z = 1.5Two-tailed0.050.1336Fail to reject the null hypothesisNot far enough from 0: fail to reject
z = 9Two-tailed0.05< 1e-16Reject the null hypothesisA far tail is shown as a bound
t = 2.2, df = 24Two-tailed0.050.03768Reject the null hypothesisThe same statistic as a z, but heavier tails
t = −1.8, df = 12Left-tailed0.050.04852Reject the null hypothesisSmall df: left-tailed and significant
t = 3.5, df = 9Right-tailed0.010.003362Reject the null hypothesisRight-tailed at the stricter 1% level
t = 0.85, df = 40Two-tailed0.050.4004Fail to reject the null hypothesisA large p-value: fail to reject

What a p-value is not

Common misreadings of a p-value and what it actually says.
MisreadingWhat 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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

Guides

More: Statistics, probability and gradesAll math & numbersAll toolsHome & DIY calculators