Menu

P-Value Calculator

From a z, t or chi-square statistic to its p-value, with the tail drawn and the decision explained.

By Nethanel Bar, Co-founder & CEO

Last updated

Want to solve these without the calculator?

The Coddy math course teaches the method itself - you work each step on an interactive board and get told exactly where a move went wrong.

A p-value is an area, and this page draws it

A p-value answers one narrow question: if the null hypothesis were true, how often would a statistic at least this extreme turn up? That "how often" is an area under a curve, and the curve depends on the statistic. A z-score lives on the standard normal curve, a t statistic on the heavier-tailed t curve for its degrees of freedom, and a chi-square statistic on a curve that starts at zero and only has a right tail. Most calculators give you the number; this page shades the area the number stands for, because a p-value you can see is a p-value you can explain.

The choice of tails is the part students lose marks on. A two-tailed test asks whether the statistic is extreme in either direction, so the area is taken on both sides and, by symmetry, doubled. A one-tailed test asks about one direction only. The chi-square test is always right-tailed, because a large statistic means a bad fit and a small one means a good fit in either direction. Set the tails to match the hypothesis you actually wrote down before looking at the data.

Beside the p-value the page lists the critical value at 0.10, 0.05, 0.01 and 0.001, so you can also make the decision the older way, by comparing the statistic with a table entry. The two routes always agree: p is below alpha exactly when the statistic is beyond the critical value. Seeing both at once is what makes the equivalence obvious. The far tails are computed directly rather than as one minus a rounded number, so a p-value of one in a hundred million prints as what it is instead of collapsing to zero.

What to know about p-values

  • A p-value is not the probability that the null hypothesis is true, and not the probability that the result is a fluke. It is the probability of data this extreme, computed assuming the null.
  • Significance is a threshold you chose in advance. The same p of 0.03 is significant at 0.05 and not at 0.01; the number did not change, your standard did.
  • Two tails cost twice as much. A z of 1.96 gives p = 0.05 two-tailed and p = 0.025 one-tailed. Choosing one tail after seeing the sign of the result is cheating.
  • The t curve has fatter tails than the normal curve, so the same statistic gives a larger p at small degrees of freedom. By df = 30 the two are close; by df = 1000 they are the same to two decimals.
  • A chi-square p-value is always the right tail. There is no such thing as a two-tailed chi-square test of fit.

How to find a p-value from a test statistic

  1. Identify the statistic

    A z-score comes from a normal model or a large-sample proportion test. A t statistic comes from a t-test on means and carries degrees of freedom. A chi-square statistic comes from a contingency table or a goodness-of-fit test and also carries degrees of freedom.

  2. Decide the tails from the hypothesis

    "Different from" is two-tailed. "Greater than" is right-tailed, "less than" left-tailed. Chi-square is right-tailed by nature.

  3. Find the area beyond the statistic

    That area, on the right curve, is the p-value. For a two-tailed test take the area beyond the absolute value on one side and double it.

  4. Compare with alpha, or with the critical value

    p below alpha means significant. Equivalently, the statistic beyond the critical value at that alpha means significant. Both are shown; they never disagree.

Critical values at a glance

The statistic a two-tailed test (or a right-tailed chi-square) must reach to be significant.

Testα = 0.10α = 0.05α = 0.01
z, two-tailed1.6451.9602.576
t, df = 10, two-tailed1.8122.2283.169
t, df = 30, two-tailed1.6972.0422.750
chi-square, df = 12.7063.8416.635
chi-square, df = 47.7799.48813.277

Worked examples

z = 1.96, two-tailed

plain
z = 1.96

The area to the right of 1.96 on the normal curve is 0.025; doubled for two tails it is 0.05. This is the boundary case: exactly significant at the 5% level, which is why 1.96 is the number everyone remembers.

t = 2.5 with 12 degrees of freedom

plain
t = 2.5, df = 12

On the t curve with 12 degrees of freedom the two-tailed p is about 0.028. On the normal curve the same 2.5 would give 0.012; the t curve's fatter tails make the same statistic less impressive when the sample is small.

Chi-square = 7.8 with 3 degrees of freedom

plain
χ² = 7.8, df = 3

The right tail beyond 7.8 has area about 0.050, so the result sits right at the 5% boundary. The critical value at 0.05 for 3 degrees of freedom is 7.815, and 7.8 falls just short of it, which is the same decision read the other way.

P-value mistakes

  • Reading a p-value as the chance the null is true. It is the chance of the data given the null, which is a different conditional.
  • Choosing the tails after seeing the result. If the hypothesis said "different", the test is two-tailed even when the result went the way you hoped.
  • Using the normal curve for a small-sample t statistic. Below about 30 degrees of freedom the difference matters, and it always makes the real p larger.
  • Treating p = 0.049 and p = 0.051 as different worlds. They are the same evidence; only the threshold separates them.
  • Reporting p = 0.000. A p-value is never zero. Report p < 0.001, or the actual tiny number this page prints.
  • Forgetting the degrees of freedom. A t or chi-square statistic without its df has no p-value at all.

P-value FAQ

How do I calculate a p-value from a z-score?
Find the area under the standard normal curve beyond the z-score. For a right-tailed test that is the area to the right of z; for a two-tailed test, take the area beyond the absolute value of z and double it. A z of 2.0 gives a one-tailed p of 0.0228 and a two-tailed p of 0.0455. Type the z above and the page shades the area it is reporting.
What is the difference between a one-tailed and a two-tailed p-value?
A two-tailed p-value counts extreme results in both directions, so it is twice the one-tailed value for a symmetric curve. Use two tails when the hypothesis is "different from", one tail when it is "greater than" or "less than" and that direction was fixed before the data was seen.
Is p = 0.05 significant?
At the 5% level, a p-value has to be below 0.05, so exactly 0.05 sits on the boundary and most conventions call it not significant. In practice the difference between 0.049 and 0.051 is no evidence at all; report the number itself and let the reader see how close it is.
How do I get a p-value from a t statistic?
You need the degrees of freedom as well as t. The p-value is the area under the t curve with that many degrees of freedom beyond the statistic, doubled for a two-tailed test. For a one-sample or paired test the degrees of freedom are n minus 1; for a pooled two-sample test they are n1 plus n2 minus 2.
Why is the chi-square test always right-tailed?
Because the chi-square statistic measures total distance between observed and expected counts, and distance is never negative. A large statistic means the observed counts are far from what the null predicts; a small one means they are close. Only the large side is evidence against the null, so only the right tail is counted.
What does a p-value of 0.0001 mean?
That data this extreme would show up about once in ten thousand times if the null hypothesis were true. It is strong evidence against the null. It says nothing about how large the effect is, which is what a confidence interval is for.
Can I get a p-value without a test statistic?
Not on this page. You need to have run a test already and have its z, t or chi-square value. If you have the raw data instead, use the t-test calculator for means or the chi-square calculator for counts; both compute the statistic and the p-value together.

More math tools

Coddy programming languages illustration

Learn math with Coddy

GET STARTED