Skip to content
Statculator
Hypothesis Tests

Independent Samples t-Test Calculator

Free independent samples t test calculator: paste raw data or enter means and SDs for pooled and Welch t, Levene’s test, Cohen’s d, a CI and APA write-up.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try

Choose the direction your research question predicts. Use two-tailed if any difference matters.

Usually 0.05 or 0.01.

Decides which row is the headline result. Automatic uses Welch when Levene’s p ≤ 0.05 (raw data) or when one SD is more than twice the other (summary statistics). Both tests are always shown.

Data input
12 values

Separate values with commas, spaces or new lines. You can paste a column from Excel or Google Sheets.

10 values

Different subjects in each group. The groups can have different sizes.

Labels for the report

Used in the tables and the write-up.

Both the pooled (Student) and Welch tests are always reported. The Variance assumption setting only chooses which one is treated as the headline result.

Results

t statistic
-3.5051
Welch’s t-test
p-value
0.005
Two-tailed, df = 10.93
Cohen’s d
-1.5526
Large effect

Reject H₀ at α = 0.05

p = 0.005 ≤ 0.05. At the 5% level there is sufficient evidence that the population means of Rested and Sleep-deprived differ.

Headline test
Welch’s t-test
Mean difference, x̄₁ − x̄₂
-24.55
Standard error
7.004
Degrees of freedom
10.9279
Critical t (α = 0.05)
±2.2028
95% CI for μ₁ − μ₂
(-39.9782, -9.1218)
Levene’s test (mean-centred)
F = 10.6246, p = 0.0039
SD ratio, larger / smaller
2.7899
Cohen’s d (average-variance SD)
-1.5526 (large)
Pooled t-test p (for comparison)
0.0012

Interpretation: 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]. This sentence follows APA style and can be pasted into a report; the same text without italics is in the last step.

  • Levene’s test is significant (p = 0.0039 ≤ 0.05), so equal variances are not assumed and Welch’s test is the headline result.
  • One group has fewer than 15 observations, so both tests rely on the populations being roughly normal. Check each group for strong skew or outliers.
  • The write-up reports d with the average-variance SD, √[(s₁² + s₂²)/2], to match Welch’s test. The pooled-SD version is in the effect-size table; the two are equal when the group sizes are equal.
t distribution curve with the shaded probability region, markers at t = -3.505t = -3.505-4-3-2-101234t distribution, df = 10.93
Shaded area: rejection region at the chosen α. Dashed line: your test statistic.

Group statistics: Reaction time

GroupnMeanSDSE of meanMedianMinMax
Rested12253.757.54532.1781254240266
Sleep-deprived10278.321.05056.6567277.5246312

Independent samples test: Reaction time

Testtdfp-valueMean differenceSE95% CI lower95% CI upper
Equal variances assumed (Student, pooled)-3.7748200.0012-24.556.5037-38.1165-10.9835
Equal variances not assumed (Welch)-3.505110.92790.005-24.557.004-39.9782-9.1218

Highlighted row: the headline result. p-values are two-tailed; the confidence intervals are two-sided.

Levene’s test for equality of variances

CentreFdf₁df₂p-valueAt 0.05
Group mean (as SPSS reports)10.62461200.0039Variances differ

Computed as a one-way ANOVA on the absolute deviations from each group mean. For the median-centred (Brown–Forsythe) version, use the Levene’s Test Calculator.

Effect sizes

MeasureValue95% CI lower95% CI upperSize (Cohen’s rule of thumb)
Cohen’s d (pooled SD)-1.6163-2.5818-0.6507large
Hedges’ g (bias-corrected)-1.5549-2.4838-0.626large
Cohen’s d (average-variance SD)-1.5526-2.6686-0.4366large

Approximate intervals: d ± 1.96 × SE with SE = √[(n₁ + n₂)/(n₁n₂) + d²/(2(n₁ + n₂))] for the pooled d (multiplied by the correction factor for g) and a delta-method SE (Bonett, 2008) for the average-variance d. Benchmarks: 0.2 small, 0.5 medium, 0.8 large.

