Statistics
T-Test Calculator
Compare a sample mean to a target, two independent groups, or paired before-and-after measurements.
Paste raw data or type the mean, standard deviation, and n. mathcheck reports t, degrees of freedom, the one- or two-tailed p-value, a confidence interval, Cohen's d, the critical value, and a plain-English decision.
For a paired test this is the 'before' list.
For a paired test this is the 'after' list, in the same order as the first.
Usually 0 (no difference). Enter another value to test whether the difference equals, exceeds, or falls short of Δ.
Two-tailed tests for any difference; one-tailed tests for a direction chosen before seeing the data.
Try an example
Result
t statistic
—
- p-value
- —
- Degrees of freedom
- —
- Decision
- —
- Confidence interval
- —
- Cohen's d
- —
Student quick launch
Grade planning, algebra checks, and formulas students reach for most.
Study path
Use this calculator with
Follow these when you want the formula behind the answer, a short lesson, or nearby tools in the same topic.
What the t-test calculator solves
A t test asks whether an observed difference in means is larger than what random sampling would produce if there were no real difference. It uses the t distribution because the Every member of the group you actually care about, not just the ones measured. A number saying how far, on average, the data values sit from the mean. is estimated from the A smaller group taken from a population, used to estimate facts about the whole group.. This page covers the three classroom versions and lets you work from either raw lists or summary statistics.
| Test | Use it when | Statistic | df |
|---|---|---|---|
| One-sample | One group compared with a known or claimed mean μ0 | t = (x̄ - μ0) / (s/√n) | n - 1 |
| Two-sample, Welch | Two independent groups; variances may differ | t = (x̄₁ - x̄₂) / √(s₁²/n₁ + s₂²/n₂) | Welch-Satterthwaite |
| Two-sample, pooled | Two independent groups with similar spread | t = (x̄₁ - x̄₂) / (s_p √(1/n₁ + 1/n₂)) | n₁ + n₂ - 2 |
| Paired | The same subjects measured twice | t = d̄ / (s_d/√n) | n - 1 (pairs) |
Formulas
How to use it
- Choose the test type. Independent groups use two-sample; the same subjects measured twice use paired.
- Paste raw data (any separator), switch to summary statistics and enter mean, SD, and n, or enter a t value and df you already computed to get just the The chance of seeing results this extreme if nothing real were going on. and decision.
- For two-sample and paired tests, leave Δ at 0 to test for any difference, or set it to the difference you want to test against.
- Pick the alternative hypothesis: two-tailed for 'different', left or right only when the direction was fixed in advance.
- Set α, then read t, df, p, the A range of values that probably contains the true answer, given your data., Cohen's d, and the decision. Open 'Show the work' for every intermediate value.
How to read the answer
If p ≤ α, reject H0: the difference is statistically significant. The confidence interval shows the range of plausible true differences; when it excludes 0 (or μ0) the two-tailed test rejects. Cohen's d tells you whether the difference is practically meaningful: about 0.2 is small, 0.5 medium, 0.8 large. A significant result with a tiny d usually means a large sample, not a large effect.
Common mistakes and edge cases
- Running a two-sample test on paired data (or vice versa). Pairing removes subject-to-subject variation and usually gives a very different p-value.
- Choosing a one-tailed test after seeing which way the data went. Decide the tail before looking.
- Using the pooled test when one standard deviation is more than twice the other; Welch's test does not need equal variances.
- A standard deviation of 0 makes the standard error 0 and t undefined; the calculator reports that instead of dividing by zero.
- Lists of different length in a paired test mean the pairs are not matched; fix the data rather than truncating.
Worked examples
Two-sample Welch from raw data
Two classes' quiz scores
t statistic
3.2611
Two-sample pooled from summary statistics
Mean 20 (s = 4, n = 15) vs mean 17 (s = 6, n = 12)
t statistic
1.5554
One-sample, right-tailed
Is the mean above 80? Sample mean 84.25, s = 5.44, n = 8
t statistic
2.2097
Paired before/after
Eight students before and after tutoring
t statistic
5.7446
Negative t (group 1 lower)
Mean 50 (s = 5, n = 20) vs mean 53 (s = 5, n = 20)
t statistic
-1.8974
Zero difference
Identical group means give t = 0 and p = 1
t statistic
0
Decision from t and df only
t = 2.2 with df = 14, two-tailed at α = 0.05 → p ≈ 0.045
t statistic
2.2
Test a difference other than zero
Is group 1 more than 2 points above group 2? Δ = 2, right-tailed
t statistic
0.4959
Paired from summary statistics
Mean difference 3.2, s_d = 2.9, 10 pairs
t statistic
3.4894
Undefined: no variation
Every value identical, so s = 0
t statistic
Error
Frequently asked questions
Should I use Welch's t test or the pooled t test?+
Welch's test is the safer default: it does not assume equal variances and loses almost nothing when they are equal. Use the pooled test only when your course requires it or the two standard deviations are clearly similar.
What is the difference between a paired and a two-sample t test?+
A paired test analyzes the differences within matched pairs (the same person before and after, for example). A two-sample test compares two separate groups. Pairing removes the variation between subjects, which usually makes the test more powerful.
How do I get the p-value from the t statistic?+
The p-value is the tail area of the t distribution with your degrees of freedom beyond the observed t. Two-tailed p doubles the one-tail area. This calculator computes it exactly using the regularized incomplete beta function instead of a rounded table.
What does Cohen's d mean?+
Cohen's d is the difference in means divided by the (pooled) standard deviation. It measures effect size in standard-deviation units: roughly 0.2 small, 0.5 medium, 0.8 large. It does not depend on sample size, unlike the p-value.
Can I run a t test with unequal sample sizes?+
Yes. Both Welch's and the pooled two-sample tests handle different n₁ and n₂. Only the paired test needs equal counts, because every value in one list must match a value in the other.
Why is my degrees of freedom a decimal?+
Welch's test uses the Welch-Satterthwaite approximation, which produces a non-integer df. That is expected; software such as R reports the same decimal value.
What is a t test, in plain language?+
It is a way to ask whether a difference in averages is big enough, relative to the spread and size of the data, to be more than random sampling noise. The t statistic is that difference divided by its standard error; the p-value says how often you would see a t at least that large if there were really no difference.
How do I find the t value for a one-sample t test?+
Subtract the hypothesized mean from the sample mean, then divide by the standard error s/√n. For a sample mean of 84.25, s = 5.44, n = 8, and μ0 = 80: t = (84.25 - 80) / (5.44 / √8) ≈ 2.21 with df = 7.
I already have t and df. Can I just get the p-value and decision?+
Yes. Choose 'I already have t and df', enter both, pick the tail and α, and the calculator returns the p-value, critical value, and reject / fail-to-reject decision, with the t curve shaded. The confidence interval and Cohen's d need the original means and standard deviations.
When should I use a z test instead of a t test?+
Use a z test only when the population standard deviation σ is genuinely known, which is rare outside textbooks. When σ is estimated from the sample, the t test is correct; with n above about 30 the two give almost identical answers because the t distribution approaches the normal.
Can I test whether the difference is some value other than 0?+
Yes. Enter the hypothesized difference Δ. H0 becomes μ₁ - μ₂ = Δ (or μ_d = Δ for paired data) and t is computed from the observed difference minus Δ. This is how you test claims like 'the new method scores at least 5 points higher'.
About this calculator
- Written by
- mathcheck editorial team
- Last reviewed
- September 4, 2026
Method
- Uses the values entered by the user and stable formulas documented on the page.
Related calculators
P-Value Calculator
Convert a z or t test statistic into a p-value with two-tailed, left, or right tails — includes reject/fail-to-reject decisions at alpha = 0.05 and 0.01 plus the full CDF work.
T Distribution Calculator
Find left-tail, right-tail, and two-tailed probabilities for a t value, invert a probability to get t, or look up critical t values for any degrees of freedom and significance level.
Z-Test Calculator
Run a one-proportion z test or a one-mean z test (known σ). Get the z statistic, one- or two-tailed p-value, critical value, confidence interval (Wald and Wilson for proportions), and the decision at your α.
Confidence Interval Calculator
Calculate confidence intervals for a mean or proportion with margin of error and z critical value.
Chi-Square Test Calculator
Run a chi-square goodness-of-fit test (observed vs expected) or a test of independence on a contingency table. Get χ², df, p-value, critical value, expected counts, per-cell contributions, and Cramér's V.
Average Calculator
Calculate arithmetic, weighted, geometric, or harmonic averages from a list of numbers with steps and summary statistics.
Last updated: September 4, 2026