T-Test Calculator

Run one-sample, two-sample (unpaired/Welch's), or paired t-tests without touching a spreadsheet. Select your test type, then enter your sample means, standard deviations, and sample sizes (or raw comma-separated data for paired tests). You'll get the t-statistic, degrees of freedom, p-value, and a clear pass/fail against your chosen significance level — so you know whether to reject the null hypothesis. Also try the Median Calculator.

Choose the t-test type that matches your study design.

The threshold p-value used to determine statistical significance.

The known or hypothesized population mean (one-sample test only).

Enter paired observations for Group 1, separated by commas.

Enter paired observations for Group 2. Must have the same count as Group 1.

Results

t-Statistic

--

Degrees of Freedom

--

p-Value

--

Result

--

Mean Difference

--

Standard Error

--

Critical Value (t*)

--

Frequently Asked Questions

What is a t-test?

A t-test is a statistical hypothesis test used to determine whether there is a significant difference between the means of one or two groups. It produces a t-statistic and a p-value, which together tell you how likely the observed difference is due to random chance. T-tests are especially useful for small samples (fewer than 30 observations), where a z-test would be inappropriate. See also our Mean Median Mode Range.

What are the different types of t-tests?

The three main types are: (1) One-sample t-test — compares a sample mean to a known population mean. (2) Two-sample (unpaired) t-test — compares the means of two independent groups that share equal variance. (3) Welch's t-test — like the two-sample test but does not assume equal variances, making it more robust. (4) Paired t-test — compares means from the same group at two different times or under two conditions.

What does the p-value mean in a t-test?

The p-value represents the probability of observing a t-statistic as extreme as yours (or more extreme) if the null hypothesis were true. A p-value below your chosen significance level (α, commonly 0.05) means you reject the null hypothesis and conclude there is a statistically significant difference between the means. A higher p-value means the data do not provide enough evidence to reject the null.

When should I use a paired t-test vs. an unpaired t-test?

Use a paired t-test when your two sets of measurements come from the same subjects or are otherwise naturally linked — for example, measuring a patient's blood pressure before and after treatment. Use an unpaired (two-sample) t-test when the two groups are completely independent, such as comparing test scores between two separate classes. You might also find our Process Capability Index useful.

What are the assumptions of a t-test?

T-tests assume: (1) The data are continuous and approximately normally distributed (or n ≥ 30 for the Central Limit Theorem to apply). (2) The observations are independent of each other. (3) For the standard two-sample t-test, the two groups have roughly equal variances — if not, use Welch's t-test instead. Violations of these assumptions can lead to unreliable results.

What is the difference between a one-tailed and two-tailed t-test?

A two-tailed test checks for a difference in either direction (μ₁ ≠ μ₂), which is appropriate when you have no directional prediction. A one-tailed test checks for a difference in a specific direction — either that Group 1's mean is greater than Group 2's (right-tailed) or less than it (left-tailed). One-tailed tests have more statistical power but should only be used when the direction of the effect is predicted in advance.

What is the difference between Welch's t-test and the standard two-sample t-test?

The standard two-sample t-test assumes that both groups have equal variances (homoscedasticity). Welch's t-test relaxes that assumption, making it safer to use when the two groups have different sample sizes or noticeably different standard deviations. In practice, many statisticians recommend defaulting to Welch's t-test because it performs well even when variances are equal.

How many degrees of freedom does a t-test have?

For a one-sample or paired t-test, degrees of freedom (df) = n − 1. For a standard two-sample t-test, df = n₁ + n₂ − 2. Welch's t-test uses the Welch–Satterthwaite equation to calculate an approximate (fractional) df based on both sample sizes and variances, which is why you may see a non-integer result for that test type.