All calculators

Education

T-Test Calculator

Pick one-sample or two-sample independent. Enter the means, standard deviations, and sample sizes, and the calculator returns the t statistic, the degrees of freedom (Welch-Satterthwaite for two-sample), and the standard error.

Tail

e.g. 105

e.g. 100

e.g. 12

e.g. 30

For a p-value from the t statistic and degrees of freedom, consult statistical software or a t-distribution table. The calculator returns t and df; convert to a p-value with the tools you use for formal analysis.

One-sample t-test

Two-tailed · df 29

t = 2.2822

x̄ − μ₀ = 5

t statistic2.2822
Degrees of freedom29
Standard error2.1909
Sample mean − hypothesized5

The sample mean is above the hypothesized mean. Compare |t| to a two-tailed critical value to evaluate significance.

Was this helpful?

Examples

One-sample: x̄ = 105, μ₀ = 100, s = 12, n = 30

t ≈ 2.28, df = 29

Two-sample: m₁ = 75, s₁ = 10, n₁ = 25 vs m₂ = 70, s₂ = 11, n₂ = 28

t ≈ 1.74, df ≈ 50.6 (Welch)

One-sample: x̄ = 100, μ₀ = 100

t = 0, sample equals hypothesized

How it works

For a one-sample test, divide the difference between the sample mean and the hypothesized mean by the standard error of the mean. Degrees of freedom equal n minus 1. For a two-sample Welch test, the standard error combines both groups, and the degrees of freedom come from the Welch-Satterthwaite formula.

One-sample t · (x̄ − μ₀) ÷ (s ÷ √n) · df = n − 1

Two-sample t (Welch) · (m₁ − m₂) ÷ √(s₁²/n₁ + s₂²/n₂)

Welch df ≈ (s₁²/n₁ + s₂²/n₂)² ÷ ((s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1)).

Educational and planning use, not formal research output. A t-test assumes approximately normal data, independent observations, and (for two-sample) independent groups. For published research, validate assumptions, consider a paired or non-parametric alternative if the data warrants it, and use professional statistical software.

Related statistics calculators

Frequently asked questions

A t-test checks whether a difference in means is large enough to be unlikely under the null hypothesis of no difference. The one-sample t-test compares a sample mean to a hypothesized population mean. The two-sample t-test compares the means of two independent groups. The result is a t statistic and degrees of freedom that you convert to a p-value using a t-distribution table or statistical software.

One-sample asks 'is this sample's mean different from a specific value (μ₀)?' Two-sample asks 'do these two groups have different means?' Use one-sample when you have a single group and a benchmark (a published average, a target, a historical value). Use two-sample when you have two independent groups (treatment and control, two product variants, two schools).

Welch's t-test does not assume equal variances between the two groups, which is a safer default than the classic 'pooled' two-sample t-test. When variances and sample sizes happen to be similar, Welch's test gives nearly identical results. When they differ, Welch's adjusts both the standard error and the degrees of freedom using the Welch-Satterthwaite approximation, which keeps the test calibrated.

t measures how many standard errors the observed difference is away from zero. Bigger |t| values mean stronger evidence against the null. The exact threshold depends on degrees of freedom and chosen significance level: for example, a two-tailed test at α = 0.05 with df = 30 needs |t| above about 2.04 to reject the null. Check a t-table or convert to a p-value to evaluate.

Computing a p-value from a t statistic requires integrating the t-distribution density, which is more involved than the simple closed-form math used elsewhere on the site. Rather than approximate it imperfectly, the calculator reports the t statistic and degrees of freedom, and you can drop them into a t-table, the p-value calculator on this site (for the z-approximation when df is large), or statistical software.

The t-test assumes the data are approximately normally distributed (especially important for small samples), the observations are independent within each group, and for the two-sample case, the two groups are independent. For very non-normal data, very small samples, or matched/paired data, other tests are more appropriate (Mann-Whitney U, Wilcoxon signed-rank, paired t-test). For formal research, confirm the right test with a qualified statistician.