SolveKit

P-Value Calculator (z and t)

Turn a test statistic into a p-value — two-tailed, left or right — for a z-test or a t-test with any degrees of freedom. Or enter α to get the critical value.

By Dr. Priya Nair, science writer and former university physics lecturer · Updated

P-Value Calculator

Enter any 2 known values — the others are solved as you type. Change units at any time.

Fill in the values you know.

How to use this calculator

Choose the distribution of your test statistic — Student’s t for t-tests (one-sample, paired or two-sample) or the standard normal for z-tests and large-sample tests of proportions — and the direction of the alternative hypothesis. Enter the statistic (and, for t, the degrees of freedom) and the p-value appears, with a note saying whether it is below 0.05.

To find a critical value instead, clear the statistic and enter the significance level as the p-value: with two tails, p = 0.05 and 10 df give t = 2.228. You can also clear the degrees of freedom to see how many would be needed for a given t to reach a given p.

The formula

Two-tailed: p = 2 × F(−|t|)
Right-tailed: p = 1 − F(t)
Left-tailed: p = F(t)
F = Φ for z; F = Student’s t CDF with df degrees of freedom
t / z
test statistic (t or z)
df
degrees of freedom
p
p-value

Worked example

A one-sample t-test on 16 measurements gives t = 2.131 with 15 degrees of freedom. What is the two-tailed p-value?

  1. Two-tailed: p = 2 × P(T₁₅ > |2.131|).
  2. Using the t distribution with 15 df, P(T > 2.131) = 0.025.
  3. p = 2 × 0.025 = 0.050.

The result sits exactly at the conventional 5% threshold — 2.131 is the tabulated critical value of t for 15 df.

Critical values of t (two-tailed)

dfα = 0.10α = 0.05α = 0.01
52.0152.5714.032
101.8122.2283.169
151.7532.1312.947
301.6972.0422.750
∞ (z)1.6451.9602.576

Assumptions and limits

  • The test statistic really follows the chosen distribution under the null hypothesis (e.g. approximately normal data for a t-test).
  • The Student’s t CDF is computed from the regularized incomplete beta function, accurate to about 12 significant digits; non-integer df (Welch’s test) are supported.
  • A p-value is not the probability that the null hypothesis is true, and p < 0.05 is a convention, not a law.

Frequently asked questions

Should I use a one-tailed or two-tailed test?

Use two-tailed unless you decided before seeing the data that only one direction matters. A one-tailed p-value is half the two-tailed one for the same statistic.

When should I use t instead of z?

Use t when the population standard deviation is estimated from the sample, which is almost always. With more than about 30 degrees of freedom the two give nearly the same answer.

How many degrees of freedom does my test have?

One-sample or paired t-test: n − 1. Two-sample pooled t-test: n₁ + n₂ − 2. Welch’s test uses the Welch–Satterthwaite formula, which can give a non-integer value.

Sources

Related calculators

More in Statistics calculators.