T Test Calculator

Perform one-sample and two-sample Welch's t-tests — enter your data to get the t-statistic, p-value, degrees of freedom, and significance interpretation.

Share this calculator

Test type

1.04

t-statistic

0.36

p-value (two-tailed)

4

Degrees of freedom

t-statistic1.04
p-value (two-tailed)0.36
Degrees of freedom4
Sample mean2.12
Hypothesised mean2
Mean difference0.12
Sample SD0.26
Standard error0.12
No significant evidence against H₀ (p ≥ 0.05)

Also in Statistics

Inferential Statistics

T-test calculator — one-sample and two-sample Welch's t-test

A t-test determines whether a sample mean differs significantly from a known value (one-sample) or whether the means of two groups differ significantly from each other (two-sample). This calculator supports both forms, outputting the t-statistic, p-value, degrees of freedom, and a plain-English significance interpretation.

One-sample t-test

A one-sample t-test asks: "Is the mean of my sample significantly different from a specific value μ₀?" For example, you measure the weight of 10 packages and want to know if the mean differs from the labelled weight of 500 g.

t = (x̄ − μ₀) / (s / √n), where x̄ is the sample mean, μ₀ is the hypothesised mean, s is the sample standard deviation, and n is the sample size. The t-statistic is compared against the t-distribution with df = n − 1 to obtain a two-tailed p-value.

Two-sample Welch's t-test

A two-sample t-test asks: "Are the means of two independent groups significantly different?" Welch's variant does not assume equal variances — it is more robust than the classic Student's t-test and is the default in most statistical software.

t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂). Degrees of freedom are computed using the Welch–Satterthwaite equation, which accounts for unequal variances and sample sizes.

Interpreting the p-value

The p-value is the probability of observing a test statistic as extreme as the one calculated if the null hypothesis H₀ were true. A p-value below the chosen significance level α (typically 0.05) leads to rejecting H₀.

A small p-value does not tell you the effect is large or practically important — only that it is unlikely under H₀. Always consider effect size alongside statistical significance.

Frequently asked questions

When should I use a one-sample vs two-sample t-test?

Use a one-sample t-test when you are comparing a sample mean to a known or theoretical value (μ₀). Use a two-sample t-test when you have two independent groups and want to compare their means.

Why Welch's t-test instead of Student's t-test?

Student's t-test assumes the two groups have equal variances (homoscedasticity). Welch's test makes no such assumption and performs better when variances are unequal. It has similar power when variances are equal, so it is preferred as the default.

What does a two-tailed p-value mean?

A two-tailed p-value tests whether the means differ in either direction. If you had a specific directional hypothesis, a one-tailed p-value would be appropriate — but two-tailed is the safer, more common default.

What sample size do I need for a t-test?

A minimum of 2 values per group is required. For reliable results, n ≥ 20–30 per group is generally recommended. Smaller samples have less power and the t-distribution approximation is less accurate if the data are highly non-normal.

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.