P-value from t calculator
Turn a t statistic and its degrees of freedom into an exact p-value. You get the two-sided p and both one-sided tails, with the area shaded on the t distribution. Decimal df from Welch's test are fine.
- Two-sided and both one-sided p-values
- Non-integer df accepted
- Exact, not read from a table
Sources checked on November 21, 2026. Results computed by the site's engine and tested against R and SciPy.
p-value for t = 2.2280 with 10 df
To more places: two-sided p = 0.05001177. The shaded area is the two-sided p-value: the chance of a t at least this far from zero, in either direction, if the null hypothesis is true. A one-sided p is the tail in the direction you stated before seeing the data.
Reproduce this result in R or Python
R
2 * pt(-abs(2.228), df = 10) # two-sided
pt(2.228, df = 10, lower.tail = FALSE) # one-sided, upperPython (SciPy)
from scipy.stats import t
print(2 * t.sf(abs(2.228), 10)) # two-sided
print(t.sf(2.228, 10)) # one-sided, upperWhat it calculates
The p-value for a t statistic is an area under the t distribution with the given degrees of freedom. The two-sided p is the area beyond |t| in both tails, the probability of a t at least that far from zero in either direction if the null hypothesis holds. The upper-tail p is the area to the right of t, and the lower-tail p the area to the left; the two one-sided values always add up to 1.
The calculator computes these areas with the regularized incomplete beta function, the method in NIST's Digital Library of Mathematical Functions, and agrees with R's pt and SciPy's t.sf to at least ten significant figures on every value we test.
Worked example: a value from the t table
The calculator opens with t = 2.228 and 10 degrees of freedom. That t is the value printed in the NIST t table for a two-sided 5% test with 10 df. The exact two-sided p is 0.050012, close to 0.05 but not equal to it, because the table value is rounded to three decimals.
| t | df | Exact two-sided p | Table column |
|---|---|---|---|
| 2.228 | 10 | 0.050012 | 0.05 |
| 12.706 | 1 | 0.050001 | 0.05 |
| 3.385 | 30 | 0.002001 | 0.002 |
| 1.96 | one billion | 0.049996 | 0.05 |
The last row shows the normal limit: with a huge df, t = 1.96 gives almost exactly the familiar two-sided 5% of the standard normal.
One-sided or two-sided
Report the two-sided p unless you stated a direction before seeing the data. If you did, the one-sided p is the tail in that direction. When t points the way you predicted, that tail is half the two-sided p. When t points the other way, the tail in your predicted direction is more than 0.5, so the result is nowhere near significant. Taking half the two-sided p regardless of direction is a common error; one-tailed vs two-tailed tests has a worked case.
Where t and df come from
- One-sample and paired tests: df = n − 1, where n counts values or pairs.
- Student's independent test: df = n1 + n2 − 2.
- Welch's test: the Welch-Satterthwaite df, usually a decimal. Enter it unrounded; for R's mtcars example it is 18.33, giving two-sided p = 0.0014 for t = −3.7671.
- Regression coefficients: df = n minus the number of estimated parameters.
If you have the raw data, the t-test calculator computes t, df and p together, along with the confidence interval.
Very small p-values
Large t values give p-values too small to show as decimals. The calculator switches to scientific notation below 0.001, such as 1.166 × 10−7 for t = 8 with 20 df, and never prints 0. In an APA report any p below .001 is written as p < .001.
How this differs from a t table
A printed t table lists only a few probabilities, so it can tell you that p lies between 0.02 and 0.05 but not what it is. Exact p-values are what journals now ask for, and they avoid the false precision of reading between table columns. The table is still useful for exams where software is not allowed.
Sources
- NIST Digital Library of Mathematical Functions, chapter 8 (incomplete gamma and beta functions) checked November 21, 2026
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.7.2 Critical Values of the Student's t Distribution checked November 21, 2026