Math · Statistics

T-test calculator.

Enter the sample size, mean and standard deviation of each group. Get the t statistic, degrees of freedom, p-value and a confidence interval for the difference.

Using the NIST assembly-time example (old process: n = 11, mean 36.0909, SD 4.9082; new process: n = 9, mean 32.2222, SD 2.5386), Welch’s t is 2.2694 with 15.53 degrees of freedom. The two-tailed p-value is 0.0379, and the one-tailed p-value for “old is longer” is 0.0189.

Welch: t = (x̄1 − x̄2) / √(s1²/n1 + s2²/n2)One sample: t = (x̄ − μ0) / (s / √n)Opened sources 8 October 2026

Advertisement

Your numbers

Welch is the safe default when you cannot assume equal standard deviations.

Sample 1

The sample standard deviation (n - 1 in the denominator).

Sample 2

Your result

Fill the form and press Calculate.

The formulas

For two independent samples with unequal variances, t = (x̄1 − x̄2) / √(s1²/n1 + s2²/n2) and the degrees of freedom are estimated with the Welch-Satterthwaite approximation, ν = (s1²/n1 + s2²/n2)² / [s1⁴/(n1²(n1−1)) + s2⁴/(n2²(n2−1))]. If the standard deviations can be assumed equal, the pooled version uses s = √(((n1−1)s1² + (n2−1)s2²) / (n1+n2−2)) with n1 + n2 − 2 degrees of freedom. For one sample, t = (x̄ − μ0) / (s / √n) with n − 1 degrees of freedom. The p-value comes from Student’s t distribution.

Worked example

NIST tests whether a new assembly process (n = 9, mean 32.2222, SD 2.5386 minutes) is faster than the old one (n = 11, mean 36.0909, SD 4.9082). The standard error is √(4.9082²/11 + 2.5386²/9) = 1.7047, so t = 3.8687 / 1.7047 = 2.2694, and the degrees of freedom are 15.5 (this calculator shows 15.53). NIST rounds up to 16 degrees of freedom, looks up the one-sided 5% critical value 1.746 and rejects the null hypothesis because 2.269 exceeds it. The calculator agrees: the one-tailed p-value is 0.0189, below 0.05. The two-tailed p-value is 0.0379 and the 95% confidence interval for the difference is 0.25 to 7.49 minutes.

Limits

The t-test assumes independent observations from populations that are roughly normal, or samples large enough for the mean to be roughly normal. Choose a one-tailed test before looking at the data, not after. This tool uses summary statistics, so it cannot check your raw data for outliers or skew. A statistically significant difference can still be too small to matter.

Sources, opened 8 October 2026: NIST/SEMATECH e-Handbook, 7.3.1 Do two processes have the same mean? (Welch and pooled test statistics, Welch-Satterthwaite degrees of freedom, the assembly-time example with t = 2.2694, ν = 15.5 and critical value 1.746); NIST/SEMATECH e-Handbook, 1.3.5.2 Confidence Limits for the Mean (one-sample statistic T = (Ȳ − μ0)/(s/√N)).

Frequently asked questions

How do I run a t-test from mean and standard deviation?

Enter each group's sample size, mean and standard deviation, pick the test type and the alternative hypothesis, and press Calculate. You do not need the raw data.

What is the difference between Welch and pooled?

Pooled assumes both populations have the same standard deviation and uses n1 + n2 - 2 degrees of freedom. Welch does not assume that and estimates the degrees of freedom, so it is the safer default when the standard deviations differ.

How do I get a one-tailed p-value?

Choose a one-tailed alternative. The p-value is then the area in one tail only. In the NIST example the two-tailed p-value is 0.0379 and the one-tailed value for "sample 1 mean is greater" is 0.0189.

Why are my degrees of freedom not a whole number?

Welch's degrees of freedom are an approximation and are usually fractional. For the NIST example they are 15.5, and NIST rounds to 16 to use a printed table. This calculator uses the exact fractional value.

Which standard deviation do I enter?

The sample standard deviation, which divides by n - 1. If you only have the population standard deviation (dividing by n), the t-test is not the right tool.

What does the confidence interval show?

It is a two-sided interval for the difference between the means (or between the sample mean and the hypothesised mean). If it excludes 0 the two-tailed test at the matching level is significant.

Learning aid, not for decisions

Educational calculator. Results assume the conditions listed on this page, which real data often only roughly meet. Do not use it for clinical, regulatory, legal or financial decisions.

Advertisement
Advertisement