GALAXY OF TOOLS

SCIENCE SECTOR

T Test Calculator

Paste data for a one-sample, Welch, pooled or paired t test: t, df, p-value, confidence interval and Cohen's d.

%
—
Results

p-values come from the regularised incomplete beta function Ix(df/2, ½) with x = df ÷ (df + t²), evaluated by continued fraction to about 1 × 10⁻¹⁴; critical t values are found by bisection. This is a statistics aid, not a substitute for judgement about study design. Everything runs in your browser.

Runs entirely in your browser. Nothing you enter or upload is sent to a server.

T test calculator for one-sample, two-sample and paired data

This t test calculator runs the three Student t tests that cover most comparisons of means. Paste one or two columns of numbers and it reports the t statistic, degrees of freedom, the one- and two-tailed p-values, a confidence interval for the difference and Cohen's d as an effect size, with a plain-language decision at your chosen significance level. For independent samples it defaults to Welch's test, which does not assume equal variances, with the classic pooled-variance test available by a checkbox.

The p-values are computed from the regularised incomplete beta function rather than read from a table, so they match R, SPSS and Excel's T.TEST to many decimal places, and the degrees of freedom for Welch's test use the Welch–Satterthwaite formula. A notes panel points out when a sample is small, when the variances differ enough to matter, and when the paired test is the right choice instead.

Everything runs in your browser; the data never leave your device. Descriptive statistics for each column are available from the statistics calculator, and large-sample tests with a known σ belong to the z score calculator.

How to use the T Test Calculator

  1. Choose the test: Two-sample for two independent groups, Paired for before/after or matched measurements, One-sample to compare one group with a known value.
  2. Paste the data into Sample A (and Sample B). Commas, spaces, tabs or new lines separate values; for a paired test keep the rows in the same order.
  3. Pick the alternative hypothesis: two-tailed (the means differ) or one-tailed (A is greater, or A is smaller). Set the confidence level, usually 95 %.
  4. For two independent samples, tick Assume equal variances only if you have a reason to; Welch's test is the safer default.
  5. Read t, df, p and Cohen's d in the summary, the full results table and the assumptions notes; Copy results pastes the table into a report.

T Test Calculator features

Three tests, one page

One-sample, Welch and pooled two-sample, and paired t tests, each with the matching degrees of freedom and standard error.

Exact p-values

Both one-tailed and the two-tailed p are listed for every run, computed to about 14 significant figures from the incomplete beta function.

Confidence interval and critical t

The interval for the mean difference at any confidence level, plus the critical t used to build it.

Cohen's d with interpretation

Effect size using the pooled standard deviation (or the SD of differences for paired data), labelled small, medium or large.

Assumption checks

Warnings for small samples, a standard-deviation ratio above 2 when pooling, and a reminder about independence.

The formulas behind each test

All t tests divide an observed difference by its standard error. For one sample, t = (x̄ − μ₀) ÷ (s ÷ √n) with n − 1 degrees of freedom. For a paired design the differences d = A − B are treated as one sample: t = d̄ ÷ (s_d ÷ √n). For two independent samples, Welch's test uses t = (x̄A − x̄B) ÷ √(s²A/nA + s²B/nB) with the Welch–Satterthwaite degrees of freedom, while the pooled test uses a weighted average variance s²p = ((nA − 1)s²A + (nB − 1)s²B) ÷ (nA + nB − 2) and nA + nB − 2 degrees of freedom.

Worked example: A = 5.1, 4.9, 5.6, 5.8, 6.0, 5.5 (mean 5.483, s 0.417) and B = 4.2, 4.0, 4.8, 4.6, 5.1, 4.3 (mean 4.500, s 0.410). The difference is 0.983, the Welch standard error is 0.2386, so t = 4.121 with df ≈ 10.0 and a two-tailed p of 0.0021. The 95 % confidence interval for the difference is 0.45 to 1.52 and Cohen's d is 2.38 — a large effect. Treating the same numbers as six before/after pairs gives t = 13.98 and p = 0.00003, because pairing removes the between-subject variation.

TestUse whendf
One-sampleComparing a sample mean with a known or target valuen − 1
PairedTwo measurements on the same units (before/after, left/right, matched pairs)n pairs − 1
Two-sample, WelchTwo independent groups; variances may differ (default)Welch–Satterthwaite, usually fractional
Two-sample, pooledTwo independent groups with similar variancesnA + nB − 2

Reading the output

  • p-value: the probability of a t at least this extreme if the null hypothesis were true. Below α (0.05 for 95 % confidence) the result is called statistically significant.
  • One- vs two-tailed: choose one-tailed only when the direction was fixed before seeing the data; the one-tailed p is half the two-tailed p when the effect is in the predicted direction.
  • Confidence interval: the range of plausible values for the true difference; if it excludes 0 the two-tailed test is significant at the same level.
  • Cohen's d: the difference in standard-deviation units. Around 0.2 is small, 0.5 medium and 0.8 large; it tells you whether a significant difference is also a meaningful one.
  • Assumptions: independent observations, roughly normal populations (less important above about 30 per group), and for the pooled test similar variances.

T Test Calculator FAQ

Which t test should I use?

Use the paired test when each value in A has a natural partner in B (the same person before and after). Use the two-sample test when the groups are different people or items; leave it on Welch unless you know the variances are equal. Use the one-sample test to compare a mean with a fixed number such as a specification.

What is the difference between Welch's and Student's two-sample t test?

Student's (pooled) test assumes both populations have the same variance; Welch's test estimates each variance separately and adjusts the degrees of freedom. Welch's test loses almost nothing when variances are equal and is far more reliable when they are not, which is why it is the default here and in R.

How is the p-value calculated?

From the t distribution: the two-tailed p equals Ix(df/2, ½) with x = df ÷ (df + t²), where I is the regularised incomplete beta function. The t test calculator evaluates it numerically, so no table interpolation is involved.

Can I run a t test with unequal sample sizes?

Yes, for the two-sample tests. Only the paired test needs equal lengths, because every value in A must match one in B.

Is a significant p-value enough?

No. Look at Cohen's d and the confidence interval as well. With large samples a trivially small difference becomes significant, and with tiny samples a large real effect can fail to reach significance.

How many values do I need?

The calculator works from two values per sample, but the test assumes approximate normality, which matters most below about 30 per group; with very small samples check for outliers first.

You might also need