The independent samples t-test (also called the two-sample t-test or Student's t-test) tells you whether the means of two unrelated groups differ by more than you would expect from chance. It is one of the most used tests in psychology, education, health and business research, and it is usually the first inferential test students learn.
This guide covers when to use it, its assumptions, how to run it in a free online calculator, how to read every number in the output, and how to write the result in APA 7 style.
In this guide
When to use an independent samples t-test
Use it when all of these are true:
- You have one continuous outcome, such as a test score, reaction time, blood pressure or a scale score.
- You have one grouping variable with exactly two levels, such as control vs treatment or male vs female.
- Each participant belongs to only one group.
Typical research questions:
- Do students taught with method A score higher than students taught with method B?
- Is average job satisfaction different between remote and office-based employees?
- Do patients on the new drug have lower systolic blood pressure than patients on placebo?
If the same people are measured twice, use a paired t-test instead. If you have three or more groups, use a one-way ANOVA.
Hypotheses
- Null hypothesis (H₀): the two population means are equal (μ₁ = μ₂).
- Alternative hypothesis (H₁): the means are not equal (μ₁ ≠ μ₂), for a two-tailed test.
Use a one-tailed test only if you stated the direction before collecting data and a difference in the other direction would be meaningless. In most theses and papers, two-tailed tests are expected.
Assumptions and how to check them
- Independence of observations. Each person contributes one score, and groups do not overlap. This is a design issue: no test can fix it afterwards.
- Continuous outcome. Interval or ratio data. A scale score averaged from several items is fine; a single 5-point item is better analysed with the Mann-Whitney U test.
- Approximate normality within each group. Check a histogram or Q-Q plot, and optionally the Shapiro-Wilk test. With 30 or more people per group, the t-test is robust to moderate skew.
- Homogeneity of variance. The two groups should have similar spread. Levene's test checks this. If it is significant, or the group sizes are very unequal, use Welch's t-test.
- No extreme outliers. A single extreme value can shift a mean a lot. Investigate outliers with the outlier calculator before deciding what to do.
Many statisticians now recommend reporting Welch's t-test by default, because it performs as well as Student's test when variances are equal and much better when they are not. The free calculator shows both, together with Levene's test, so you can follow whichever convention your field or supervisor expects.
How to run the test (step by step)
- Open the independent samples t-test calculator.
- Paste your data from Excel, Google Sheets or SPSS. You can use two columns (one per group) or long format (one outcome column and one group column).
- Choose the outcome and grouping variable, and the confidence level (95% by default).
- Click Run. The tool reports group descriptives, Levene's test, Student's and Welch's t, degrees of freedom, the p-value, the mean difference with its 95% confidence interval, and Cohen's d and Hedges' g.
- Copy the APA-formatted table into your report, or export it.
Your data never leave your browser, which matters if you work with patient or student records.
How to interpret the output
Here is an example. A researcher compares exam scores between students who used a spaced-practice app (n = 32) and students who did not (n = 30).
| Group | n | Mean | SD |
|---|---|---|---|
| App | 32 | 74.6 | 9.8 |
| No app | 30 | 68.9 | 10.4 |
Levene's test: F(1, 60) = 0.21, p = .65. Not significant, so the equal-variance assumption looks reasonable.
t-test: t(60) = 2.22, p = .030, mean difference = 5.7, 95% CI [0.6, 10.8].
Read it in four steps:
- Direction. The app group scored 5.7 points higher on average.
- Significance. p = .030 is below .05, so we reject the null hypothesis of equal means.
- Precision. The 95% confidence interval [0.6, 10.8] does not include zero, which agrees with the p-value. It also shows the true difference could be as small as 0.6 points or as large as 10.8.
- Size. Cohen's d = 0.56, a medium effect by Cohen's (1988) rough benchmarks.
What is Cohen's d?
Cohen's d is the mean difference divided by the pooled standard deviation. It expresses the difference in standard-deviation units, so you can compare it across studies.
| Cohen's d | Rough interpretation |
|---|---|
| 0.20 | Small |
| 0.50 | Medium |
| 0.80 | Large |
These benchmarks are only a starting point. A "small" effect on mortality can be very important; a "large" effect on a trivial outcome may not be. For small samples (roughly n < 20 per group), report Hedges' g, which corrects d's slight upward bias.
How to report the result in APA 7
Report the means and SDs of both groups, the t statistic with degrees of freedom, the exact p-value, a confidence interval and an effect size. Italicise statistical symbols.
Students who used the spaced-practice app (M = 74.6, SD = 9.8) scored higher on the final exam than students who did not (M = 68.9, SD = 10.4), t(60) = 2.22, p = .030, 95% CI [0.6, 10.8], d = 0.56.
If you used Welch's test, the degrees of freedom are usually a decimal, and you should say so:
A Welch's t-test showed that the app group scored higher than the comparison group, t(59.1) = 2.22, p = .030, d = 0.56.
APA style details worth getting right:
- Report exact p-values to two or three decimals (p = .030), except write p < .001 for very small values.
- Do not put a zero before the decimal point for values that cannot exceed 1 (p, correlations), but do for values that can (d = 0.56, M = 0.80).
- Give confidence intervals in square brackets.
What if the assumptions are not met?
| Problem | What to do |
|---|---|
| Unequal variances | Use Welch's t-test |
| Strong skew with small samples | Use the Mann-Whitney U test |
| Ordinal outcome (single Likert item) | Use the Mann-Whitney U test |
| Extreme outliers | Check for data-entry errors; run the analysis with and without them and report both |
| Same people in both conditions | Use a paired t-test |
Planning the sample size
How many participants do you need? To detect a medium effect (d = 0.5) with 80% power at α = .05 (two-tailed), you need about 64 people per group. For a small effect (d = 0.2) you need about 394 per group. Use the free power analysis calculator to work out your own numbers, and see our sample size guide.
Frequently asked questions
What is the difference between Student's t-test and Welch's t-test?
Student's t-test assumes both groups have equal variances and pools them. Welch's t-test does not assume equal variances and adjusts the degrees of freedom. Welch's test is the safer default, especially when group sizes differ.
What does a significant Levene's test mean?
It means the group variances differ more than chance would explain. In that case, report Welch's t-test rather than Student's t-test.
What sample size do I need for an independent t-test?
It depends on the effect size you expect. To detect a medium effect (d = 0.5) with 80% power at α = .05, you need about 64 participants per group. A power analysis calculator gives the exact number for your design.
Can I use a t-test with unequal group sizes?
Yes. Unequal group sizes are fine, but they make the test more sensitive to unequal variances, so use Welch's t-test.
How do I report a non-significant t-test?
Report it in the same way, with the exact p-value and the effect size, for example: t(58) = 1.12, p = .267, d = 0.29. Do not write that the groups are "the same"; say that the difference was not statistically significant.