T Statistic P Value Calculator
You ran the t-test in R, Python, Excel, or SPSS and now you are holding a t-statistic and a degrees-of-freedom number, but no p-value. This calculator takes those two numbers and returns the exact p-value for a two-tailed, left-tailed, or right-tailed test, with a plain-language significance verdict at the alpha you choose. It also packs a critical t-value finder and a z-test mode, so the post-hoc question and the planning question live on one page.
Exact tail probability via the regularized incomplete beta function, matching R and SciPy to about six decimals. Degrees of freedom must be a whole number of 1 or more. A p-value is evidence against the null hypothesis, not the probability that the null is true.
Quick Answer
A t-statistic of 2.5 with 20 degrees of freedom, tested two-tailed at α = 0.05, gives p = 0.021234: reject the null hypothesis, with strong evidence against it. The same t run left-tailed (hypothesis: the effect is smaller) gives p = 0.9894, a fail to reject, because the statistic points the wrong way for that hypothesis. The calculator above is pre-filled with this example; change the inputs and click Calculate for your own numbers.
Key takeaways
- This page is for the post-hoc moment: you already ran the test in R, Python, Excel, or SPSS and have t and df. If you need to run the test itself from data, use the t-statistic calculator first.
- One-tailed p-values are directional: P(T ≤ t) for left, P(T ≥ t) for right. A statistic pointing the wrong way gives a large p, not half the two-tailed value.
- Two-tailed p = twice the one-tail area on the statistic’s side. Three modes are built in: p-value, critical t-value finder, and z-test.
- The tail probability is computed exactly with the regularized incomplete beta function, no table lookup, accurate to about six decimals (verified against R and SciPy).
- A p-value is evidence against the null, never the probability that the null is true.
- Quick Answer
- How to use the t-statistic p-value calculator
- How the exact p-value is computed
- Worked example: t = 2.5, df = 20
- Choosing the tail: two, left, or right
- Reading the verdict: the four evidence bands
- What competing calculators miss
- The other two modes: critical values and the z-test
- What a p-value is not
- Frequently asked questions
- Add This Calculator to Your Website
- References
How to use the t-statistic p-value calculator
Two numbers in, one verdict out. The result stays hidden until you calculate, and the worked example is pre-filled so you can see a real run before touching anything.
- Pick the mode. Leave it on “t-statistic to p-value” for the post-hoc conversion. Switch to “Critical t-value finder” when you want the rejection threshold before running the test, or “z-test” when you have a z-score from the normal distribution.
- Enter the t-statistic from your software output (the example uses 2.5). Any number works, positive or negative.
- Enter the degrees of freedom as a whole number (20 in the example; usually n − 1 for a one-sample test). The degrees-of-freedom field hides itself in z-test mode because the normal distribution has no df.
- Choose the test type and alpha. Two-tailed is the default; left- and right-tailed must match the hypothesis you wrote before seeing the data. Alpha defaults to 0.05.
- Click Calculate. The big number is the p-value, the rows below show the two-tailed and one-tailed values side by side, and the badge states the verdict in words.
Blank or non-numeric entries are stopped with a message before any math runs: a missing t-statistic (“Enter a t-statistic (any number, positive or negative).”), a missing df (“Enter the degrees of freedom.”), df below 1 (“Degrees of freedom must be 1 or more.”), and fractional df (“Degrees of freedom must be a whole number.”).
How the exact p-value is computed
The two-tailed p-value is the probability of a t at least this extreme under the null: P(|T| ≥ |t|). The calculator evaluates it with the regularized incomplete beta function, the same route R and SciPy take internally, instead of looking it up in a table. That is why df = 137 or α = 0.03 work here while a printed table gives up.
Left-tailed: p = P(T ≤ t) Right-tailed: p = P(T ≥ t)
Critical t (bisection): find t* with P(T > t*) = α/2 (two-tailed) or α (one-tailed)
The same answers in the tools you may already use: Excel’s =T.DIST.2T(2.5,20) returns 0.0212; in R, 2*pt(-2.5, 20); in Python, 2*scipy.stats.t.sf(2.5, 20); on a TI-84, tcdf(-99, -2.5, 20)*2 after 2nd → DISTR. For the critical value, Excel’s =T.INV.2T(0.05, 20) returns 2.086, and =T.INV(0.05, 20) returns 1.725 for the one-sided boundary. The calculator reproduces all of these to the displayed decimals.
Worked example: t = 2.5, df = 20
A one-sample test on 21 observations gives t = 2.5, so df = 20. Those two figures are pre-filled in the calculator. Run it and the tool returns 0.021234, the two-tailed and one-tailed rows, and the verdict.
More real runs of this calculator, so you can type any pair in and check the figures:
| Inputs | Two-tailed p | One-tailed p | Verdict at α = 0.05 |
|---|---|---|---|
| t = 2.5, df = 20 | 0.021234 | 0.010617 | Reject, strong evidence |
| t = −0.527, df = 9 | 0.610935 | 0.305467 | Fail to reject |
| t = 12.706, df = 1 | 0.050001 | 0.025000 | Fail to reject (just misses) |
| t = −3.0, df = 5, α = 0.01 | 0.030099 | 0.015050 | Fail to reject at 0.01, strong evidence |
| t = 25, df = 20 | 1.47e−16 | 7.34e−17 | Reject, very strong evidence |
The df = 1 row is the stress case every table-based tool gets wrong by interpolation: with one degree of freedom the t-distribution has enormous tails, so even t = 12.706 lands at p = 0.050001, a hair above the 0.05 line. And the t = 25 row shows the scientific-notation format the calculator switches to below 0.0000005.
Choosing the tail: two, left, or right
The tail is not a display preference; it is the hypothesis. Two-tailed asks “different in either direction” and splits the skepticism across both tails. Left-tailed asks “smaller” and reads only P(T ≤ t); right-tailed asks “larger” and reads only P(T ≥ t). The tail must match the hypothesis you registered before looking at the data, never the direction the data happened to go.
That directionality is where cheap tools quietly mislead. The shortcut “one-tailed is half the two-tailed” is only true when the statistic points the way your hypothesis predicted. Run t = 2.5, df = 20 left-tailed here and you get 0.9894, not 0.0106: the hypothesis said “smaller” and the data said “larger,” so the evidence points the wrong way and the test correctly fails to reject. A tool that blindly halves would report 0.0106 and declare significance, a false discovery. This calculator computes the actual directional probability, the same number Excel’s T.DIST.RT, R’s pt, and SciPy return.
Reading the verdict: the four evidence bands
After the comparison with alpha, the calculator grades the p-value itself on four bands. The band describes the strength of the evidence; alpha alone decides reject or not. A p of 0.049 and a p of 0.0001 both reject at 0.05, but they are not the same quality of evidence, and the band says so.
| Band | Range | What it tells you |
|---|---|---|
| Very strong | p < 0.01 | A result this extreme would happen less than 1 time in 100 under the null. Report the exact p. |
| Strong | 0.01 ≤ p < 0.05 | The worked example lands here. Significant at 0.05 but not at 0.01. |
| Weak | 0.05 ≤ p < 0.10 | Suggestive but not significant at the conventional 0.05. Report it, do not upgrade it. |
| Little or no | p ≥ 0.10 | The data are compatible with the null. This is not proof the null is true. |
What competing calculators miss
The t-statistic-to-p-value tools ranking today split into camps, and each has a real gap:
- Pearson’s P-Value Calculator (Z, t, chi-square, F): the strongest rival: four distributions, step-by-step working, a mini visualization, and a decision helper. Its gaps are precision (no exact-to-six-decimals readout) and scope (no critical-value finder on the same page).
- StatGarden’s t-test calculator: carries the whole test from raw data through the verdict, honestly built. Its gap is the opposite direction from this page: you cannot use it post-hoc, because it needs the sample data, not the t-statistic you already computed.
- Tutorial pages (Sophia, Sorumatik, ArabPsychology guides): solid teaching of the TI-84 tcdf route, the Excel T.DIST functions, and R/Python code. Useful once, but you still do the arithmetic by hand every time, and none of them warns about the one-tailed direction trap.
- The gap this page fills: the exact post-hoc conversion with no table and no interpolation, three modes in one tool, the directional one-tailed p-value that refuses to hand you a false discovery, and a verdict badge that states reject or fail in plain words instead of making you compare decimals to alpha yourself.
The other two modes: critical values and the z-test
The critical t-value finder answers the planning question: pick df and alpha once, get the threshold (2.0860 for df = 20 at α = 0.05 two-tailed), then compare every t from your analysis against it without recomputing p-values. The dedicated t critical value calculator goes deeper, with a sample-size input, the z comparison, and a live mini t-table.
The z-test mode is for when the population standard deviation is known or the sample is large enough that the normal approximation is honest (df above 30 is the textbook rule). It reads the p-value from the standard normal CDF instead of the t-distribution. The same direction rule applies: z = 2 left-tailed gives 0.9773, a correct fail to reject, where a halving tool would claim 0.0228.
What a p-value is not
Three misunderstandings survive every stats course, and the American Statistical Association’s 2016 statement on p-values addressed all of them. A p-value is not the probability that the null hypothesis is true; it is the probability of data this extreme given that the null is true. It is not the probability that your result was “due to chance” in any absolute sense; it is computed entirely inside a model that assumes chance alone. And 0.05 is not a law of nature: it is a convention, and the evidence bands above exist precisely because a p of 0.049 and a p of 0.0001 tell very different stories while both clearing the same bar. When the verdict badge says “fail to reject,” it means the data did not clear your bar, not that the null was proven. When you write up the result, pair the p-value with an interval estimate: the confidence interval calculator builds it from your sample statistics.
Frequently asked questions
Enter the t-statistic and its degrees of freedom, pick the tail that matches your hypothesis, and click Calculate. The calculator evaluates the t-distribution tail exactly with the incomplete beta function, so t = 2.5 with df = 20 two-tailed gives p = 0.021234, no table lookup involved.
Use one-tailed only when your research hypothesis predicts a direction before you see the data: “the new process is faster” (right-tailed) or “the defect rate is lower” (left-tailed). Two-tailed is the default for “different in either direction.” Never pick the tail after looking at which way the data went.
Only when the t-statistic points the way your hypothesis predicted. The one-tailed p is the actual directional probability, P(T ≤ t) for left or P(T ≥ t) for right. With t = 2.5 and df = 20 left-tailed, the correct p is 0.9894, because the statistic contradicts the “smaller” hypothesis. Halving blindly would report 0.0106 and wrongly reject the null.
In Excel, =T.DIST.2T(2.5,20) gives the two-tailed p-value and =T.DIST.RT(2.5,20) the right-tailed one. In R, 2*pt(-2.5, 20) is the two-tailed value. In Python, 2*scipy.stats.t.sf(2.5, 20) matches. All three agree with this calculator to the displayed decimals.
Use the z-test mode when the population standard deviation is known, or when the sample is large enough (df above 30 is the textbook rule) that the normal approximation is honest. For small samples with an estimated standard deviation, stay with the t modes.
The t-value whose tail probability equals your alpha. For a two-tailed test at alpha 0.05 with 20 degrees of freedom it is 2.0860: any |t| beyond it rejects the null. Switch the calculator to critical mode for the threshold, or use the dedicated t critical value calculator for the full table treatment.
It means that if the null hypothesis were true, data this extreme would occur about 4% of the time. It does not mean there is a 4% chance the null is true, and it does not measure the size or importance of the effect. Report the exact p-value alongside your estimate and confidence interval.
Degrees of freedom set the shape of the t-distribution, and the parameter comes from counting (usually n − 1), so it is an integer by construction. The calculator rejects fractional df rather than silently rounding, because rounding df changes the tail probability.
Add This Calculator to Your Website
Embed this calculator on your own site with the code below. Pick a size to preview it live, then copy the code.
Powered by Calculator Zilo
References
- NIST/SEMATECH. e-Handbook of Statistical Methods: Two-Sample t-Test for Equal Means (t-test procedure, test statistic, and the p-value decision rule). Accessed October 24, 2026.
- R Project for Statistical Computing. The Student t Distribution: pt, qt, dt, rt (distribution function pt and quantile function qt, the reference implementation this calculator’s tail math is checked against). Accessed October 24, 2026.
- SciPy Community. scipy.stats.t: Student’s t continuous random variable (cdf/sf/ppf methods; the sf survival function is the one-tailed tail this tool computes). Accessed October 24, 2026.
- Microsoft Support. T.DIST.2T function (Excel’s two-tailed t-distribution function, with the df ≥ 1 and integer-degree-of-freedom requirements). Accessed October 24, 2026.
- Wasserstein, R. L., and Lazar, N. A. The ASA Statement on p-Values: Context, Process, and Purpose, The American Statistician 70(2), 2016 (what a p-value is and is not; p-values do not measure the probability that the hypothesis is true). Accessed October 24, 2026.
- OpenStax, Rice University. Introductory Statistics (hypothesis testing with one and two samples, one-tailed vs two-tailed tests, and the alpha decision rule). Accessed October 24, 2026.
