T-Test Calculator
Run one-sample, paired or Welch t-tests with degrees of freedom, p-values and effect size.
Your result
About this tool
Compare a sample mean with a reference, test matched differences or compare two independent means using Welch’s t-test. Enter raw observations or summary statistics: mean, sample standard deviation and sample count. Inspect the working behind each p-value. Calculations stay in your browser.
Choose the test before interpreting the result
- Choose one-sample for a mean against a specified null, paired for matched observations, or Welch for two independent samples. Welch tests a zero population mean difference and ignores the null-mean input.
- Choose raw observations or summary statistics. Raw mode accepts 2 to 2,000 values per sample separated by spaces, commas or new lines. Do not use thousands separators within a value: 1,000 is read as two values. Summary mode takes a mean, sample SD and integer count from 2 to 2,000. Use sample SD, not standard error of the mean (SEM).
- For paired raw data, each A observation must correspond to B in the same position. For paired summary data, enter the mean and sample SD of within-pair differences A minus B, plus the number of pairs. Separate group means and SDs are not sufficient.
- Choose a two-sided alternative for any difference, or a directional alternative for greater/less, before inspecting the data. Direction follows A minus B in two-sample modes. Alpha is a decision threshold, not an estimated probability.
- Calculate, check the counts, means, sample standard deviations and standard error, then interpret p alongside the effect size and study design. Download CSV to retain the working and assumptions locally.
How the calculation works
One-sample or paired: t = (mean − null) / (s / √n), df = n − 1. Paired mode applies this to A minus B. Welch: t = (meanA − meanB) / √(sA²/nA + sB²/nB), with Welch–Satterthwaite degrees of freedom. For |t|, the small Student tail is Q = I_x(df/2, 1/2)/2, where x = df/(df + t²); a two-sided p-value is 2Q.
Worked example
For independent A = 5,6,7,8,9 and B = 4,5,6,7,8, each sample has n = 5 and sample variance 2.5. Standard error is √(2.5/5 + 2.5/5) = 1. The observed mean difference is 1, so Welch t = 1 with df = 8 and two-sided p ≈ 0.346594. At alpha 0.05 this does not reject the null; it does not prove the means equivalent.
Calculate from published summary statistics
For one sample, its mean, sample standard deviation and count determine the t statistic against the chosen null. For two independent samples, enter these three values for each group; Welch allows different sample sizes and variances. The calculator does not reconstruct observations or check the original data for outliers.
A paired test instead needs the summary of within-pair differences. The variability of these differences depends on the association between paired measurements and cannot be recovered from two marginal SDs alone. If a paper reports only separate before/after summaries, obtain the SD of the differences or use the paired raw observations.
Use unrounded summaries when available. Rounded means and SDs may produce a slightly different p-value from the original raw data. Summary inputs allow counts from 2 to 2,000, means from -1 trillion to 1 trillion and sample SDs from 0 to 1 trillion. At least one contributing variance must give a positive standard error; zero-variation tests are undefined.
Matched observations and independent samples answer different questions
For paired A = 8,9,7,10,11 and B = 7,7,6,8,8, the calculation uses differences 1,2,1,2,3. Their mean is 1.8, sample variance 0.7 and standard error √(0.7/5). There are five pairs and four degrees of freedom. Pairing must come from the study design, not from sorting the columns to obtain a smaller p-value.
Welch uses each independent sample’s variance and count separately; its degrees of freedom can be fractional. Its reported Cohen d uses a pooled sample SD only as a descriptive standardizer, not as an equal-variance assumption for the Welch test. Paired dz instead divides the mean difference from the entered null by the SD of within-pair differences.
Read a small p-value without treating it as zero
The calculator evaluates the small Student tail directly instead of subtracting a rounded cumulative probability from one. Scientific notation keeps very small p-values visible. If the probability is below browser number range, its logarithm remains available and determines the alpha comparison. Such a result is not an exact probability of zero.
A p-value describes how incompatible a result at least as extreme as observed is with the specified null model. It is not the chance that the null hypothesis is true, a measure of causal evidence by itself, or the probability of replication. A directional test against the observed direction can correctly have a p-value near one.
Check assumptions and numerical limits
Independent observations, appropriate sampling and a suitable model matter more than a threshold crossing. Severe outliers, dependence or strongly skewed tiny samples can undermine interpretation. This tool does not diagnose normality, choose an experimental design, correct multiple comparisons or choose a confidence level. The interval shown is always two-sided 95%, regardless of the test tail or alpha.
Inputs use browser floating-point numbers. Digits lost during parsing cannot be recovered. Zero standard error makes these tests undefined; extreme scales can also exceed the supported arithmetic range and require rescaling. A non-significant test does not establish equivalence. Examine the effect size, units and uncertainty with appropriate statistical guidance.
Read the 95% confidence interval
The interval is estimate plus or minus t(0.975, df) times standard error. It estimates the population mean in one-sample mode, the population mean paired difference A minus B in paired mode, or the difference between population means A minus B in Welch mode. It is centred on the observed estimate, not the estimate minus the null value.
Under the sampling assumptions, the procedure covers the population quantity in about 95% of repeated samples. It does not assign a 95% probability to a fixed parameter being in this particular interval. This fixed two-sided 95% interval need not agree with a one-sided test or a decision at an alpha other than 0.05.
Assumptions and limitations
At least two values per sample and positive variation. Paired samples must have equal counts and correspond row-by-row. Welch compares a zero difference; the null-mean field is for one-sample/paired tests.
Tests assume suitable independent observations and sampling conditions. Statistical significance is not practical significance or causality. Multiple-testing correction and experimental design are outside this calculator.
Sources and editorial responsibility
Maintained by Renvoro Pty Ltd. Sources inform the methods and assumptions shown here; outputs have the limitations described on this page.
Common questions
When should I use a paired t-test?
Use paired mode for matched observations, such as the same subjects measured before and after. Keep pairs in the same order. The test uses the differences within pairs.
When should I use Welch’s t-test?
Use Welch for two independent samples when comparing means without assuming equal population variances. Keep matched observations in the paired mode instead.
What does a two-sided p-value measure?
Under the null model, it is the probability of obtaining a t statistic at least as extreme in either direction as the one observed. It is not the probability that the null hypothesis is true.
Guide updated 2026-10-27. Calculation method and source dates remain separate.
Method reviewed 2026-10-23. Calculation standards · Report an issue