t-Test Calculator

Choose the design, then paste the two samples (one value per line) or type their summary statistics. You get t, the degrees of freedom, one- and two-tailed p-values, the confidence interval and the decision at your chosen α.

Free Runs in your browser Checked Tuesday, November 10, 2026

Design
Data

One value per line. Spaces, commas (in English) and semicolons also separate values. Use the decimal mark of your language.

For the two-sample and paired tests. For a paired test, give the second value of each pair on the same line as the first.

The mean (or the difference of the means) that H₀ states. Usually 0.

Two-sample test
Alternative hypothesis
Significance level α

Result

Conclusion at α — Whether H₀ is rejected at the chosen significance level.
t statistic — How many standard errors the estimate lies from μ₀.
Degrees of freedom — For Welch's test the value is not a whole number.
Two-tailed p-value — The probability of a t value at least this far from 0, in either direction.
One-tailed p-value — The same probability in the direction of the difference only.
Estimate — The mean, or the difference of the means, or the mean of the differences.
Standard error — The standard error of the estimate.
Confidence interval of the estimate — At the confidence level 1 − α.
The statistics the calculator used

How it is worked out

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Choose Design: one sample against a value, two independent samples, or paired samples.
  2. Choose Data: raw values, one per line, or summary statistics. Type Sample 1 values and, for two samples or pairs, Sample 2 values.
  3. Set the Hypothesised value μ₀, the Alternative hypothesis and the Significance level α.
  4. Read Conclusion at α, then the t statistic, the p-values and How it is worked out.

How the t statistic is calculated

A t test asks whether an estimate differs from a hypothesised value by more than its random variation would explain. The t statistic divides the difference by the standard error of the estimate. Under the null hypothesis it follows a t distribution, whose degrees of freedom depend on the sample sizes.

For two independent samples, Welch's test does not assume equal variances and is the safer default. The pooled test assumes equal variances and gives the same result when the two samples have equal size and similar spread. A paired test works on the differences between the two values of each pair, which removes the variation between the subjects.

one sample: t = (x̄ − μ₀) ÷ (s ÷ √n), df = n − 1
Welch: SE = √(s₁² ÷ n₁ + s₂² ÷ n₂), t = ((x̄₁ − x̄₂) − μ₀) ÷ SE
pooled: SE = s_p √(1 ÷ n₁ + 1 ÷ n₂), df = n₁ + n₂ − 2
paired: the same as one sample, applied to the differences

The p-value and the decision

The p-value is the probability of a t value at least as extreme as the one found, if H₀ were true. A two-sided test counts both directions; a one-sided test counts only the direction you chose before looking at the data. The decision compares the p-value of the chosen alternative with α: when p is below α, H₀ is rejected. Rejecting H₀ does not show how large the difference is; read the confidence interval for that.

What the calculator does not cover

  • More than two groups, which need an analysis of variance, and tests for proportions or counts (see the chi-square test calculator).
  • Samples that are not independent beyond the pairing, and data with strong outliers. Look at the values first with the statistics calculator.
  • The power of the test and the sample size needed for a difference. Those need the size of the difference you expect.

Worked example: the sleep data of Student (1908)

The extra hours of sleep of ten patients on drug 1 had a mean of 0.75, and on drug 2 a mean of 2.33. Treated as two independent groups, the Welch test gives t = -1.8608 with 17.78 degrees of freedom and a two-tailed p-value of 0.0794, so at α = 0.05 H₀ is not rejected. The 95% interval of the difference is -3.3655 to 0.2055.

The same ten patients took both drugs, so the paired test is the right one. The mean difference is -1.58 hours, t = -4.0621 with 9 degrees of freedom and a two-tailed p-value of 0.0028, so the difference is significant at 5%.

Frequently asked questions

What does a p-value of 0.05 mean?

It means that if H₀ were true, a t value at least as extreme as the one found would occur in about 5 of 100 samples. It is not the probability that H₀ is true, and a smaller p-value is stronger evidence against H₀.

Should I choose the Welch or the pooled test?

Choose Welch unless you have a good reason to believe the two population variances are equal. Welch's test gives nearly the same answer when they are, and a reliable answer when they are not.

When should I use a one-tailed test?

Only when you decided the direction before collecting the data, and a difference in the other direction would not change your action. Otherwise use the two-sided test, which is the usual default.

Why does the calculator say do not reject H₀ rather than accept it?

A non-significant result means the data do not show a difference strong enough to detect with this sample size. It does not prove that the two means are equal, so read the confidence interval as well.

Do my data have to be normally distributed?

The t test is robust for moderate samples when the data are roughly symmetric. With small samples and strong skew or outliers, a rank-based test is safer, and the values should be checked first.

Can I use summary statistics instead of the raw values?

Yes. Choose Summary statistics and type the size, mean and standard deviation of each sample. For a paired test, enter the mean and standard deviation of the differences.

Does the calculator send my data anywhere?

No. The calculation runs in your browser, and nothing you type is sent to our servers.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.