Online t-Test Calculator: Independent Samples / Paired Samples / One-Sample (with Welch Correction)
Independent-samples, paired-samples, and one-sample t-tests — each returning the t-statistic, degrees of freedom, two-tailed p-value, confidence interval for the mean difference, and effect size Cohen’s d. Paste your data and run; nothing to install.
When to use each test type
Independent samples: the two groups consist of different subjects — for example, treated vs. control mice. Welch correction is the default because it does not assume equal variances. When the variances are in fact similar, Welch and Student give nearly identical results; when they differ substantially, only Welch stays reliable. You can switch to the traditional Student version below.
Paired samples: two measurements on the same subject (before/after), or the same set of samples split across two treatments. The paired test operates on within-subject differences, removing between-subject variability — which typically makes it more sensitive than an independent-samples test. The two data sets must correspond row-by-row and be in the same order.
One-sample: a single group compared against a known reference value — for example, testing whether a recovery rate differs from 100%.
Two numbers to examine beyond the p-value
Effect size (Cohen’s d) tells you how large the difference is; the p-value only tells you how unlikely it is under the null. With a large enough sample, a trivially small difference can produce a very small p-value. Always interpret the two together.
The confidence interval carries more information than the p-value. It simultaneously shows the direction, magnitude, and precision of the difference. An interval that crosses zero is equivalent to p > 0.05, but the interval also reveals whether you are well clear of zero or just barely — information that the p-value alone cannot provide.
Assumptions and common mistakes
The t-test assumes approximately normal data and independent observations. With very small samples (fewer than 5–6 per group), normality cannot be assessed effectively, so conclusions are sensitive to that assumption. For clearly skewed data or data with extreme outliers, consider non-parametric alternatives (Mann-Whitney U for independent samples; Wilcoxon signed-rank for paired samples).
Technical replicates are not biological replicates. Three measurements of the same sample are not three independent observations. Treating them as such inflates n and deflates the p-value. This is one of the most common errors in experimental data analysis.
Do not run pairwise t-tests across multiple groups. Three groups yield three pairwise tests; at α = 0.05 each, the probability of at least one false positive is roughly 14%. Use ANOVA instead, and apply a multiple-comparison correction if pairwise comparisons are needed.
FAQ
Why is Welch the default rather than Student's t-test?
Welch does not assume equal variances. When the two group variances are genuinely similar, Welch and Student give nearly identical results. When they differ substantially, Student's test underestimates the p-value (elevated false-positive rate) while Welch does not. Testing for homogeneity of variance first and then choosing the test actually raises the overall false-positive rate, so defaulting to Welch is the more conservative choice.
Should I use a t-test or ANOVA?
Use a t-test for two groups; use ANOVA for three or more. Three groups produce three pairwise t-tests; at α = 0.05 each, the probability of at least one false positive is roughly 14% — far above 0.05. If pairwise comparisons are needed, run ANOVA first, then apply a multiple-comparison correction to the pairwise p-values.
Can I run a t-test with very small samples?
Yes, but with caution. With fewer than 5–6 observations per group, normality cannot be assessed effectively, so conclusions are sensitive to the distributional assumption. For clearly skewed data or data with extreme outliers, Mann-Whitney U (independent samples) or Wilcoxon signed-rank (paired) is more appropriate.
Why should I report the confidence interval?
It carries more information than the p-value: it shows the direction, magnitude, and precision of the difference simultaneously. An interval crossing zero is equivalent to p > 0.05, but it also tells you whether you are well clear of zero or just barely — which the p-value alone cannot. Reporting effect sizes and confidence intervals is now standard practice in most journals.
Why does the p-value match SPSS and R exactly?
Because the same mathematical definition is used: two-tailed p = I_{df/(df+t²)}(df/2, 1/2), where I is the regularized incomplete beta function evaluated via its continued-fraction expansion. The test suite for this page compares output digit-for-digit against scipy.stats.
Related tools
One-Way ANOVA Calculator Online (Post-Hoc Tests & Multiple Comparison Correction)
Compare means across three or more groups: F statistic, ANOVA table, p-value, η², and optional pairwise post-hoc tests with Bonferroni or BH correction.
Mann-Whitney U and Wilcoxon Signed-Rank Test Calculator
Two-group comparison for skewed or ordinal data: computes U/W statistics, exact or approximate p-values, effect size, and the minimum achievable p for your sample size.
Chi-Square and Fisher's Exact Test Calculator (with OR / RR)
Contingency table independence tests — Pearson chi-square, Yates' correction, and Fisher's exact p-value; OR and RR with confidence intervals for 2×2 tables.
Buy me a coffee