Statistics

Two Sample T-Test Calculator

Compare independent sample means using Welch’s test or an explicitly chosen pooled-variance t-test.

Data stays on this deviceConvention explained below
Data explorer
Data explorer

Check the dataset and sample convention before interpreting results.

See the method

Add your observations

Runs on your device

Your statistical summary

Your result

Let’s calculate.

Use the Calculate button to see your result.

Review the method below for assumptions and conventions.

How to use this tool

  1. Enter sample a, sample b, variance assumption, alternative hypothesis, significance level.
  2. Select Calculate to view the result.
  3. Check the method and assumptions below before using the result.

Input reference and sample values

Use the units and choices shown for each field. Sample values are provided for practice, not as recommendations.

InputFormat and unitsSample
Sample AKeep the structure and separators shown in the sample. Line breaks are retained in this input.8, 10, 9, 12, 11
Sample BKeep the structure and separators shown in the sample. Line breaks are retained in this input.5, 7, 6, 8, 9
Variance assumptionChoose Welch: unequal variances / Pooled: equal variances.Welch: unequal variances
Alternative hypothesisChoose Two-sided: different / One-sided: greater / One-sided: less.Two-sided: different
Significance levelNumeric value. Minimum: 0.0001. Maximum: 0.2.0.05

Result for these sample inputs

0.0170716812 probability
Test statistic
3
Degrees of freedom
8
Decision at chosen alpha
Reject the null hypothesis
Mean A
10
Mean B
7
Difference A − B
3
Standard error
1

The p-value is not the probability that the null hypothesis is true. Choose the hypothesis and significance level before inspecting the result; statistical significance does not measure practical importance.

Select Try the example in the form to load these values and calculate them again. This replaces the current form inputs. Compare the result with the method and worked explanation below.

The method, explained

Welch: SE² = sA²/nA + sB²/nB, with Welch–Satterthwaite degrees of freedom. Pooled: combine variances weighted by n−1, and use df = nA+nB−2. t = (mean A−mean B)/SE.

A WORKED EXAMPLE

Using sample a = 8, 10, 9, 12, 11, sample b = 5, 7, 6, 8, 9, variance assumption = welch, alternative hypothesis = two, significance level = 0.05, the result is 0.0170716812 probability. Change these example inputs to match your task; use the method above to check each step.

What to keep in mind

Independent samples; approximate normality is important for small samples. Pooled mode additionally assumes equal population variances. A descriptive or probability calculation under the stated assumptions. Check the sample design and model before interpreting results.

Reference: NIST: statistical methods handbook

Common questions

When should I use Welch instead of pooled?

Welch allows the groups to have different variances and sample sizes. Choose pooled only when an equal-population-variance assumption is justified by the study.

What if the measurements are before and after on the same people?

Use the paired t-test. Treating matched measurements as independent discards the relationship between observations and uses the wrong standard error for that design.

Methodology maintained by ClarityKit. How these tools are built and checked.