T Test Calculator

Run a two-sample Welch t test from group means, standard deviations, and sample sizes with an instant two-tailed p-value.

Independent two-sample t test
Compare two independent means without assuming equal population variances.

About the two-sample t test

An independent two-sample t test evaluates whether the means of two unrelated groups differ beyond what random sampling variation would commonly produce. This calculator uses Welch's t test, which does not require the two populations to have equal variances. It works from summary statistics: each group's mean, sample standard deviation, and sample size. That makes it useful when raw observations are unavailable but reliable summaries are known. The test statistic is the difference between group means divided by its standard error. For Welch's method, the standard error is √(s₁²/n₁ + s₂²/n₂). A positive statistic means the first mean is larger; a negative statistic means the second is larger. Reversing the group order changes the sign but not the two-tailed p-value. The statistic's absolute magnitude expresses the observed mean difference in estimated standard-error units. Welch–Satterthwaite degrees of freedom account for both group variances and sample sizes. They are often fractional, which is expected. When group sizes and standard deviations match, the degrees of freedom reduce to n₁ + n₂ − 2, the same value produced by the classical pooled test. When variability or sample sizes differ, Welch's adjusted degrees of freedom generally provide more dependable Type I error control than automatically pooling variances. The reported p-value is two-tailed. It is the probability, under a null hypothesis of equal population means and the model assumptions, of obtaining a t statistic at least as extreme in either direction. A small p-value indicates incompatibility with the null model; it does not measure the probability that the null hypothesis is true. Compare it with a significance level chosen before analysis, and avoid treating an arbitrary threshold as a measure of practical importance. The procedure assumes independent observations within and between groups, a quantitative outcome, and samples that appropriately represent their target populations. With small samples, severe skew or influential outliers can undermine the test. Larger samples make inference more robust to moderate non-normality, but independence and sound sampling remain essential. If observations are paired, such as before-and-after measurements on the same people, an independent test is inappropriate; use a paired t test on within-pair differences instead. Statistical significance should be reported alongside the actual mean difference, uncertainty, and context. A confidence interval communicates the range of plausible population differences, while an effect size such as Cohen's d helps express magnitude. This calculator provides an accurate Welch statistic and p-value for quick analysis or arithmetic checking, but decisions should also consider study design, multiple comparisons, measurement quality, and whether the difference is meaningful in the subject area.

T test examples

Group summariesResultInterpretation
G1: 10, SD 2, n 25; G2: 8, SD 2, n 25t = 3.5355; df = 48Equal variability and sample sizes produce the familiar integer degrees of freedom.
G1: 5, SD 1, n 10; G2: 4, SD 1, n 10t = 2.2361; df = 18The observed difference equals about 2.24 standard errors.
G1: 20, SD 5, n 12; G2: 20, SD 3, n 18t = 0; p = 1Equal sample means produce no evidence of a mean difference.

How to run a two-sample t test

  1. Enter the mean, sample standard deviation, and sample size for group 1.
  2. Enter the corresponding three summary statistics for independent group 2.
  3. Click Run t test to calculate Welch's statistic, degrees of freedom, and two-tailed p-value.
  4. Interpret the p-value with a preselected alpha and consider the size and direction of the mean difference.

T test FAQ

Why does this calculator use Welch's t test?

Welch's test remains valid when group variances or sample sizes differ. It also closely matches the pooled test when those quantities are equal.

What does the two-tailed p-value test?

It tests for a difference in either direction between population means. It counts results at least as extreme as the observed statistic in both tails.

Why are degrees of freedom sometimes decimal?

Welch's approximation adjusts degrees of freedom for unequal variance and sample size. Fractional values are mathematically valid and should not be rounded before finding a p-value.

Can I use this test for paired observations?

No, paired observations are not independent and require analysis of within-pair differences. Use a paired t test for repeated measurements or matched subjects.

Does a small p-value mean the difference is important?

No, statistical evidence and practical importance are different ideas. Review the mean difference, a confidence interval, and an effect size in context.