Step-by-step solution

  1. 1

    State the hypotheses

    This is a two-tailed test.

    H₀: μ₁ − μ₂ = 0
    H₁: μ₁ − μ₂ ≠ 0
  2. 2

    Choose the significance level

    α = 0.05
  3. 3

    Summarize each group

    Rested: x̄₁ = 253.75, s₁ = 7.5453, n₁ = 12
    Sleep-deprived: x̄₂ = 278.3, s₂ = 21.0505, n₂ = 10
    Mean difference: x̄₁ − x̄₂ = -24.55
  4. 4

    Check the equal-variance assumption (Levene’s test)

    Replace each value by its absolute distance from its own group mean and compare the two sets of distances with a one-way ANOVA. This is the mean-centred Levene test that SPSS reports.

    Mean absolute deviation: Rested = 6.0833, Sleep-deprived = 17.1
    Levene F(1, 20) = 10.6246, p = 0.0039
  5. 5

    Choose the test: Welch’s t-test

    Levene’s test is significant (p = 0.0039 ≤ 0.05), so equal variances are not assumed and Welch’s test is the headline result.

  6. 6

    Find the standard error without pooling

    Welch’s test keeps the two variances separate.

    s₁²/n₁ = 7.5453² / 12 = 4.7443; s₂²/n₂ = 21.0505² / 10 = 44.3122
    SE = √(s₁²/n₁ + s₂²/n₂) = √(4.7443 + 44.3122) = 7.004
  7. 7

    Calculate the test statistic

    t = (x̄₁ − x̄₂) / SE = (253.75 − 278.3) / 7.004 = -3.5051
  8. 8

    Find the Welch–Satterthwaite degrees of freedom

    df = (s₁²/n₁ + s₂²/n₂)² / [ (s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1) ]
    df = (4.7443 + 44.3122)² / [ 4.7443²/11 + 44.3122²/9 ] = 10.9279
  9. 9

    Find the p-value

    Use the t distribution with the Welch–Satterthwaite df = 10.9279 (not rounded, as in R, SPSS and SciPy).

    p = 2 × P(t ≥ |-3.5051|) = 0.005
  10. 10

    Find the critical value

    Critical value: ±2.2028
    Reject H₀ if |t| ≥ 2.2028
  11. 11

    Decision: reject H₀

    At the 5% level there is sufficient evidence that the population means of Rested and Sleep-deprived differ.

    p = 0.005 ≤ α = 0.05
  12. 12

    95% confidence interval for μ₁ − μ₂

    (x̄₁ − x̄₂) ± t* × SE = -24.55 ± 2.2028 × 7.004 = (-39.9782, -9.1218)
  13. 13

    Effect size

    Cohen’s d expresses the mean difference in standard-deviation units; Hedges’ g removes its small-sample bias.

    d = (x̄₁ − x̄₂) / sₚ = -24.55 / 15.1894 = -1.6163
    g = d × [1 − 3 / (4(n₁ + n₂ − 2) − 1)] = -1.6163 × 0.962 = -1.5549
    d with the average-variance SD = -24.55 / √[(7.5453² + 21.0505²) / 2] = -24.55 / 15.8122 = -1.5526
  14. 14

    Compare with the pooled (Student) t-test

    t(20) = -3.7748, p = 0.0012 → reject H₀
  15. 15

    Write up the result (APA style)

    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].

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

  1. Choose the alternative hypothesis for μ₁ − μ₂ and the significance level α.
  2. Leave Variance assumption on Automatic, or force Equal variances (Student) or Unequal variances (Welch).
  3. 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.
  4. Optionally type a Variable name and the two group names; they appear in the tables and in the write-up.
  5. 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.

  1. Find each group’s mean (x̄₁, x̄₂), standard deviation (s₁, s₂) and size (n₁, n₂), and the mean difference x̄₁ − x̄₂.
  2. Check the equal-variance assumption with Levene’s test or by comparing the two SDs.
  3. 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.
  4. Welch: keep the variances separate, SE = √(s₁²/n₁ + s₂²/n₂), and compute the Welch–Satterthwaite df.
  5. Divide the mean difference by its standard error: t = (x̄₁ − x̄₂) / SE.
  6. 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 ≤ α.
  7. Report the confidence interval (x̄₁ − x̄₂) ± t* × SE and an effect size such as Cohen’s d.

Independent Samples t-Test formula

