ThisCalculator

Statistics

T Test Significance Calculator & P Value

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.

T Test Significance Calculator & P Value

This calculator works out the statistical significance of a Student’s t test. You enter the t statistic, the degrees of freedom, and choose a one-tailed or two-tailed test, and it returns the exact p value along with the critical t values at the 0.05 and 0.01 significance levels. The p value tells you the probability of observing a t statistic at least as extreme as yours if the null hypothesis were true.

Formula

The p value is derived from the cumulative distribution function (CDF) of the t distribution. For a one-tailed test, the p value is:

p = 1 − F(t | df)

For a two-tailed test, it is:

p = 2 × (1 − F(|t| | df))

where:

  • t = the t statistic from your test (unitless)
  • df = degrees of freedom (for an independent two-sample t test, df = nâ‚� + nâ‚‚ − 2)
  • F = the cumulative distribution function of the t distribution

The critical t values are the quantiles of the t distribution: for α = 0.05, one-tailed, it’s the 95th percentile; for two-tailed, it’s the 97.5th percentile.

Worked Example

Using the default values: t = 2.10, df = 18, two-tailed test.

  1. Look up the cumulative probability F(2.10) for df = 18. From a t table or software, F(2.10) ≈ 0.9750.
  2. For a two-tailed test, p = 2 × (1 − 0.9750) = 0.0500.
  3. The critical t for α = 0.05 (two-tailed) with df = 18 is approximately 2.101.
  4. Since 2.10 is just below 2.101, the result is not quite significant at the 0.05 level, though it is very close.

The calculator gives p = 0.0500 and tcrit05 = 2.101, matching the manual calculation.

How the t Test Works

The t test is a parametric test that compares means. It assumes the data are approximately normally distributed and that variances are similar (for the independent two-sample version). The t statistic is essentially the difference between group means divided by the standard error of that difference. Larger absolute t values indicate a larger difference relative to the variability, which makes the result less likely to be due to chance.

The degrees of freedom reflect the amount of independent information available. For a one-sample t test, df = n − 1. For an independent two-sample t test with equal variances, df = n� + n₂ − 2. For a paired t test, df = n − 1 where n is the number of pairs.

The p value is the probability of getting a t statistic as extreme as the one you observed, assuming the null hypothesis (no difference) is true. A small p value (typically below 0.05) suggests that the observed difference is unlikely to be due to random sampling error, so you reject the null hypothesis.

Choosing One-Tailed vs. Two-Tailed

This choice must be made before you collect data. A two-tailed test is appropriate when you are testing whether two means differ in any direction (e.g., a new drug could be better or worse than the old one). A one-tailed test is only appropriate when you have a strong prior expectation that the difference goes in a specific direction (e.g., a new fertilizer will increase yield, not decrease it).

The p value for a one-tailed test is exactly half the two-tailed p value (for the same t and df). This makes one-tailed tests more powerful for detecting an effect in the predicted direction, but they are more likely to miss an effect in the opposite direction. Many journals and researchers prefer two-tailed tests because they are more conservative and do not assume direction in advance.

Common Mistakes and Misconceptions

  • Using the wrong degrees of freedom: For a two-sample t test, df = nâ‚� + nâ‚‚ − 2, not min(nâ‚�, nâ‚‚) or nâ‚� + nâ‚‚. Using the wrong df changes the p value.
  • Mixing up one-tailed and two-tailed p values: A two-tailed p value is double the one-tailed p value. If you report a one-tailed p when you ran a two-tailed test, you understate the significance.
  • Interpreting p as the probability that the null hypothesis is true: The p value is the probability of the data (or more extreme) given that the null hypothesis is true, not the probability that the null hypothesis is true.
  • Ignoring assumptions: The t test assumes normality and equal variances. If these are badly violated, the p value may be inaccurate. Use Welch’s t test or a nonparametric test instead.
  • Rounding too early: Rounding t or df to too few digits can change the p value noticeably, especially near the 0.05 threshold.

Limitations of the p Value

A p value is not a measure of effect size. A very small p value can occur with a tiny but practically meaningless difference if the sample size is large. Conversely, a large p value does not prove that there is no effect; it just means the data are not strong enough to rule out chance. Always report confidence intervals and effect sizes alongside p values.

The t test also assumes that the data are independent (except for paired tests) and that the sampling distribution of the mean is approximately normal. For small samples (n < 30), the normality assumption is critical. For larger samples, the Central Limit Theorem makes the t test robust to moderate non-normality.

Alternatives to the t Test

  • Welch’s t test: Does not assume equal variances; uses a different df calculation. Safer when sample sizes and variances are unequal.
  • Mann-Whitney U test: Nonparametric alternative for independent samples; compares medians rather than means.
  • Wilcoxon signed-rank test: Nonparametric alternative for paired samples.
  • ANOVA: Compares means of three or more groups; an extension of the t test.
  • Z test: Used when the population standard deviation is known and the sample is large (n > 30).

Frequently Asked Questions

What is the difference between a t test and a z test?

A z test is used when the population standard deviation is known and the sample size is large (typically n > 30), while a t test is used when the standard deviation is estimated from the sample. The t distribution has heavier tails than the normal distribution, which accounts for the extra uncertainty in small samples. As df increases, the t distribution approaches the normal distribution.

How do I find degrees of freedom for a paired t test?

For a paired t test, the degrees of freedom are n − 1, where n is the number of pairs (i.e., the number of subjects). For example, if you have 20 subjects measured before and after, df = 19.

Why is my p value different from the one in Excel or SPSS?

Differences can arise from rounding of the t statistic and df, or from using different approximations (e.g., Welch’s correction). Also, some software reports one-tailed p values by default, while others report two-tailed. Always check the test type and df.

Can I use a t test if my data are not normally distributed?

For large samples (n > 30 per group), the t test is fairly robust to non-normality due to the Central Limit Theorem. For small samples, it is better to use a nonparametric test like the Mann-Whitney U test, or to transform the data.

What does a p value of 0.050 exactly mean?

It means that if the null hypothesis is true, there is a 5% chance of observing a t statistic as extreme as yours. In most fields, this is the threshold for statistical significance, but it is arbitrary. A p value of 0.050 is often considered marginally significant; some researchers would not reject the null hypothesis at α = 0.05 because 0.050 is not strictly less than 0.05.

How do I report the results of a t test?

Report the t statistic, degrees of freedom, and p value, e.g., t(18) = 2.10, p = 0.050. Also include the means and standard deviations of each group, and ideally a confidence interval for the difference. For example: “The mean score was 25.3 (SD = 3.1) in the treatment group and 22.1 (SD = 2.9) in the control group; the difference was not statistically significant, t(18) = 2.10, p = 0.050.”

Related

Formula used
in t | t statistic | - | 2.10 | 0
in df | Degrees of freedom | - | 18 | 1
sel tail | Test type | One-tailed=1, Two-tailed=2 | 2 | 0
out p | p value | - | tail == 1 ? 1 - tcdf(t, df) : 2 * (1 - tcdf(abs(t), df)) | 4
out tcrit05 | Critical t (α = 0.05) | - | tail == 1 ? tinv(0.95, df) : tinv(0.975, df) | 3
out tcrit01 | Critical t (α = 0.01) | - | tail == 1 ? tinv(0.99, df) : tinv(0.995, df) | 3

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.