T-Test Calculator

Run a two-sample t-test (Welch) from each group's mean, standard deviation and size, with the t-statistic and two-tailed p-value.

By Konstantin Iakovlev · Updated September 2026 · Source: NIST/SEMATECH e-Handbook of Statistical Methods — 1.3.5.3 Two-Sample t-Test for Equal Means

t-Statistic

3.0945

Significant?

Yes (p<0.05)

T-Test Results

t-Statistic3.0945
Degrees of Freedom (Welch)57.4
p-value (two-tailed)0.0030
Mean Difference3.2000

Use the T-Test Calculator above to calculate your results. Enter your values and see instant results — all calculations run in your browser.

Disclaimer: This calculator is for informational purposes only. Results are estimates based on the information you provide and the assumptions described on this page.

How It Works

At its core, a t-test asks whether the average outcomes of two groups differ by more than chance would explain. Researchers and analysts rely on it to test hypotheses, from comparing two treatments head to head to checking whether a revised process actually improves results.

Which version applies depends on how your data is structured: an independent samples t-test for two unrelated groups, or a paired samples t-test when the same subjects are measured twice. This calculator runs the independent version from summary statistics: enter each group's mean, standard deviation and size. The t-statistic is the difference between the means divided by its standard error, √(s1²/n1 + s2²/n2), which does not assume equal variances, so the calculator pairs it with the Welch–Satterthwaite degrees of freedom, as the NIST handbook does (close to n1 + n2 − 2 when the groups have similar spreads and sizes); the resulting two-tailed p-value tells you how surprising the observed gap would be if no real difference existed. For paired data, work out each subject's difference first and test whether the mean difference is zero; this calculator does not do that step.

Valid results depend on the test's assumptions holding, including roughly normal data and, for independent samples, comparable variances between groups. Statistical significance also is not the same as importance: a tiny but real difference can produce a small p-value, so read the effect size next to it to judge whether the finding matters in practice.

Example: Comparing Test Scores After Two Teaching Methods

  1. 1 A teacher wants to see if a new teaching method improves test scores. Group B (30 students, new method) averaged 78.0 with a standard deviation of 8.0; Group A (30 students, old method) averaged 73.0 with a standard deviation of 7.5.
  2. 2 Enter Sample 1: mean 78, SD 8, n 30 and Sample 2: mean 73, SD 7.5, n 30. Standard error = √(8²/30 + 7.5²/30) = √(2.1333 + 1.875) = √4.0083 = 2.0021, so t = (78 − 73) / 2.0021 = 2.4974, with Welch–Satterthwaite degrees of freedom of 57.8 (the equal-variance count would be 30 + 30 − 2 = 58).
  3. 3 For t = 2.50 with 57.8 degrees of freedom, the two-tailed p-value from the t-distribution is 0.0154, which the calculator shows with Significant? Yes (p<0.05).
  4. 4 Since the p-value (0.015) is less than 0.05, we reject the null hypothesis: a 5-point gap this large is unlikely to be chance alone. Whether 5 points matters is a separate question of effect size; here the gap is about two-thirds of a standard deviation.

Frequently Asked Questions

When should I use a t-test instead of a z-test?
Use a t-test when the sample size is small (typically under 30) or the population standard deviation is unknown (which is most real-world situations). The t-distribution accounts for the extra uncertainty from estimating the standard deviation from the sample.
What is the difference between a one-sample and two-sample t-test?
A one-sample t-test compares a sample mean to a known or hypothesized value (is this group different from 100?). A two-sample t-test compares the means of two independent groups (is group A different from group B?).
What does degrees of freedom mean in a t-test?
Degrees of freedom (df) represent the number of independent values that can vary. For a one-sample t-test, df = n - 1. For a two-sample t-test, df depends on whether you assume equal variances. More degrees of freedom make the t-distribution closer to a normal distribution.