Skip to content
CalcTide logo
Education & Math

T-Test Calculator

A sample of 25 measurements with a mean of 5, a standard deviation of 2, and a comparison value of 4 produces a t statistic of 2.5, 24 degrees of freedom, and a two-tailed p-value of about 0.0197. This t-test calculator works from summary statistics, so you do not need the raw data set. You enter the means, standard deviations, and sample sizes that a study or spreadsheet already reports, and the tool returns the t statistic, the degrees of freedom, and the two-tailed p-value. It supports three common designs: a one-sample test against a fixed value, a two-sample pooled test that assumes equal variances, and a Welch test that does not. A t-test asks whether an observed difference in means is larger than what sampling noise alone would tend to produce. A small p-value means a difference that size would be uncommon if the true means were equal. This page reports results at the common 0.05 threshold, and it states the outcome in plain words without claiming more than the number supports. Use it to check homework, confirm a spreadsheet formula, or preview a result before you run full statistics software.

Education & MathBy

Quick answer

A t-test compares means using the t-distribution, which has heavier tails than the normal curve and adjusts for small samples.

t statistic

2.5

Degrees of freedom

24

Two-tailed p-value

0.019654

Standard error

0.4

Significance at 0.05: The p-value is below 0.05, which suggests the difference is statistically significant at the 0.05 level.

Two-tailed p-values come from the Student t-distribution using the regularized incomplete beta function: p = betai(df/2, 0.5, df/(df + t*t)).

What this tells you

  • A t-test compares means using the t-distribution, which has heavier tails than the normal curve and adjusts for small samples.
  • The t statistic measures the gap between means in units of standard error, so a larger absolute t points to a clearer difference.
  • Degrees of freedom set the exact shape of the t-distribution and depend on the sample sizes.
  • The two-tailed p-value is the chance of seeing a t at least this extreme in either direction when the true means are equal.
  • A one-sample test compares one group mean to a known or target value, while two-sample tests compare two group means.
  • The pooled test assumes both groups share the same variance, and the Welch test relaxes that assumption.

How to Use

  1. 11. Pick the test mode: one-sample, two-sample pooled, or Welch, depending on your study design.
  2. 22. For a one-sample test, enter the sample mean, the sample standard deviation, the sample size, and the population or target mean you are testing against.
  3. 33. For a two-sample test, enter the mean, standard deviation, and size for each of the two groups.
  4. 44. Read the t statistic and degrees of freedom, then compare the two-tailed p-value against your chosen alpha, usually 0.05.
  5. 55. Use the plain-language note as a summary, and remember that a result below 0.05 suggests significance rather than proving a real-world effect.

How It Works

Formula

one-sample: t = (mean - mu) / (sd / sqrt(n)), df = n - 1 pooled: t = (mean1 - mean2) / sqrt(sp^2 x (1/n1 + 1/n2)), df = n1 + n2 - 2 Welch: t = (mean1 - mean2) / sqrt(sd1^2/n1 + sd2^2/n2) two-tailed p = betai(df/2, 0.5, df / (df + t^2))

Every mode divides a difference in means by a standard error, which is the expected spread of that difference from sampling. In the one-sample case the standard error is sd / sqrt(n). In the pooled case the two groups are assumed to share one variance sp^2, computed as ((n1 - 1) x sd1^2 + (n2 - 1) x sd2^2) / (n1 + n2 - 2). The Welch case keeps the two variances separate and uses the Welch-Satterthwaite formula for its degrees of freedom, df = (v1 + v2)^2 / (v1^2/(n1 - 1) + v2^2/(n2 - 1)), where v1 = sd1^2/n1 and v2 = sd2^2/n2, so the result is usually not a whole number. Once t and df are known, the two-tailed p-value comes from the regularized incomplete beta function betai. For example, t = 2.5 with df = 24 gives betai(12, 0.5, 24 / 30.25) = 0.0197.

Calculation note: values are processed in the order shown above, using the current input units.

Worked Examples

One-sample test of a mean against 4

Modeone-sample
Sample Mean5
Sample Sd2
N25
Population Mean4
Resultt = 2.5, df = 24, p = 0.0197

The standard error is 2 / sqrt(25) = 0.4, so t = (5 - 4) / 0.4 = 2.5 with df = 24. The two-tailed p-value of 0.0197 is below 0.05, which suggests the sample mean differs from 4 at the 0.05 level.

One-sample test that is not significant

Modeone-sample
Sample Mean48
Sample Sd6
N16
Population Mean50
Resultt = -1.333, df = 15, p = 0.2023

Here t = (48 - 50) / (6 / sqrt(16)) = -2 / 1.5 = -1.333 with df = 15. The p-value of 0.2023 is above 0.05, so the data do not show a difference from 50 at the 0.05 level. A negative t just means the sample mean sits below the target.

Two-sample pooled test with equal sizes