Student (pooled)
t = (x̄₁ − x̄₂) / [ sₚ √(1/n₁ + 1/n₂) ], df = n₁ + n₂ − 2
Pooled variance
sₚ² = [(n₁ − 1)s₁² + (n₂ − 1)s₂²] / (n₁ + n₂ − 2)
Welch
t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)
Welch–Satterthwaite df
df = (s₁²/n₁ + s₂²/n₂)² / [ (s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1) ]
Levene (mean-centred)
F = one-way ANOVA F on Zᵢⱼ = |xᵢⱼ − x̄ᵢ|, df = (1, n₁ + n₂ − 2)
Effect sizes
d = (x̄₁ − x̄₂) / sₚ, g = d × [1 − 3 / (4(n₁ + n₂ − 2) − 1)]
Formula symbols
SymbolMeaning
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?

  1. 01Group statistics: Rested x̄₁ = 253.75, s₁ = 7.5453; Sleep-deprived x̄₂ = 278.3, s₂ = 21.0505. Mean difference = −24.55.
  2. 02Levene’s test (mean-centred): F(1, 20) = 10.6246, p = 0.0039. The variances differ, so Automatic selects Welch’s test.
  3. 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.
  4. 04Student (for comparison): sₚ = 15.1894, SE = 6.5037, t = −3.7748, df = 20, p = 0.0012.
  5. 0595% CI for μ₁ − μ₂ (Welch): −24.55 ± 2.2028 × 7.0040 = (−39.9782, −9.1218).
  6. 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 labelOverlap of two normal curves with equal SD
0.2Small92%
0.5Medium80%
0.8Large69%
1.2Very 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 errorsₚ √(1/n₁ + 1/n₂)√(s₁²/n₁ + s₂²/n₂)
Degrees of freedomn₁ + n₂ − 2Welch–Satterthwaite, usually not whole
Report it whenLevene’s p > 0.05 and similar SDsLevene’s p ≤ 0.05, or as a safe default
Where you see itMost textbooks; first row of SPSS outputDefault 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?

It is a test of whether two separate groups have the same population mean, based on the difference between their sample means divided by its standard error. “Independent” means the groups contain different, unrelated subjects. It is also called the unpaired, two-sample or between-subjects t-test.

Should I report the equal variances assumed or not assumed row?

Report “equal variances not assumed” (Welch) when Levene’s test is significant or the standard deviations are clearly different, and whenever group sizes are unequal and you are unsure. If Levene’s p is above 0.05 and the SDs are similar, the “assumed” (Student) row is acceptable. Many statisticians simply report Welch’s row every time.

What does Levene’s test tell me in a t-test output?

Levene’s test checks whether the two groups have equal variances, which Student’s pooled t-test assumes. A p-value of 0.05 or less means the variances differ, so read the Welch row. It is a test about spread only; it does not tell you whether the means differ.

How do I report an independent-samples t-test in APA style?

Give both groups’ means and standard deviations, then the statistic: for example, “Scores were higher for the flashcard group (M = 81.17, SD = 5.59) than for the re-reading group (M = 73.00, SD = 4.82), t(21) = 3.74, p = .001, d = 1.56.” Use two decimals, drop the leading zero of p, and include an effect size.

What is the difference between Cohen’s d and Hedges’ g?

Both express the mean difference in standard-deviation units. Cohen’s d divides by the pooled standard deviation and slightly overstates the population effect in small samples. Hedges’ g multiplies d by a correction factor, about 1 − 3/(4·df − 1), which removes most of that bias. With more than about 20 per group they are nearly identical.

Can the two groups have different sample sizes?

Yes. The independent-samples t-test does not need equal group sizes. Unequal sizes do make the pooled (Student) test more sensitive to unequal variances, especially when the smaller group has the larger SD, so Welch’s row is the safer one to report in that case.

Can I run an independent samples t-test from the mean and standard deviation?

Yes. Choose Summary statistics and enter each group’s mean, standard deviation and sample size. The t statistic, df, p-value, confidence interval and Cohen’s d match what raw data would give. Levene’s test needs the raw values, so the calculator compares the SDs directly instead.

Why are the Welch degrees of freedom not a whole number?

Welch’s test approximates the distribution of its statistic with a t distribution whose degrees of freedom come from the Welch–Satterthwaite formula, a weighted combination of the two sample variances. The result lies between the smaller group’s n − 1 and n₁ + n₂ − 2 and is rarely an integer; software uses the fractional value directly.

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/