P-Value Calculator

Calculate a p-value from a Z or T test statistic, for one-tailed or two-tailed hypothesis tests.

How to use this calculator

  1. 1Choose Z or T depending on your test.
  2. 2Enter the test statistic (and degrees of freedom, for a T-test).
  3. 3Choose one-tailed or two-tailed based on your hypothesis — two-tailed is the more common, conservative default.

How the calculation works

Z-test: p = 1 − Φ(z) (one-tailed), 2(1 − Φ(|z|)) (two-tailed). T-test: uses the t-distribution CDF via the incomplete beta function
Φ
The standard normal cumulative distribution function
df
Degrees of freedom — for a one-sample t-test, sample size minus 1

The t-distribution's cumulative probability has no simple closed-form expression — it is computed here via the regularized incomplete beta function, evaluated with a continued fraction, which is the standard numerical method used by statistical software.

As degrees of freedom grow, the t-distribution converges to the normal distribution — a t-test with df = 1000 gives essentially the same p-value as a z-test with the same statistic.

Worked example

T = 2.228, df = 10, two-tailed

  1. 1.2.228 is the standard critical t-value for df = 10 at α = 0.05 (two-tailed) in published t-tables.
  2. 2.Computing the exact two-tailed p-value from the t-distribution gives p ≈ 0.0500 — confirming the table value.

Result: p ≈ 0.0500

What a hypothesis test is actually asking

A hypothesis test starts from a skeptical default position, called the null hypothesis — usually some version of "there is no effect" or "these two things are the same." The test asks whether the data collected is surprising enough, if that skeptical default were actually true, to cast real doubt on it. The alternative hypothesis is simply the claim being investigated instead — that there is an effect, or a difference.

A test statistic, a Z or T score, summarizes how far the observed data sits from what the null hypothesis would predict, measured in standard errors. The p-value converts that test statistic into a probability that is easier to reason about and compare against a threshold.

What a p-value is, precisely

A p-value is the probability of observing a result at least as extreme as the one actually obtained, calculated under the assumption that the null hypothesis is true. A small p-value means that, if there really were no effect, a result this extreme or more so would be unlikely to occur by chance alone — which counts as evidence against the null hypothesis, not proof against it.

One-tailed and two-tailed describe which direction counts as "extreme." A two-tailed test asks whether the result is unusual in either direction and is the more conservative, default choice. A one-tailed test only counts extremity in one predetermined direction, and should only be used when that direction was decided before looking at the data — choosing it afterward inflates the apparent significance.

Why 0.05 became the standard

A significance threshold, denoted α, is simply the line a researcher decides in advance to call "surprising enough" — 0.05 is by far the most common choice, followed by the stricter 0.01. Crossing below that threshold is conventionally labeled "statistically significant."

The 0.05 cutoff carries no special mathematical justification; it became standard largely through decades of scientific convention rather than any provably optimal value. A stricter threshold reduces the odds of a false positive but increases the odds of missing a real effect, and a looser one does the reverse — no single threshold eliminates both types of error at once.

What a p-value is not

The American Statistical Association has formally cautioned against several persistent misreadings, and they are worth stating directly. A p-value is not the probability that the null hypothesis is true, and one minus the p-value is not the probability that the alternative hypothesis is true. A p-value is not the probability that the result happened "by chance" in some general sense. And a small p-value is not, on its own, a measure of how large or practically important an effect is — a tiny, meaningless effect can still produce a very small p-value if the sample is large enough.

A result that misses the significance threshold is not proof of "no effect" either. It may simply mean the study lacked the statistical power to detect a real but modest effect — absence of evidence is not the same as evidence of absence.

Where hypothesis testing shows up

The same logic underpins decision-making well beyond academic research.

  • Clinical trialstesting whether a treatment’s effect is distinguishable from no effect at all.
  • A/B testingtesting whether a change to a product or webpage actually shifted user behavior.
  • Manufacturing and quality controltesting whether a process change actually moved a measured outcome.
  • Scientific research broadlythe standard, if increasingly debated, tool for deciding whether a result is worth taking seriously.

What this assumes, and where it stops

Assumptions

  • The test statistic was computed correctly for whichever test you are running — this calculator only converts the statistic to a p-value, it does not compute the statistic itself from raw data.

Limitations

  • A p-value says nothing about effect size or practical significance — a tiny, meaningless effect can still produce a very small p-value with a large enough sample.
  • This does not correct for multiple comparisons — running many tests and reporting only the significant ones inflates the true false-positive rate well above the nominal α.

Common questions

What does a p-value actually mean?

It is the probability of observing a result at least this extreme, assuming the null hypothesis is true. A small p-value means the observed result would be unusual if there were truly no effect — it is evidence against the null hypothesis, not a measure of how large or important the effect is, and it is not "the probability the null hypothesis is true."

Should I use a Z-test or a T-test?

Use a t-test whenever you estimate the standard deviation from your sample (the overwhelmingly common case in practice), especially with smaller samples. A z-test assumes the population standard deviation is already known, which is rare outside of large, well-characterised datasets. As sample size grows, the two converge to the same answer.

What is the difference between one-tailed and two-tailed?

A two-tailed test asks "is the result different, in either direction?" and splits your significance threshold across both tails. A one-tailed test asks "is the result specifically greater than (or specifically less than) expected?" — it should only be used when you committed to that direction before seeing the data, since choosing the tail after the fact inflates the false-positive rate.

Sources

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the p-value calculator.

See all statistics calculators →