ThisCalculator

Everyday

t Distribution Calculator: Find p-Values & Critical Values

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

This calculator works out the cumulative probability (p-value) and critical values for the t distribution. You enter your t statistic (or the values needed to compute it), the degrees of freedom, and choose a one-tailed or two-tailed test; the calculator returns the exact p-value and the critical t value for a 95% confidence level. It is a standard tool for hypothesis testing and confidence intervals when the population standard deviation is unknown.

Formula

The t distribution is defined by its probability density function, but the calculator uses the cumulative distribution function (CDF), denoted F(t; df), which gives the probability that a t-distributed random variable is less than or equal to a given value t. The p-value is then:

  • One-tailed test: p = 1 − F(t; df) (for a right-tailed test; for a left-tailed test, p = F(t; df)).
  • Two-tailed test: p = 2 × [1 − F(|t|; df)].

Here, df is the degrees of freedom, typically n − 1 for a one-sample t-test. The critical value for a 95% confidence level is the value tcrit such that F(tcrit; df) = 0.975 for a two-tailed test (or 0.95 for a one-tailed test). The calculator uses the inverse CDF to find this value.

Worked Example

Suppose you have a t statistic of 2.0 with 20 degrees of freedom and you want a two-tailed p-value. Using the default values:

  1. Find the cumulative probability: F(2.0; 20) ≈ 0.9703 (this is the area under the t curve to the left of 2.0).
  2. Compute the one-tailed upper tail: 1 − 0.9703 = 0.0297.
  3. For a two-tailed test, multiply by 2: p = 2 × 0.0297 = 0.0594.

The calculator shows p = 0.0594 (rounded to 4 decimals). The critical t for 95% confidence with 20 df is approximately 2.086, which matches the calculator’s output. Since the p-value (0.0594) is greater than 0.05, you would not reject the null hypothesis at the 5% significance level.

When to Use the t Distribution

The t distribution is used in place of the normal distribution when the sample size is small (typically n < 30) or when the population standard deviation is unknown and must be estimated from the sample. Common applications include:

  • One-sample t-test: comparing a sample mean to a known value.
  • Two-sample t-test: comparing the means of two independent groups.
  • Paired t-test: comparing two related measurements (e.g., before/after).
  • Calculating confidence intervals for a population mean.

As the degrees of freedom increase, the t distribution approaches the standard normal distribution. For df > 30, the two are nearly identical, which is why many textbooks suggest using the normal approximation for large samples.

How to Read the Results

The p-value is the probability of observing a t statistic as extreme as, or more extreme than, the one you calculated, assuming the null hypothesis is true. A small p-value (typically < 0.05) indicates strong evidence against the null hypothesis. The critical value is the threshold that your t statistic must exceed (in absolute value) to reject the null hypothesis at the chosen significance level. For a two-tailed test with α = 0.05, you reject if |t| > tcrit.

Remember that the p-value depends on the direction of the test. A one-tailed test concentrates all the α in one tail, so the critical value is smaller (e.g., 1.725 for df=20) compared to a two-tailed test (2.086). Always choose the test type before looking up the result.

Common Mistakes and Pitfalls

  • Using the wrong degrees of freedom: for a one-sample t-test, df = n − 1, not n. For a two-sample test, df is more complex (often approximated with the Welch–Satterthwaite formula).
  • Confusing one-tailed and two-tailed p-values: a two-tailed p-value is double the one-tailed value. If you report a one-tailed p-value when your hypothesis is two-tailed, you inflate the significance.
  • Misinterpreting the p-value: a p-value is not the probability that the null hypothesis is true. It is the probability of the data (or more extreme) given that the null is true.
  • Rounding too early: if you round the t statistic or df before calculating the p-value, you can get a noticeably different result. Keep full precision until the final step.

Limitations and Alternatives

The t distribution assumes that the data are approximately normally distributed, especially for small samples. If the data are heavily skewed or have outliers, the t-test may not be valid. In such cases, consider nonparametric alternatives like the Mann–Whitney U test (for two independent groups) or the Wilcoxon signed-rank test (for paired data). Also, the t distribution is not appropriate for proportions or counts; use the binomial or chi-square distribution instead.

For large samples (n > 30), you can often use the normal distribution (z-test) as an approximation, but the t distribution is still valid and slightly more conservative. Modern statistical software typically uses the t distribution by default, even for large samples, because it is more accurate.

Frequently Asked Questions

What is the difference between t and z distributions?

The t distribution is wider and has heavier tails than the standard normal (z) distribution, reflecting the extra uncertainty from estimating the population standard deviation from the sample. As degrees of freedom increase, the t distribution becomes indistinguishable from the z distribution. In practice, use t when the population standard deviation is unknown (almost always) and the sample size is small; use z when the population standard deviation is known (rare) or the sample is very large (n > 30).

How do I find degrees of freedom for a two-sample t-test?

For a two-sample t-test with unequal variances (Welch’s test), the degrees of freedom are approximated using the Welch–Satterthwaite equation, which accounts for the sample sizes and variances of both groups. The formula is complex, but most software calculates it automatically. For equal variances, df = n1 + n2 − 2. When in doubt, use the conservative approach of using the smaller of n1−1 and n2−1.

Can I use this calculator for a paired t-test?

Yes. For a paired t-test, you first compute the differences between the paired observations, then perform a one-sample t-test on those differences. The degrees of freedom are n − 1, where n is the number of pairs. Enter the t statistic computed from the differences and the correct df.

What does a negative t statistic mean?

A negative t statistic indicates that the sample mean is below the hypothesized value (or the difference between groups is negative). The p-value calculation uses the absolute value for two-tailed tests, so the sign does not affect the two-tailed p-value. For one-tailed tests, the direction matters: a negative t statistic is significant for a left-tailed test but not for a right-tailed test.

How do I calculate the t statistic from raw data?

For a one-sample t-test, the formula is t = (x̄ − μ) / (s / √n), where x̄ is the sample mean, μ is the hypothesized population mean, s is the sample standard deviation, and n is the sample size. For a two-sample t-test, the formula is more involved, but it essentially compares the difference in means to the standard error of that difference.

Related

Formula used
in t | t statistic | - | 2.0 | 0
in df | Degrees of freedom | - | 20 | 1
in tails | Test type | One-tailed=1, Two-tailed=2 | 2 | 0
out p | p-value | - | tails * (1 - tcdf(t, df)) | 4
out crit | Critical t (95%) | - | tinv(0.95, df) | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.