What a t-test tells you
A t-test compares the averages of two groups and asks whether the difference is bigger than random variation would usually produce. Did customers who saw the new checkout spend more on average? Do weekday orders differ in size from weekend orders? Did a training course raise test scores?
Paste the raw values for each group (straight from a spreadsheet column), pick the test type and you get the difference, a p-value, a 95% confidence interval and an effect size, with a plain-English summary.
Which t-test should I use?
- Welch's t-test (the default here) compares two independent groups without assuming they have the same spread. It's the safest general choice, and many statisticians recommend it as the default.
- Student's t-test assumes both groups have equal variances. It's what many textbooks teach first; if the variances really are similar, it gives almost the same answer as Welch's.
- Paired t-test is for the same subjects measured twice (before and after) or naturally matched pairs. Each pair's difference is analysed, which removes variation between subjects and usually gives a more sensitive test.
The formulas
Welch: t = (mean A − mean B) ÷ √( sA²/nA + sB²/nB )
df = (sA²/nA + sB²/nB)² ÷ [ (sA²/nA)²/(nA−1) + (sB²/nB)²/(nB−1) ]
Student: t = (mean A − mean B) ÷ √( sp² × (1/nA + 1/nB) ), sp² = pooled variance, df = nA + nB − 2
Paired: t = mean of differences ÷ (SD of differences ÷ √n), df = n − 1
95% CI = difference ± t(0.975, df) × standard error
Cohen's d = difference ÷ pooled standard deviation
Worked example
The example compares average order values in dollars for 12 customers who saw a new product page (group A) and 12 who saw the old one (group B). Group A averages about $48.0 and group B about $40.6, a difference of roughly $7.4.
Welch's t-test gives t ≈ 3.5 with about 18 degrees of freedom and a p-value of about 0.003. The 95% confidence interval for the difference runs from roughly $3 to $12. The difference is very unlikely to be chance, and the Cohen's d of about 1.4 is a large effect.
Before acting on a result like this, I'd still check the practical side: with only 12 customers per group, the interval is wide. My guide on how to tell if an A/B test actually won explains why the interval matters more than the verdict.
Reading the result
- p-value below 0.05: the difference between the averages is statistically significant at the usual 95% level.
- The confidence interval gives the likely range of the true difference. If it excludes zero, the result is significant; its width tells you how precise your estimate is.
- Cohen's d expresses the difference in standard deviations: around 0.2 is small, 0.5 medium and 0.8 large. It helps you judge whether a significant difference actually matters.
Assumptions
- Independent observations within each group (except for the paired test, where the pairs are linked by design).
- Roughly normal data, or large enough samples. With 30 or more values per group, the t-test is fairly robust even when data is skewed. With small, very skewed samples or big outliers, consider a non-parametric test (Mann-Whitney U) or check your data first with the descriptive statistics calculator.
- Numeric outcomes. For yes/no outcomes like conversions, use the A/B test calculator; for counts in categories, the chi-square calculator.
Common mistakes
- Using an unpaired test on paired data. Before-and-after scores for the same people need the paired test; otherwise you throw away the most useful information and lose sensitivity.
- Running many t-tests on several groups. Comparing four groups two at a time inflates the chance of a false positive. Use ANOVA instead.
- Ignoring outliers. One huge order can drag a mean and swing the result. Look at the data before testing.
- Stopping when the result looks good. Decide the sample size first, then test once.
Questions
What is the difference between a t-test and a z-test?
A z-test assumes you know the population's standard deviation, which you rarely do. A t-test estimates it from your sample, which is why it's the standard choice for comparing averages.
What is a two-tailed t-test?
It checks for a difference in either direction (A higher or lower than B). This calculator reports two-tailed p-values, the safer default.
How many values do I need per group?
The test works with as few as 2, but results are only meaningful with reasonable samples. Small samples can only detect large differences.
Is my data uploaded?
No. Everything is calculated in your browser.
Last reviewed 2026-11-26