# Two-Sample t-Test Calculator (Welch)

URL: https://speedycalculator.com/calculators/statistics/two-sample-t-test/
Last updated: 2026-10-25

> This calculator compares the means of two independent groups with Welch’s t-test, which does not assume equal variances. It gives t, the Welch degrees of freedom and the two-tailed p-value.

## Inputs

- Mean of group 1
- SD of group 1
- Size of group 1
- Mean of group 2
- SD of group 2
- Size of group 2

## Results

- t statistic
- Degrees of freedom
- Two-tailed p-value

## Formula

```
t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂)
```

## Explanation

Welch’s test is the recommended default for comparing two group means, such as treatment and control.

### How to use the Two-Sample t-Test Calculator

- **Mean of group 1**
- **SD of group 1**
- **Size of group 1**
- **Mean of group 2**
- **SD of group 2**
- **Size of group 2**

Results update as you type, and every field accepts the units shown in its menu.

### How it works

The difference in means is divided by the combined standard error; degrees of freedom use the Welch–Satterthwaite formula.

### Inputs explained

FieldWhat to enterMean of group 1A numberSD of group 1A numberSize of group 1A numberMean of group 2A numberSD of group 2A numberSize of group 2A number

### What each result means

- **t statistic** = ([Mean of group 1] - [Mean of group 2])÷sqrt([v1] + [v2])
- **Degrees of freedom** = ([v1] + [v2])^2÷([v1]^2÷([Size of group 1] - 1) + [v2]^2÷([Size of group 2] - 1))
- **Two-tailed p-value** = 2×(1 - tcdf(abs([t statistic]), [Degrees of freedom]))

### Example values

How the main result changes when **Mean of group 1** changes and everything else stays at the example values above:

Mean of group 1Two-tailed p-value12.052.5888e-1118.080.003524.10.034830.137.6908e-1036.15048.20

## Worked example

Inputs — Mean of group 1: 24.1; SD of group 1: 4.2; Size of group 1: 35; Mean of group 2: 21.6; SD of group 2: 5; Size of group 2: 30.

Results — t statistic = 2.1618; Degrees of freedom = 56.93; **Two-tailed p-value = 0.03485**.

## FAQ

**Why Welch instead of Student’s t-test?**
Welch remains accurate when group variances differ and loses little when they are equal.

**What about paired data?**
Use a one-sample t-test on the differences.

**What formula does the Two-Sample t-Test Calculator use?**
t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂).


## Sources

- [NIST/SEMATECH e-Handbook of Statistical Methods](https://www.itl.nist.gov/div898/handbook/)
