Written by Dackohn; last reviewed November 2026.

To calculate a p-value: (1) compute the test statistic, (2) find the area beyond it in the matching distribution, (3) double it for a two-tailed test. For z = 2.10, the area above is 0.0179, so the two-tailed p-value is .036. For t = 2.10 with 15 degrees of freedom, it is .053.

Step by step

  1. State the null hypothesis, usually “no difference”.
  2. Compute the test statistic: how many standard errors your result is from the null value. For a mean, z or t = (x̄ − μ) / SE.
  3. Choose the distribution: z if σ is known or n is large; t with the right degrees of freedom otherwise.
  4. Find the tail area beyond your statistic, using a table, software or a calculator.
  5. Double it for a two-tailed test.

Worked example: z-test

A machine should fill bottles to a mean of 500 ml, with a known SD of 10 ml. A sample of 49 bottles has a mean of 503 ml. The standard error is 10 / √49 = 1.4286, so z = 3 / 1.4286 = 2.10.

The z-table gives Φ(2.10) = 0.9821, so the upper tail is 1 − 0.9821 = 0.0179. The two-tailed p-value is 2 × 0.0179 = .036, which is significant at the 5% level.

Worked example: t-test

With 16 observations and an estimated SD, df = 15. Suppose t = 2.10 again. The t-distribution has heavier tails, so the two-tailed p-value is .053, just above .05. A one-tailed test would give .027, but only if the direction was chosen before seeing the data.

With a printed t-table you can only bracket the answer. In row 15, 2.10 lies between 1.753 (one-tail .05) and 2.131 (one-tail .025), so the two-tailed p-value is between .05 and .10.

In Excel or Google Sheets

StatisticTwo-tailed formula
z=2*(1-NORM.S.DIST(ABS(z),TRUE))
t=T.DIST.2T(ABS(t),df)
Chi-square (right-tailed)=CHISQ.DIST.RT(x,df)
F (right-tailed)=F.DIST.RT(x,df1,df2)

How to read it

The p-value is the probability of a result at least this extreme if the null hypothesis is true. It is not the probability that the null hypothesis is true. See how to interpret a p-value.

Common mistakes

Try it yourself

P-Value Calculator →Get the exact p-value from z, t, chi-square, F or r. T-Test Calculator →Run the whole test from your raw data.

Frequently asked questions

How do you calculate a p-value by hand?

Compute the test statistic, look up the area beyond it in a z or t table, and double it for a two-tailed test. Tables usually give only a range for t.

What is the p-value for z = 1.96?

The two-tailed p-value is .05, and the one-tailed value is .025.

How do I get a p-value from a t statistic in Excel?

Use =T.DIST.2T(ABS(t), df) for a two-tailed test or =T.DIST.RT(t, df) for the right tail.

Related reading: How to interpret a p-value · One-tailed vs two-tailed tests · T-test vs z-test


Sources & further reading: NIST/SEMATECH e-Handbook of Statistical Methods · OpenStax Introductory Statistics. How we compute & validate: methodology. Written & reviewed by Dackohn; last reviewed August 2026.