T-Test Calculator

Run a one-sample, two-sample, or paired t-test in seconds. Enter summary statistics or paste your raw data, and get the t statistic, degrees of freedom, exact p-value, effect size, and confidence interval — with a plain-English conclusion at your significance level.

Students, researchers, and analysts use t-tests to decide whether an observed difference is likely real or just sampling noise. This calculator handles Student’s and Welch’s two-sample tests, works from summary stats or raw data lists, and shows every step so you can check the result by hand.

100% FreeNo sign-upInstant resultsSummary stats or raw data

T-Test Calculator

Advanced options

These defaults are already included in the result: significance level 0.05, two-tailed test, 95% confidence interval. Open this section only to change them.

t = 1.916 df = 42.85
0.0621p-value
0.557Effect size (Cohen’s d)
-0.21 to 8.2195% CI for the difference
2.089Standard error

Your information is not stored. Calculations are done in your browser.

Key takeaways

  • Worked example (two-sample, Welch): Group 1 mean 82 (SD 6, n 20) versus group 2 mean 78 (SD 8, n 25) gives t = 1.916, df = 42.85, p = 0.0621. At alpha 0.05 the difference is not statistically significant, even though the means differ by 4 points.
  • Worked example (one-sample): A sample mean of 105 (SD 15, n 25) tested against 100 gives t = 1.667, df = 24, p = 0.109, 95% CI for the difference -1.19 to 11.19. Again, not significant at 0.05.
  • Pick the right test: one group against a known value uses one-sample; two separate groups use two-sample; before-and-after measurements on the same subjects use paired.
  • Welch is the safe default for two independent groups, because it does not assume equal variances. Student's version is fine only when variances look similar.
  • A p-value is not an effect size. Always read Cohen's d and the confidence interval next to the p-value before drawing a conclusion.

Contents

Related tools

When to use each t-test

A t-test compares means when the population standard deviation is unknown and the sample is modest in size. With very large samples the t and normal distributions nearly agree, but the t-test remains valid.

SituationTestExample
One group versus a known or target valueOne-sampleAverage battery life versus the advertised 100 hours
Two separate, unrelated groupsTwo-sampleTest scores for two different teaching methods
Same subjects measured twicePairedBlood pressure before and after a treatment

Formulas used by this calculator

One-sample t-test

t = (sample mean - hypothesized mean) / (sample SD / square root of n), with df = n - 1.

Two-sample t-test

Welch's version: t = (mean 1 - mean 2) / square root of (variance 1 / n1 + variance 2 / n2), with degrees of freedom from the Welch-Satterthwaite equation. Student's version pools the two variances first and uses df = n1 + n2 - 2.

Paired t-test

Take the difference within each pair, then run a one-sample test on those differences: t = mean difference / (SD of differences / square root of number of pairs), with df = pairs - 1.

p-value, effect size, and confidence interval

The two-tailed p-value is twice the upper tail area of the t distribution beyond the absolute t value. The one-tailed versions use a single tail. Cohen's d divides the mean difference by the standard deviation (pooled SD for two-sample tests). The confidence interval is the difference plus or minus the critical t value times the standard error.

Worked examples

Example 1: one-sample (textbook case)

Sample mean 105, SD 15, n 25, hypothesized mean 100. Standard error = 15 / 5 = 3. t = 5 / 3 = 1.667, df = 24, two-tailed p = 0.109. The 95% confidence interval for the difference is -1.19 to 11.19, which includes zero, matching the non-significant p-value.

Example 2: paired test

Mean difference 2.5, SD of differences 2.0, n = 10 pairs. Standard error = 2 / square root of 10 = 0.632. t = 3.953, df = 9, two-tailed p = 0.0033. This difference is significant at 0.05.

Example 3: Welch two-sample

Group 1: mean 82, SD 6, n 20. Group 2: mean 78, SD 8, n 25. Standard error = 2.088, t = 1.916, df = 42.85, p = 0.0621, Cohen's d = 0.557 (a medium effect). The effect is medium-sized but the evidence is not strong enough to reject at 0.05, a good reminder that effect size and significance answer different questions.

Assumptions and common mistakes

  • Approximately normal data: t-tests assume the means are roughly normally distributed. With small samples, check for extreme skew or outliers; with larger samples the central limit theorem helps.
  • Independence: two-sample tests need independent groups. If the same subjects appear in both groups, use the paired test instead.
  • Equal variances only for Student's test: if the variances differ noticeably, Welch's version is the safer choice.
  • Do not run many tests and report only the significant one. Repeated testing inflates false positives; adjust or pre-register the analysis when testing many outcomes.
  • Do not treat "not significant" as "no effect." It means the data do not rule out zero, not that the true effect is zero.

How to interpret the p-value, effect size, and confidence interval

The p-value is the probability of seeing a difference at least this large if the null hypothesis were true. A small p-value (below alpha) means the data are surprising under the null, so you reject it. Cohen's d describes size in standard-deviation units: about 0.2 is small, 0.5 medium, and 0.8 large. The confidence interval shows the range of differences compatible with the data; an interval that excludes zero agrees with a significant result at the matching level.

How it works

  1. Choose the test and enter your numbers. Pick one-sample, two-sample, or paired, then enter summary statistics or paste raw data lists.
  2. Set the advanced options only if needed. The defaults (alpha 0.05, two-tailed, 95% interval) are already applied; change them in Advanced options for one-tailed tests or other levels.
  3. Read the result and the verdict. The calculator shows t, degrees of freedom, the p-value, Cohen's d, and the confidence interval, plus a plain-English conclusion.

Frequently asked questions

What is a t-test used for?

A t-test checks whether the mean of a group (or the difference between two means) is statistically different from a reference value or from zero. For example, testing whether a sample mean of 105 differs from a target of 100, or whether two teaching methods produce different average scores.

Should I use Welch's or Student's t-test?

Use Welch's by default. It does not assume equal variances and performs well in almost every case. Student's test is appropriate only when you have good reason to believe the two population variances are equal.

What is the difference between a paired and a two-sample t-test?

A paired test is for matched data, such as before-and-after measurements on the same people, where each pair gives one difference. A two-sample test is for two separate groups with no pairing between members.

What does a p-value of 0.06 mean?

It means that if there were truly no difference, you would see a result at least this extreme about 6% of the time. At alpha 0.05 that is not significant, but it is also not proof of no effect; report the confidence interval and effect size alongside it.

Can I use this calculator with raw data?

Yes. Choose "Raw data" and paste comma- or space-separated lists. For a paired test, list 1 holds the first measurement and list 2 the second, in matching order. The calculator computes the means, standard deviations, and sample sizes for you.

Why does the calculator show degrees of freedom with decimals?

Welch's test uses the Welch-Satterthwaite equation, which usually gives a non-integer degrees of freedom, such as 42.85 in the worked example. That is correct and expected; Student's and paired tests always give whole numbers.

More statistics tools

Disclaimer: This calculator is for educational and general informational purposes only. It is not a substitute for professional statistical advice. Results depend on the assumptions of the t-test; check that your data meet them before drawing conclusions.