T-test calculator
Three designs share one test statistic but not one formula. This runs the t-test your design calls for and gives you the result a thesis reports.
A t-test compares means using the t distribution to judge whether a difference is larger than sampling variation alone would produce. This calculator runs all three forms a dissertation uses: the one-sample test against a fixed value, the paired-samples test on before-and-after differences, and the independent-samples test for two groups, with a choice of the Welch or pooled Student version. Each result gives t, the exact degrees of freedom, the two-tailed p-value, and Cohen's d.
t statistic
4.626
t(17.15) = 4.63, p = < .001
The formula behind each t-test
Every t statistic divides a mean difference by its standard error. For one sample tested against a value μ₀:
t = (M - μ₀) / (s / √n)
The paired test uses the mean and standard deviation of the within-pair differences in the same formula, with df = n - 1. The independent-samples test divides the difference between the two group means by a standard error built from both groups. The pooled version assumes equal variances and uses df = n₁ + n₂ - 2; the Welch version does not, and uses the Welch-Satterthwaite approximation for the degrees of freedom, which is why its df is usually not a whole number. The two-tailed p-value comes from the exact t distribution, and Cohen's d standardises the difference by the pooled standard deviation.
Independent, paired, and one-sample t-tests
The three forms of the t-test share a statistic but answer different questions, and picking the wrong one quietly weakens your analysis. The independent-samples t-test compares the means of two separate groups of different people, such as a treatment group against a control group. The paired-samples t-test compares two measurements taken on the same people, such as a score before and after an intervention, and analyses the within-person differences. The one-sample t-test compares a single group's mean against a fixed benchmark value, such as a known population norm.
The design dictates the choice, not preference. Using an independent test on paired data discards the pairing that gives the design its sensitivity, usually costing you power and sometimes a real finding. When a third group enters the picture, a t-test no longer fits and the comparison becomes an analysis of variance instead; the move from a t-test to an ANOVA explains why. If you are weighing the t-test against other procedures entirely, the tool for choosing between statistical tests narrows it down from your variables.
Reading the t-table and how degrees of freedom shape the t distribution
The t distribution looks like the normal curve but carries heavier tails, and the weight of those tails is set entirely by the degrees of freedom. With few degrees of freedom the tails are fat, which reflects the extra uncertainty of estimating the standard deviation from a small sample, so the critical value you must clear is larger. As the degrees of freedom rise, the distribution tightens toward the normal curve and the critical value falls, which is why large samples make significance easier to reach for the same effect.
A t-table lists those critical values down the rows by degrees of freedom and across the columns by alpha and tail count. For a two-tailed test at alpha .05 with 30 degrees of freedom the critical value is about 2.04; clear it and the result is significant. The calculator returns the exact p-value so you skip the lookup, but the table explains the mechanism. For what that probability does and does not mean, read how to interpret a p-value.
t-test assumptions and the Mann-Whitney alternative
A t-test carries three assumptions: the observations are independent, the data are roughly normally distributed within each group, and, for the pooled Student version, the two groups share a similar variance. The test tolerates mild non-normality once samples are moderately large, thanks to the central limit theorem, but it is sensitive to outliers and to a clear skew in small samples. Rather than guess, run a formal test for normality and inspect the spread before you trust the result.
When normality fails and the sample is too small to lean on the central limit theorem, the Mann-Whitney U test is the nonparametric replacement for an independent-samples t-test, and the Wilcoxon signed-rank test replaces the paired version. Both work on ranks instead of raw values, so they shrug off outliers and suit ordinal data, at a modest cost in power when the data really are normal. The comparison of parametric and nonparametric tests sets out exactly when to make the switch.
Reporting t-test results in APA style
APA style states a t-test result in one line: t(df) = value, p = exact value, followed by the effect size. A worked example reads t(58) = 2.31, p = .024, d = 0.61. Report the t to two decimals, give the exact p-value rather than only a threshold, and put the degrees of freedom in parentheses; for a Welch t-test they will not be a whole number, so report them as given. Italicise the test letters and drop the leading zero on the p-value and on Cohen's d only where the value cannot exceed one.
Surround the statistic with the group means and standard deviations and a plain sentence naming the direction of the difference, so the reader sees not just that the means differ but which is larger and by how much. Pair the test with a confidence interval around the mean difference where the convention allows, and follow the wider rules in the guide to reporting statistics in APA style.
The guides behind this tool
Frequently asked questions
- What is the difference between a paired and an independent t-test?
An independent-samples t-test compares the means of two separate groups, such as a treatment group and a control group made up of different people. A paired t-test compares two measurements taken on the same people, such as a score before and after an intervention, and works on the within-person differences. Using an independent test on paired data throws away the pairing and usually loses power, so the design dictates which test is correct.
- When should I use Welch's t-test instead of Student's?
Welch's t-test does not assume the two groups have equal variances, so it is the safer default whenever the group standard deviations or sample sizes differ. Student's pooled t-test is only exactly correct when the variances are equal, and the cost of using Welch when they happen to be equal is negligible. Many statisticians now recommend Welch as the routine choice for an independent-samples comparison.
- What does the p-value from a t-test tell you?
The p-value is the probability of obtaining a mean difference at least as large as the one observed if the true difference in the population were zero. A small p-value, conventionally below .05, means such a difference would be unlikely under the null hypothesis, so the null is rejected. The p-value says nothing about the size of the effect, which is why a t-test should always be reported alongside Cohen's d.
- How many participants do I need for a t-test?
The number depends on the effect size you expect to detect, the significance level, and the power you want, not on a fixed rule of thumb. For a medium effect (Cohen's d of 0.5) at 80% power and a two-tailed test, an independent-samples t-test needs roughly 64 participants per group. Run a formal power analysis with the expected effect size before data collection rather than relying on a generic minimum.