T-Test Calculator
Run a one-sample or Welch's two-sample t-test with p-value and degrees of freedom.
Quick answer
A t-statistic is the difference between means divided by the standard error of that difference, converted to a p-value using the degrees of freedom. Welch's two-sample version doesn't assume equal variances and is the recommended default; use a paired t-test instead whenever the same subjects are measured twice.
t-statistic
2.061
p = 0.0439 (two-tailed)
Degrees of freedom
57
Difference in means
4
Standard error
1.9408
Result
Significant at 0.05
Welch's test doesn't assume equal variances, which is the safer default for two samples. Both forms assume roughly normal data or a sample large enough for the means to be normal.
What the t-statistic is
A t-statistic is a signal-to-noise ratio: the difference you observed divided by the standard error of that difference. A t of 2 means the gap between groups is twice as large as the sampling wobble you would expect by chance. The t-distribution then converts that ratio into a p-value, using degrees of freedom to account for how much the sample size limits your certainty about the spread.
Worked example: two groups of 30
Group 1 averages 52 with a standard deviation of 8; group 2 averages 48 with a standard deviation of 7. The standard error of the difference is √(64/30 + 49/30) = 1.941, so t = 4 ÷ 1.941 = 2.061. Welch's formula gives about 57 degrees of freedom, and the two-tailed p-value is roughly 0.044 — significant at 0.05, but not at 0.01, and close enough to the line that a few more observations could change the verdict.
Welch's test is the better default
The classic Student's t-test assumes both groups share the same variance. Welch's version does not, and it costs almost nothing in power when the variances happen to be equal — so statisticians now recommend it as the routine choice for two independent samples. Its degrees of freedom are usually fractional, which is why you'll see a value like 57.0 instead of a whole number.
Which test for which design
Use a one-sample test to compare one group against a known or target value. Use a two-sample test for two independent groups. If the same subjects are measured twice — before and after — neither applies: you need a paired t-test, which runs a one-sample test on the differences and is far more powerful because it removes between-subject variation. Feeding paired data into a two-sample test throws that advantage away.
Assumptions and when they bite
The t-test assumes roughly normal data, or samples large enough — commonly 30 or more per group — for the central limit theorem to make the means normal regardless. It is reasonably robust to mild skew, but not to strong outliers, which inflate the standard deviation and quietly hide real differences. Always plot the data first. For badly non-normal small samples, a Mann-Whitney U or Wilcoxon test is the appropriate alternative.
Frequently asked questions
- What is a good t-value?
- There's no universal threshold — it depends on degrees of freedom. With large samples, |t| above about 1.96 gives a two-tailed p below 0.05, but with 10 degrees of freedom you need roughly 2.23 for the same p. Read the p-value rather than judging t on its own.
- What is the difference between Student's and Welch's t-test?
- Student's assumes both groups have equal variance; Welch's does not. Welch's is now the recommended default for independent samples because it loses almost no power when variances are equal and stays accurate when they aren't. Its degrees of freedom are usually fractional as a result.
- When should I use a paired t-test instead?
- Whenever the two measurements come from the same subjects — before and after, left and right, matched pairs. A paired test analyses the differences directly, removing between-subject variation, which makes it considerably more powerful than treating the measurements as independent groups.
- How large does my sample need to be for a t-test?
- Around 30 per group is the usual rule of thumb, at which point the central limit theorem makes the sample means approximately normal even if the underlying data isn't. Smaller samples are fine if the data really is normal, but they're vulnerable to outliers and skew.
Related calculators
Percentage Calculator
Solve any percentage problem: percent of, percent change, and more.
Fraction Calculator
Add, subtract, multiply, and divide fractions with simplified results.
Scientific Calculator
A full scientific calculator with trig, logs, and exponents.
Random Number Generator
Generate random numbers in any range, with or without repeats.