Two-Sample T-Test Calculator
Compute the independent samples t-statistic to test whether two group means are significantly different. Enter the mean, standard deviation, and sample size for each group.
Advertisement
Calculator
See your Two-Sample T-Test Calculator results
Enter your email to unlock results — free forever.
No spam, ever. Unsubscribe at any time.
Advertisement
Formula
t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)
Subtract the second group mean from the first, then divide by the standard error of the difference. The standard error is the square root of the sum of each group's variance divided by its sample size. The degrees of freedom is approximately n₁ + n₂ − 2 (exact Welch correction would use a more complex formula). Compare the resulting t-statistic to critical t-values or compute the p-value using a t-distribution table.
How to use the Two-Sample T-Test Calculator
- 1
Enter your mean of group 1
- 2
Enter your mean of group 2
- 3
Enter your std deviation of group 1
- 4
Enter your std deviation of group 2
- 5
Enter your sample size of group 1
- 6
Enter your sample size of group 2
- 7
Read your results instantly
Results update in real time as you type.
Advertisement
What the t-test evaluates
The independent samples t-test determines whether the means of two separate groups differ significantly from each other. For the defaults (Group 1 mean 52, Group 2 mean 48, both with 30 observations), the t-statistic is about 1.81. With 58 degrees of freedom, the critical value at p=0.05 (two-tailed) is approximately 2.00. Since 1.81 < 2.00, this difference is not statistically significant at the 5% level.
A significant t-statistic means the observed difference is unlikely to have arisen by chance if the two population means were truly equal. It does not tell you the difference is practically meaningful.
Assumptions of the independent samples t-test
The t-test assumes: (1) the two groups are independent — no pairing between observations; (2) data in each group is approximately normally distributed, or sample sizes are large enough for the central limit theorem to apply (generally n ≥ 30); (3) the two groups have approximately equal variances (for the standard version — Welch's t-test relaxes this assumption).
When variances are clearly unequal (one standard deviation is more than twice the other), Welch's t-test is preferred. When comparing paired observations (before/after measurements, matched controls), use the paired t-test instead.
Advertisement
Interpreting the t-statistic and p-value
The t-statistic measures the difference between group means in units of the standard error. A larger absolute t-value means a stronger signal relative to noise. To determine statistical significance, compare the t-statistic to a critical value from the t-distribution table at your chosen significance level (typically α = 0.05) and degrees of freedom.
For two-tailed tests with large samples (df > 30), the critical values are approximately ±1.96 at α=0.05 and ±2.58 at α=0.01. If |t| exceeds the critical value, reject the null hypothesis that the two means are equal.
Tips & Insights
Always report effect size alongside t and p
A statistically significant t-test with a tiny effect size (small Cohen's d) may not be practically important. Report Cohen's d alongside the t-statistic to give readers a complete picture.
Welch's t-test for unequal variances
If one group's standard deviation is more than twice the other's, use Welch's t-test, which does not assume equal variances. Most statistical software uses Welch's by default.
Check normality for small samples
For n < 30, the t-test assumes the data is approximately normally distributed. For small samples with non-normal data, consider a non-parametric alternative like the Mann-Whitney U test.
Worked Examples
Drug trial: treatment vs. control
T-statistic: −3.00. With df ≈ 78, this exceeds the critical value of ±1.99 at α=0.05. The treatment group has a significantly lower mean — a meaningful result.
Comparing two customer segments
T-statistic: 0.81. With df ≈ 98, this is well below the critical value of 1.98 at α=0.05. No significant difference in spending between the two segments.
Advertisement
Frequently Asked Questions
What does the t-test tell you?
The t-test tests whether the means of two groups are significantly different from each other. A large t-statistic (relative to degrees of freedom) suggests the observed difference is unlikely due to sampling variation alone.
What is the difference between a one-sample and two-sample t-test?
A one-sample t-test compares a sample mean to a known population value. A two-sample t-test compares the means of two independent groups to each other.
What is Welch's t-test?
Welch's t-test is a version of the independent samples t-test that does not assume the two groups have equal variances. It uses a modified degrees of freedom formula. Most modern software uses Welch's by default.
What does degrees of freedom mean in a t-test?
Degrees of freedom roughly equals the total sample size minus the number of groups (n₁ + n₂ − 2 for two independent groups). Higher df means the t-distribution is closer to the normal distribution and critical values are smaller.
What p-value corresponds to a given t-statistic?
The p-value depends on both the t-statistic and degrees of freedom. For df > 30, critical values at α=0.05 are approximately ±1.96 (two-tailed). For exact p-values, use a t-distribution table or statistical software.
Advertisement