The Handy Calculators logoTheHandyCalculators

T-Test Calculator

One-sample and two-sample t-tests with t-statistic, p-value, and rejection regions.

Autosave on
t statistic
2.5849
Degrees of freedom
9
Two-tailed p-value
0.02946
Critical value (±)
± 2.2622
Standard error
0.5416
Decision: Reject H₀ — difference is statistically significant

t-distribution with observed |t| and critical region

Use a t-test to ask whether a mean differs from a hypothesised value (one-sample) or whether two group means differ (two-sample). The result tells you the t statistic, the degrees of freedom, the two-tailed p-value, and whether to reject the null at your chosen significance level.

One-sample, pooled two-sample, and Welch

One-sample t: tests H₀: μ = μ₀. t = (x̄ − μ₀) / (s/√n), df = n−1. Use when you have a single sample and a benchmark value.

Pooled two-sample t: tests H₀: μ₁ = μ₂ assuming equal variances. Uses the pooled SD sₚ. df = n₁ + n₂ − 2.

Welch's two-sample t: same hypothesis without assuming equal variances. SE = √(s₁²/n₁ + s₂²/n₂), df from the Satterthwaite approximation. Modern recommendation: default to Welch unless you've explicitly verified equal variances.

Assumptions

Independent observations within each group.

Approximately normal sampling distribution of the mean — automatic for n ≥ 30 by the CLT; check for skew/outliers in smaller samples.

Random sampling — or at least exchangeable conditions across groups.

Equal variances (pooled t only). Welch's t drops this assumption and is essentially always safe.

Worked example — battery life

Manufacturer claims a battery lasts 22 hours. You test 10 units and get a mean of 23.4 hours, s = 1.7.

t = (23.4 − 22) / (1.7 / √10) = 1.4 / 0.5376 ≈ 2.604. df = 9.

Two-tailed p ≈ 0.029 — significant at α = 0.05. The sample provides evidence the true mean differs from 22 (likely higher).

The 95% CI on the mean is 23.4 ± t₀.₉₇₅,₉ · 0.5376 ≈ 23.4 ± 1.216 → (22.2, 24.6), consistent with rejecting 22.

Reading the p-value

The p-value is the probability, under H₀, of seeing a t at least as extreme as the one observed.

Small p (≤ α): reject H₀. The observed difference is unlikely under the null.

Large p: fail to reject H₀. The data don't refute the null — but they don't prove it either; absence of evidence is not evidence of absence.

Always report the effect size alongside p. A statistically significant difference of 0.2 hours of battery life is probably not practically meaningful.

Common pitfalls

Multiple testing: running 20 t-tests at α = 0.05 will produce one false positive on average. Use a correction (Bonferroni, Holm, FDR).

Using pooled t when the variances obviously differ. Welch is the safe default.

Paired data treated as independent. If each subject is measured twice, use a paired t-test (or one-sample t on the differences).

Reporting only p with no CI. The interval shows the magnitude of the effect, which is what decisions need.

Frequently asked questions

When should I prefer a non-parametric test?

When n is small AND the data is strongly skewed or ordinal. Mann-Whitney U replaces two-sample t; Wilcoxon signed-rank replaces paired t.

Why two-tailed by default?

Two-tailed asks 'is there any difference?', the question almost everyone actually has. Use one-tailed only when you've pre-committed to a direction.

How big a sample do I need?

Depends on the effect size and desired power. Cohen's d = 0.5, α = 0.05, 80% power needs about 64 per group. See our sample-size calculator.

Does this handle paired data?

Use the one-sample mode on the within-subject differences (post − pre). That's mathematically identical to a paired t-test.

By Larius — software engineer, NC real estate broker & CRE/business appraiserReviewed by the Handy Calculators editorial teamHow we build calculators

More in Statistics & Probability

From z-scores and confidence intervals to t-tests, chi-square, correlation, regression, and the binomial/Poisson distributions — textbook-grade tools with worked examples.

See hub →
Browse all Education →

Free download

Property Investment Checklist (PDF)

A field-tested checklist from a licensed broker and commercial appraiser: what to verify before you tour, how to check income and expenses, and the ratios lenders actually test.

We email you the guide. No spam, unsubscribe any time.

See all free resources