T-Test Calculator

One-sample, two-sample (Welch) or paired t-test — t statistic, degrees of freedom, two-tailed p-value and a plain-English verdict.

T-Test Calculator
Two-tailed p-value

How a T-Test Works

Every t-test builds the same ratio: the observed difference in means divided by the standard error of that difference. The result, t, measures the difference in units of sampling noise. The t-distribution (which depends on the degrees of freedom) then converts t into a p-value — the probability of a difference this large arising by chance.

One-sample: t = (x̄ − μ₀) ÷ (s ÷ √n) · df = n − 1
Welch two-sample: t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂)
Paired: one-sample test on the per-pair differences vs. 0
Worked example

A machine should fill bags to 500 g. Five bags weigh 502, 504, 501, 505, 503 (mean 503, s = 1.581). t = (503 − 500) ÷ (1.581 ÷ √5) = 4.24 with df = 4, giving p ≈ 0.013 — strong evidence the machine is overfilling.

Choosing the Right Test

SituationTest
Is this group's mean different from a known value?One-sample
Do two separate groups differ? (control vs. treatment)Two-sample (Welch)
Did the same subjects change? (before vs. after)Paired

The paired design is far more powerful when it applies, because it removes person-to-person variation — always pair when your data genuinely comes in pairs. To understand the ingredients of the t statistic, our standard deviation calculator shows exactly how s is computed.

Frequently Asked Questions

What does a t-test actually test?

Whether an observed difference in means is larger than what random sampling noise would plausibly produce. A one-sample test compares your data’s mean to a fixed value; a two-sample test compares two independent groups; a paired test compares two measurements of the same subjects.

What does the p-value mean?

The probability of seeing a difference at least as large as yours if there were truly no difference (the null hypothesis). A p-value of 0.03 means such a result would occur about 3% of the time by chance alone. It is not the probability that the hypothesis is true.

What is a significant result?

By convention, p below 0.05 is called statistically significant — the chance explanation is considered implausible enough to reject. The 0.05 threshold is a custom, not a law of nature; report the exact p-value and consider practical significance too.

Why does this calculator use Welch’s test for two samples?

Welch’s t-test does not assume the two groups have equal variances, and statisticians now broadly recommend it as the default because it is safer when variances differ and nearly identical to the classic pooled test when they do not.

What are the assumptions of a t-test?

Data should be roughly normally distributed (less critical with larger samples, thanks to the central limit theorem), observations independent, and — for the paired test — the pairs must be genuine before/after or matched measurements. Heavily skewed small samples are better served by non-parametric tests.

Cite This Calculator

Using this calculator in an assignment, article or lesson? Copy a ready-made citation — or the link snippet if you're referencing it from a web page.

The CalculatorsGuide Editorial Team. (2026). T-Test Calculator. CalculatorsGuide. Retrieved from https://www.calculatorsguide.com/statistics/t-test-calculator/

The CalculatorsGuide Editorial Team — Calculator authors and reviewers

Every calculator on this site is built from published formulas, checked against worked reference examples, and covered by automated tests that re-verify its output on every update. Our full process is documented on the methodology page. Read our methodology →