T Test Two Samples Calculator
Computes Student t statistic for two independent samples from means, standard deviations and sizes using pooled variance approach.
—
Student's t-test: comparing means
The Student's t-test compares means when you do not know the population standard deviation and the sample is small. The one-sample statistic is t = (x̄ − μ₀) / (s/√n), which you evaluate against the t distribution with df = n − 1. The two-sample version compares two means, using either pooled or Welch variance depending on whether the variances are equal. There is a nice backstory here. William Sealy Gosset published the method in 1908 under the pen name "Student" while working at the Guinness brewery in Dublin, because the company would not let employees publish under their own names. The t distribution carries heavier tails than the normal and approaches it as df → ∞. Worked example: two samples (50, s = 8, n = 30) and (55, s = 10, n = 28) give a pooled SE ≈ 2.39 and t ≈ −2.09 with df ≈ 56, so the two-tailed p ≈ 0.041, significant at the 5% level.
Applications
Checking a laboratory measurement against a certified reference value. Running A/B tests on website conversion rates. Weighing two teaching methods, the kind of comparison used in ENADE-style quality assessments. Two-arm clinical trials. Agronomy experiments that pit fertilizers against each other. And any quality-control workflow where you contrast two samples.
FAQ
When should I use t instead of z? Whenever σ is unknown, which is nearly always the case in practice, and n is small. Once n gets large, the two converge on similar results.
One-tailed or two-tailed? Go two-tailed when you just want to catch any difference at all. Go one-tailed when your hypothesis names a direction, as in "treatment is better than control". The one-tailed version roughly halves the p-value.
What if the variances are very different? Switch to Welch's t-test. It adjusts the degrees of freedom via Satterthwaite and makes no assumption that the variances are equal.
And if the data are not normal? For moderate n the t-test holds up well thanks to the CLT. When the data are badly skewed or n is small, reach for a nonparametric alternative such as Mann-Whitney.
Related Tools
CI for Difference of Two Means (t)
Computes the confidence interval for the difference between the means of two independent groups, using the t distribution with pooled variances. It's the natural companion to the two-sample t-test: instead of only saying whether the difference is significant, it shows the plausible range for the real size of that difference. If the interval doesn't contain zero, there's a significant difference at the chosen level. Enter the two samples of values and the confidence level.
Kolmogorov-Smirnov Test (Two-Sample)
Computes the two-sample Kolmogorov-Smirnov test, which checks whether two samples come from the same distribution — without assuming what that distribution is. It compares the empirical cumulative distribution functions of the two samples and takes the largest vertical distance between them, the D statistic. Unlike the t-test, which only compares means, the KS test is sensitive to any difference in shape, spread or location. Enter the two samples of values.
CI for the Difference of Two Proportions
Computes the confidence interval for the difference between two proportions, using the Wald method. It's the companion to the two-proportion z-test and the basis of any A/B test reading: beyond saying whether the difference is significant, it shows the plausible range for its real size. If the interval doesn't contain zero, there's a significant difference. For example: variant A converted 45 of 100 and B, 30 of 100 — what's the interval for the difference? Enter the successes and the total of each group and the confidence level.
Two-Proportion z-Test
Computes the two-proportion z-test statistic, which compares the success rates of two independent groups — the backbone of any A/B test. For example: variant A converted 45 of 100 and B converted 30 of 100; is the difference real or noise? The statistic uses the pooled proportion of the two groups to estimate the standard error under the hypothesis that the proportions are equal. Enter the successes and the total of each of the two groups.
Brown-Forsythe Test (Variances)
Computes the Brown-Forsythe test, a robust version of Levene's test for checking whether several groups share the same variance. The difference lies in one decisive detail: instead of measuring how far each point sits from the group mean, it uses the distance from the median. Because the median resists extreme values and skewed distributions, the test becomes much more reliable when the data aren't normal. Enter the groups: values by comma, groups by semicolon.
Runs Test (Wald-Wolfowitz)
Computes the Wald-Wolfowitz runs test, which checks whether a sequence of two values is random or has a pattern. A run is a stretch of consecutive equal values; too few runs indicate clustering (a trend), and too many indicate systematic alternation. By comparing the observed number of runs with the number expected under randomness, the z statistic reveals whether the order of the data is compatible with pure chance. It's useful for checking residuals, time series and number generators. Enter the sequence with two distinct symbols.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.