Modetwo-sample-pooled
Mean110
Sd12
N110
Mean28
Sd22
N210
Resultt = 2.236, df = 18, p = 0.0382

With equal variances the pooled variance is 4, so the standard error is sqrt(4 x (1/10 + 1/10)) = sqrt(0.8). Then t = (10 - 8) / sqrt(0.8) = 2.236 with df = 18. The p-value of 0.0382 is below 0.05.

Two-sample pooled test with unequal sizes

Modetwo-sample-pooled
Mean182
Sd15
N112
Mean278
Sd26
N215
Resultt = 1.850, df = 25, p = 0.0761

The pooled variance is ((11 x 25) + (14 x 36)) / 25 = 31.16, giving a standard error of about 2.162. Then t = (82 - 78) / 2.162 = 1.850 with df = 25. The p-value of 0.0761 is above 0.05, so this gap is not significant at the 0.05 level even though the means differ by 4 points.

Welch test with unequal variances

Modewelch
Mean110
Sd13
N115
Mean27
Sd22
N220
Resultt = 3.354, df = 23.01, p = 0.0027

The variances of the two means are v1 = 9/15 = 0.6 and v2 = 4/20 = 0.2, so the standard error is sqrt(0.8) and t = (10 - 7) / sqrt(0.8) = 3.354. The Welch-Satterthwaite formula gives df = 23.01, and the p-value of 0.0027 is well below 0.05.

Two-Tailed Critical t Values at Alpha 0.05

Reject the null hypothesis when the absolute t statistic is larger than the critical value for its degrees of freedom.

Degrees of freedomCritical t (two-tailed, 0.05)
112.706
24.303
33.182
42.776
52.571
102.228
152.131
202.086
242.064
302.042
602.000
1201.980
Infinite (z)1.960

As degrees of freedom grow, the critical t value approaches the normal critical value of 1.960. Larger samples make the t-distribution look almost normal.

How to read a t-test result

Start with the t statistic. Its sign shows which mean is larger, and its size shows how many standard errors separate the two means. A t near zero means the means are close relative to their spread, while a large absolute t means they are far apart.

Next look at the degrees of freedom and the two-tailed p-value together. The degrees of freedom set the exact critical value from the table above, and the p-value turns your t into a probability. When the p-value is below your alpha, often 0.05, the difference is called statistically significant at that level.

Finally, judge the practical meaning on your own. Statistical significance and real-world importance are separate questions. A tiny difference can be significant with a very large sample, and a large difference can miss significance with a very small one, so report the actual means and spread alongside the p-value.

P-Value Calculator

Common mistakes

  • Using the standard deviation of the mean instead of the standard deviation of the data. Enter the sample standard deviation, and the tool divides by sqrt(n) to find the standard error.
  • Choosing the pooled test when the two groups have very different variances. The Welch test is the safer default when spreads or sample sizes differ.
  • Reading a small p-value as proof of a large or important effect. A p-value speaks to statistical significance, not to the size or practical value of the difference.
  • Comparing the two-tailed p-value to 0.05 after planning a one-tailed test. Decide the direction and the alpha before you look at the data.
  • Entering sample sizes below 2. A t-test needs at least two observations per group so that variance and degrees of freedom are defined.

Embed this calculator on your site

Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.

<script src="https://calctide.com/embed.js" data-tool="t-test-calculator" async></script>

Preview the embed at /embed/t-test-calculator/.

Frequently Asked Questions

A t-test tells you whether the difference between means is larger than sampling noise would usually produce. It returns a t statistic and a p-value, and a small p-value suggests the means differ more than chance alone would explain.
Use a one-sample t-test when you compare one group's mean to a single known or target value. An example is checking whether the average fill weight of a batch differs from a labeled 500 grams.
The pooled test assumes both groups have the same variance, while the Welch test allows different variances. Welch is the safer choice when the two standard deviations or sample sizes are not similar, and it gives fractional degrees of freedom.
No, a p-value below 0.05 suggests the difference is statistically significant at the 0.05 level, not that it is proven or important. It means a difference this large would be uncommon if the true means were equal, but it says nothing about the size or cause of the effect.
Fractional degrees of freedom come from the Welch test, which uses the Welch-Satterthwaite formula. That formula blends the two sample variances and sizes, so the result is usually a decimal rather than a round count.
This calculator reports two-tailed p-values, which test for a difference in either direction. For a one-tailed test in a specific direction, halve the two-tailed p-value when the sample difference points the way you predicted.
You need at least two observations per group for the math to work, but small samples give wide and unreliable results. Larger samples make the t-distribution behave more like the normal curve and produce more stable p-values.
The standard error is the expected spread of the difference in means from sample to sample. The t statistic is the observed difference divided by this standard error, so it shows how many standard errors separate the means.
It estimates t-test calculator outputs using the visible inputs and formula assumptions on this page.

Explore More in Education & Math