T-test calculator

Run a one-sample, two-sample or paired t-test from raw data or summary statistics, and see exactly how the answer was reached.

  • Free, no sign-up
  • Step-by-step working
  • Runs in your browser
Type of t-test
Your data

Separate values with commas, spaces or new lines. For a paired test, keep the pairs in the same order in both boxes.

Group 1
Group 2
Variances
Alternative hypothesis

How to use the t-test calculator

  1. Pick the type of t-test: one-sample (one group against a fixed value), two-sample (two separate groups) or paired (the same subjects measured twice).
  2. Paste your raw data, or switch to summary statistics and enter each group's mean, standard deviation and size.
  3. Enter the hypothesized value. For a one-sample test, this is the mean you're testing against; for the other tests it is usually 0 (no difference).
  4. Choose the alternative hypothesis and significance level, then click Run t-test.
  5. Read the decision, the effect size and the plain-English summary, and download the chart if you need it.

T-test formulas

Every t-test divides the difference you observed by its standard error. The result, t, follows a t distribution when the null hypothesis is true.

One-sample: t = x − μ0s / n , df = n − 1

Paired: t = d − μ0sd / n , df = n − 1

Two-sample (Welch): t = x1 − x2s12n1 + s22n2

Two-sample (pooled): t = x1 − x2sp 1n1 + 1n2 , df = n1 + n2 − 2

x
The sample mean (with subscripts 1 and 2 for the two groups)
d
The mean of the paired differences (second measurement minus first)
μ0
The value in the null hypothesis: the mean (one-sample) or difference (paired, two-sample) you test against, usually 0 for differences
s
The sample standard deviation; sd is the standard deviation of the differences
sp
The pooled standard deviation, combining both groups' variances weighted by their degrees of freedom
n
The sample size (the number of pairs for a paired test)
df
Degrees of freedom. Welch's test uses the Welch-Satterthwaite formula, which usually gives a non-whole number

Worked example

A school reports that its students average 100 on a standard reasoning test. A researcher tests 25 students and gets a mean of 103.2 with a standard deviation of 9.6. Is the true mean different from 100, at α = 0.05?

  1. State the hypotheses (two-tailed)
    H0: μ = 100    H1: μ ≠ 100
  2. Standard error of the mean
    SE = 9.625 = 9.65 = 1.92
  3. Calculate the t statistic
    t = 103.2 − 1001.92 = 1.6667
  4. Degrees of freedom and two-tailed p-value
    df = 24, p = 2 × P(T ≥ 1.6667) = 0.1086
  5. Compare with α
    0.1086 > 0.05 → fail to reject H0

What it means: the sample mean is 3.2 points above 100, but with this much variation and only 25 students, a gap that size would happen about 11% of the time by chance alone. That isn't strong enough evidence to say the true mean differs from 100. A larger sample might detect a real difference if there is one.

How to interpret t-test results

  • p ≤ α: the difference is statistically significant. The data give evidence that the true mean (or difference) is not the hypothesized value.
  • p > α: not significant. The difference could plausibly be random variation. This does not prove the means are equal.
  • The sign of t shows the direction: a positive t means the first mean is larger than the second (or larger than μ0).
  • Cohen's d shows how large the difference is in practical terms. With big samples, even a tiny, unimportant difference can be significant.
  • The confidence interval for the difference gives a range of plausible values. If it excludes 0, the two-tailed test is significant at the matching level.

Already have a t statistic from software or a textbook? Use the p-value calculator to convert it straight into a p-value. Planning a study? The sample size calculator helps you collect enough data to detect the effect you care about.

Frequently asked questions

Which t-test should I use?

Use a one-sample t-test to compare one group’s mean with a fixed value (for example, a target or a published average). Use a two-sample (independent) t-test to compare the means of two separate groups. Use a paired t-test when each observation in one group is matched to one in the other, such as the same people measured before and after a change.

What is the difference between Welch’s t-test and the pooled t-test?

The pooled (Student’s) t-test assumes both groups have the same population variance. Welch’s t-test drops that assumption and adjusts the degrees of freedom instead. Welch’s test is the safer default: when the variances really are equal it gives almost the same answer, and when they aren’t it stays accurate. It is the default in R and many textbooks.

What are the assumptions of a t-test?

The observations should be independent, the data (or, for a paired test, the differences) should come from a roughly normal population, and the measurement should be on an interval or ratio scale. With samples of about 30 or more per group, the t-test is fairly robust to non-normal data. With small samples, check for strong skew and outliers first.

What is a t-value, and what counts as a large one?

The t statistic is the difference you observed divided by its standard error, so it measures the difference in units of “expected random noise”. Values beyond about ±2 are often significant at the 5% level for moderate sample sizes, but the exact cutoff depends on the degrees of freedom. The p-value turns t into a probability, so rely on that.

What is Cohen’s d?

Cohen’s d is an effect size: the difference between means divided by a standard deviation. Unlike the p-value, it doesn’t grow with sample size, so it tells you how big the difference is in practical terms. Rough guidelines are 0.2 for a small effect, 0.5 for medium and 0.8 for large.

Can I run a t-test in Excel or Google Sheets?

Yes. Use =T.TEST(range1, range2, tails, type), where tails is 1 or 2 and type is 1 for paired, 2 for two-sample equal variance and 3 for Welch’s test. It returns only the p-value. This calculator gives the same p-value plus the t statistic, degrees of freedom, effect size and working.

Last reviewed November 10, 2026