Two-Sample t-Test Calculator
Test whether the means of two independent samples differ significantly using a two-sample t-test.
Variance assumption
Alternative hypothesis
Fail to reject the null hypothesis at α = 0.05.
- 1
Standard error (Welch)
√(100÷30 + 144÷30) = 2.8519SE = √(s₁²/n₁ + s₂²/n₂) — no pooling under the Welch assumption. - 2
Mean difference
52 − 48 = 4 - 3
t statistic
4 ÷ 2.8519 = 1.4026
How does this calculator work?
Enter each group's mean, standard deviation, and size to run an independent two-sample t-test. Choose Welch (unequal variances) or pooled (equal variances) and a one- or two-tailed alternative. The tool returns the t statistic, degrees of freedom, p-value, and a reject/fail-to-reject decision at α = 0.05.
Formula
How this is calculated
Enter the sample mean, standard deviation, and size for each of two independent groups, then choose whether to assume equal variances and pick a one- or two-tailed alternative. The test compares the difference in means against the variability expected by chance to produce a t statistic.
For the Welch (unequal-variance) test the standard error is √(s₁²/n₁ + s₂²/n₂) and the degrees of freedom use the Welch–Satterthwaite approximation df = (s₁²/n₁ + s₂²/n₂)² / [(s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1)]. For the pooled test a single pooled variance sp² = ((n₁−1)s₁² + (n₂−1)s₂²)/(n₁+n₂−2) is used, the standard error becomes √(sp²(1/n₁ + 1/n₂)), and df = n₁ + n₂ − 2.
The p-value is obtained from the Student's t cumulative distribution evaluated via the regularized incomplete beta function. A two-tailed p-value is 2·P(T > |t|); one-tailed p-values use a single tail. Each group needs at least two observations and non-negative standard deviations. Welch's test is the safer default because it does not assume the two populations share a variance.
Frequently asked questions
Use Welch's test whenever the two groups may have different variances or unequal sample sizes — it is robust and is the recommended default. Use the pooled test only when you are confident the population variances are equal.
It is the probability of observing a mean difference at least as extreme as yours if the two population means were truly equal. A p-value below your significance level (commonly 0.05) leads you to reject the null hypothesis of equal means.
No. This is for two independent (unpaired) groups. A paired t-test is used when the same subjects are measured twice or observations are naturally matched.
Also known as
TG we-Calculate Editorial Team. (2026). Two-Sample t-Test Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/two-sample-t-test-calculator
TG we-Calculate Editorial Team. "Two-Sample t-Test Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/two-sample-t-test-calculator.
TG we-Calculate Editorial Team, "Two-Sample t-Test Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/two-sample-t-test-calculator
@misc{wecalculate_two_sample_t_test_calculator, title = {Two-Sample t-Test Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/two-sample-t-test-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
