What is an Independent Samples t-Test Calculator?
An independent samples t-test calculator tests whether two unrelated groups have different population means. Enter each group’s raw values, or its mean, standard deviation and size, and it returns Student’s pooled t-test (df = n₁ + n₂ − 2) and Welch’s unequal-variance t-test side by side, Levene’s test to choose between them, the p-value, a confidence interval for μ₁ − μ₂, Cohen’s d and an APA-style sentence.
What the Independent Samples t-Test Calculator does
This independent samples t test calculator (also called an independent t-test calculator, an unpaired t-test calculator or a t-test calculator for 2 independent means) is the full-report version of the two-group t-test, laid out like the output of a statistics package. From raw data or summary statistics it produces a group statistics table, the pooled (Student) and Welch results in one table (t, df, p, mean difference, standard error and confidence interval), Levene’s test for equality of variances, Cohen’s d and Hedges’ g with approximate confidence intervals, and a ready-to-paste APA-style sentence that uses your own variable and group names.
Use it when two separate groups are measured once on a numeric outcome: treatment against control, two classes, two production lines. The Variance assumption setting decides which test is the headline; on Automatic, Welch is used when Levene’s test is significant. If you only need one test with its formula walk-through, the Two-Sample t-Test Calculator (pooled only) and the Welch’s t-Test Calculator (Welch only) are shorter pages. For before-and-after or matched data, use the Paired t-Test Calculator; if you are not sure which t-test fits your design, start with the T-Test Calculator.
How to use the Independent Samples t-Test Calculator
- Choose the alternative hypothesis for μ₁ − μ₂ and the significance level α.
- Leave Variance assumption on Automatic, or force Equal variances (Student) or Unequal variances (Welch).
- Under Data input, pick Raw data and paste the Group 1 values and Group 2 values, or pick Summary statistics and enter each group’s mean, SD and size.
- Optionally type a Variable name and the two group names; they appear in the tables and in the write-up.
- Read the highlighted row of the test table, check Levene’s test and the effect size, then copy the APA-style sentence.
Raw data or summary statistics: which should you enter?
Enter raw data when you have every observation. The calculator then works out each group’s mean, standard deviation, median and range, and it can run Levene’s test, which needs the individual values. Paste numbers separated by commas, spaces or new lines; the two groups can have different sizes.
Enter summary statistics when you only have each group’s mean, standard deviation and sample size, for example from a published table or a paper you are reviewing. The t statistic, p-value, confidence interval and Cohen’s d are exactly the same as with raw data. Only Levene’s test is lost, so on Automatic the calculator falls back on a rule of thumb: Welch’s test when one SD is more than twice the other. Make sure the SDs are sample standard deviations (n − 1 divisor), not standard errors; if a source gives SE, multiply it by √n first.
How to calculate an independent samples t-test by hand
The calculator follows these steps and shows each one with your numbers in the step-by-step solution.
- Find each group’s mean (x̄₁, x̄₂), standard deviation (s₁, s₂) and size (n₁, n₂), and the mean difference x̄₁ − x̄₂.
- Check the equal-variance assumption with Levene’s test or by comparing the two SDs.
- Student (pooled): pool the variances, sₚ² = [(n₁ − 1)s₁² + (n₂ − 1)s₂²] / (n₁ + n₂ − 2), then SE = sₚ √(1/n₁ + 1/n₂) and df = n₁ + n₂ − 2.
- Welch: keep the variances separate, SE = √(s₁²/n₁ + s₂²/n₂), and compute the Welch–Satterthwaite df.
- Divide the mean difference by its standard error: t = (x̄₁ − x̄₂) / SE.
- Find the p-value from the t distribution with that df (or compare |t| with the critical value from the t table) and reject H₀ when p ≤ α.
- Report the confidence interval (x̄₁ − x̄₂) ± t* × SE and an effect size such as Cohen’s d.
Independent Samples t-Test formula
| Symbol | Meaning |
|---|---|
| x̄₁, x̄₂ | sample means of groups 1 and 2 |
| s₁, s₂ | sample standard deviations (n − 1 divisor) |
| n₁, n₂ | group sizes |
| sₚ | pooled standard deviation |
| Zᵢⱼ | absolute deviation of observation j from the mean of group i |
Conventions: Levene’s test is centred on the group mean, as in SPSS (SciPy and R’s car package centre on the median by default). The Welch df is not rounded. Confidence intervals for the mean difference use the (1 − α) level and are always two-sided.
When Welch’s test is the headline, the write-up reports d with the average-variance standard deviation, √[(s₁² + s₂²)/2], because the pooled SD assumes equal variances. Both versions appear in the effect-size table.
Worked example
Worked example: reaction time after sleep loss
Problem. Reaction times in milliseconds. Rested (n₁ = 12): 248, 262, 255, 240, 259, 251, 266, 245, 257, 253, 249, 260. Sleep-deprived (n₂ = 10): 262, 301, 255, 288, 274, 246, 312, 269, 295, 281. Do the mean reaction times differ at α = 0.05?
- 01Group statistics: Rested x̄₁ = 253.75, s₁ = 7.5453; Sleep-deprived x̄₂ = 278.3, s₂ = 21.0505. Mean difference = −24.55.
- 02Levene’s test (mean-centred): F(1, 20) = 10.6246, p = 0.0039. The variances differ, so Automatic selects Welch’s test.
- 03Welch: SE = √(7.5453²/12 + 21.0505²/10) = √(4.7443 + 44.3122) = 7.0040, t = −24.55 / 7.0040 = −3.5051, df = 10.9279, p = 0.0050.
- 04Student (for comparison): sₚ = 15.1894, SE = 6.5037, t = −3.7748, df = 20, p = 0.0012.
- 0595% CI for μ₁ − μ₂ (Welch): −24.55 ± 2.2028 × 7.0040 = (−39.9782, −9.1218).
- 06Effect size: d = −24.55 / √[(7.5453² + 21.0505²)/2] = −24.55 / 15.8122 = −1.5526 (pooled-SD d = −1.6163, Hedges’ g = −1.5549).
Answer. Reaction time was significantly lower for Rested (M = 253.75, SD = 7.55) than for Sleep-deprived (M = 278.30, SD = 21.05), Welch’s t(10.93) = −3.51, p = .005, d = −1.55, 95% CI of the difference [−39.98, −9.12]. Both rows of the test table agree on the decision here; the Welch row is the one to report because the spreads differ.
How to interpret the p-value, confidence interval and Cohen’s d
The p-value is the probability of a mean difference at least this large if the two population means were equal. If it is at or below α (usually 0.05), the difference is statistically significant. It does not tell you how big or important the difference is; see what a p-value means.
The confidence interval for μ₁ − μ₂ gives the range of plausible values for the true difference, in the units of your data. A two-sided interval that excludes 0 agrees with a significant two-tailed test at the same α. In the reaction-time example, the 95% interval (−39.98, −9.12) ms is consistent with sleep-deprived participants being about 9 to 40 ms slower on average.
Cohen’s d puts the difference in standard-deviation units, so it can be compared across studies and measuring scales. The sign only shows which group was higher. Cohen’s benchmarks are a rough guide; a “small” effect can matter in medicine and a “large” one can be trivial in other settings. For d from published statistics, or for other effect sizes, use the Effect Size Calculator.
| |d| | Cohen’s label | Overlap of two normal curves with equal SD |
|---|---|---|
| 0.2 | Small | 92% |
| 0.5 | Medium | 80% |
| 0.8 | Large | 69% |
| 1.2 | Very large (Sawilowsky, 2009) | 55% |
Student or Welch: which row should you report?
The two rows answer the same question under different assumptions. Student’s test is slightly more powerful when the population variances really are equal; Welch’s test stays accurate when they are not, and loses very little when they are. The rows diverge most when the smaller group has the larger spread.
| Equal variances assumed (Student) | Equal variances not assumed (Welch) | |
|---|---|---|
| Standard error | sₚ √(1/n₁ + 1/n₂) | √(s₁²/n₁ + s₂²/n₂) |
| Degrees of freedom | n₁ + n₂ − 2 | Welch–Satterthwaite, usually not whole |
| Report it when | Levene’s p > 0.05 and similar SDs | Levene’s p ≤ 0.05, or as a safe default |
| Where you see it | Most textbooks; first row of SPSS output | Default of R’s t.test; second row of SPSS output |
How the APA-style sentence is built
APA style reports each group’s mean and standard deviation, then the test statistic with its degrees of freedom, the p-value and an effect size: t(df) = value, p = value, d = value. Statistics are rounded to two decimals, p to three with no leading zero, and very small p-values are written as p < .001. Welch’s degrees of freedom keep their decimals, which also signals to readers which test was used.
The sentence generated above follows that pattern and states the direction of the difference when the result is significant. Edit the wording to suit your study, and say in your method section how the variance assumption was handled.
Sources and how the results were checked
The formulas follow the standard references below. The worked example and the three built-in examples were checked against SciPy’s ttest_ind (pooled and Welch) and levene with center='mean'; the t, df, p, confidence limits and Levene F agree to the four decimals shown.
- Welch, B. L. (1947). The generalization of “Student’s” problem when several different population variances are involved. Biometrika, 34(1–2), 28–35. doi:10.1093/biomet/34.1-2.28
- Levene, H. (1960). Robust tests for equality of variances. In I. Olkin (Ed.), Contributions to Probability and Statistics (pp. 278–292). Stanford University Press.
- Delacre, M., Lakens, D., & Leys, C. (2017). Why psychologists should by default use Welch’s t-test instead of Student’s t-test. International Review of Social Psychology, 30(1), 92–101. doi:10.5334/irsp.82
- NIST/SEMATECH e-Handbook of Statistical Methods, Two-Sample t-Test for Equal Means.
- Sawilowsky, S. S. (2009). New effect size rules of thumb. Journal of Modern Applied Statistical Methods, 8(2), 597–599.
Common use cases
- Writing up a two-group comparison for a thesis, lab report or journal article in APA format.
- Checking homework or SPSS output that shows both “equal variances assumed” and “not assumed” rows.
- Comparing a treatment group with a control group in an experiment or A/B test with a numeric outcome.
- Seeing how much the conclusion depends on the equal-variance assumption before choosing a test.
- Getting Cohen’s d or Hedges’ g for a meta-analysis from published means and standard deviations.
Assumptions and limitations
- Independent groups: each subject appears in one group only and observations do not influence each other. Matched or repeated measurements need the Paired t-Test Calculator.
- Approximate normality: each population should be roughly normal, which matters most below about 15 to 30 observations per group. For small, clearly skewed samples a rank-based test such as Mann–Whitney is safer.
- Choosing a test from Levene’s result is a convenience, not best practice. The two-step procedure slightly distorts the error rate, and Levene’s test has little power in small samples. Many statisticians recommend reporting Welch’s test regardless; the Unequal variances setting does that.
- With summary statistics Levene’s test is unavailable, so the automatic choice uses a rule of thumb (one SD more than twice the other). You can check the ratio formally with the F-Test Calculator if the data are normal.
- For three or more groups, use the ANOVA Calculator rather than several t-tests.
Frequently asked questions
What is an independent-samples t-test?
Should I report the equal variances assumed or not assumed row?
What does Levene’s test tell me in a t-test output?
How do I report an independent-samples t-test in APA style?
What is the difference between Cohen’s d and Hedges’ g?
Can the two groups have different sample sizes?
Can I run an independent samples t-test from the mean and standard deviation?
Why are the Welch degrees of freedom not a whole number?
Cite this page
Statculator. (2026, November 14). Independent Samples t-Test Calculator. Retrieved November 14, 2026, from https://statculator.com/hypothesis-tests/independent-samples-t-test-calculator/