T-Test Calculator: One Sample, Two Sample, Paired and Welch

T-Test Calculator

Run one-sample, independent two-sample, or paired t-tests from raw observations, with t, degrees of freedom, p-value, effect size, and a confidence interval.

Separate raw values with commas, semicolons, spaces, or new lines. Use periods for decimals; commas are separators. Paired samples must have equal lengths. Maximum: 10,000 observations per sample.


T-test formulas

A t-test compares an estimated mean or mean difference with a null value using t = estimate / standard error. A one-sample test uses SE=s/√n. A paired test applies that formula to within-pair differences.

Welch's independent test uses SE=√(s₁²/n₁+s₂²/n₂) and Welch–Satterthwaite degrees of freedom. The equal-variance test first pools the two sample variances. P-values come from Student's t distribution.

Checked examples

TestInputsResult
One sample, two-sided1,2,3,4,5 versus μ₀=0t≈4.2426; df=4; p≈0.01324
One sample, exact null1,2,3,4,5 versus μ₀=3t=0; p=1
Welch two sampleA=1,2,3,4,5; B=2,4,6,8,10t≈−1.8974; df≈5.8824
Equal-variance two sampleA=1,2,3,4,5; B=2,4,6,8,10t≈−1.8974; df=8
PairedA=5,6,7,8,9; B=4,5,5,7,7mean difference=1.4; t≈5.7155; df=4
Welch identical meansA=1,2,3; B=1,2,3t=0; p=1

How to use the calculator

  1. Select one-sample, Welch, equal-variance, or paired t-test.
  2. Select a two-sided, greater-than, or less-than alternative.
  3. Enter raw observations and, for a one-sample test, the hypothesized mean.
  4. Select the confidence level and calculate.
  5. Review t, degrees of freedom, p-value, interval, and effect size.

Choosing the correct test

  • Use one-sample when comparing one sample mean with a fixed reference value.
  • Use Welch for two independent samples when equal variance is not established; it is the safer default.
  • Use the equal-variance test only when its common-variance assumption is justified.
  • Use paired when observations are naturally matched, such as before-and-after readings from the same subjects.
  • A small p-value is evidence against the selected null hypothesis, not proof of practical importance or causation.

Limits and numerical method

  • Each sample accepts 2 to 10,000 finite values. Tests require nonzero variability.
  • Student's t probabilities use the regularized incomplete beta function; confidence limits invert the t CDF numerically.
  • The calculator does not verify independence, random sampling, normality, equal variance, or appropriate pairing.
  • For small samples, strong skew or outliers can make t-test results unreliable.

Frequently asked questions

Should I choose Welch or equal variances?

Choose Welch unless you have a defensible reason to assume equal population variances. Welch remains valid when sample sizes or variances differ.

What does a two-sided test ask?

It tests whether the difference is nonzero in either direction. A one-sided test evaluates only the direction specified before examining results.

What does Cohen's d show?

It expresses the estimated difference in standard-deviation units. Statistical significance and effect size answer different questions.

Does p<0.05 prove the alternative?

No. It indicates that the observed result would be relatively unusual under the null model, subject to the test assumptions.

Related calculators

Use the Standard Deviation Calculator for descriptive spread, the P-Value Calculator to convert an existing test statistic, the Chi-Square Calculator for categorical counts, or the Sample Size Calculator to plan comparisons before collecting data. Use the Confidence Interval Calculator to estimate mean and proportion ranges.