📊
✓ Editorially reviewed by Derek Giordano, Founder & Editor · BA Business Marketing

t-Test Calculator

t statistic, degrees of freedom, p-value and critical value from summary statistics

Updated October 2026

🧮
700+ calculators, no signup required
Finance · Health · Math · Science · Business
nnng.com
Two-sample t = (mean₁ − mean₂) ÷ standard error of the difference. NIST’s car-mileage example (249 U.S. cars averaging 20.14458 mpg, SD 6.4147, vs 79 Japanese cars averaging 30.48101, SD 6.10771) gives t = -12.62059, p = 5.273e-30 with a pooled standard deviation of 6.34260 and 326 degrees of freedom. The critical value at α = 0.05 is ±1.9673, so the means differ. Welch’s version, which does not assume equal variances, gives t = −12.94627.

Where the Inputs Come From

The calculator works from summary statistics, so you need each group’s mean, sample standard deviation (the n − 1 version, STDEV.S in a spreadsheet) and count. For a one-sample test, enter only sample 1 and the value you are testing against. α is the false-positive rate you accept; 0.05 is conventional. The output gives t, the degrees of freedom, two- and one-tailed p-values, the critical t for your α, a decision and an interval for the difference.

Which t-Test to Use

TestStandard errorDegrees of freedom
Pooled two-samplesₚ √(1/n₁ + 1/n₂), with sₚ² = [(n₁−1)s₁² + (n₂−1)s₂²] ÷ (n₁+n₂−2)n₁ + n₂ − 2
Welch two-sample√(s₁²/n₁ + s₂²/n₂)Welch–Satterthwaite approximation
One-samples ÷ √nn − 1

Penn State’s STAT 500 course suggests pooling only when you are reasonably sure the variances are nearly equal, with an informal check that the ratio of the two standard deviations falls between 0.5 and 2. Welch’s version is more reliable when the standard deviations and sample sizes both differ. For paired data (before and after on the same subjects), compute each pair’s difference and run a one-sample test on the differences against 0.

The t Formula Worked Through on NIST’s Car Data

The pooled variance is [(249 − 1) × 6.4147² + (79 − 1) × 6.10771²] ÷ 326 = 40.2286, so sₚ = 6.34260. The standard error is 6.34260 × √(1/249 + 1/79) = 0.81901. The difference in means is 20.14458 − 30.48101 = −10.33643, and t = −10.33643 ÷ 0.81901 = −12.62059 with 326 degrees of freedom. The critical value for α = 0.05 two-tailed is 1.9673; |t| is far beyond it, and the p-value is 5.273e-30.

How Sample Size and Unequal Variances Change the Answer

Casetdfp (two-tailed)Significant at 0.05?
NIST car data, pooled (default)-12.62063265.273e-30Yes
NIST car data, Welch-12.9463136.871.571e-25Yes
Same means and SDs, only 10 cars per group-3.6903180.0017Yes
Means 20.14 vs 23.00, 20 per group-1.4417380.1576No
Means 50 vs 55, SD 5 (n 30) vs SD 15 (n 10), pooled-1.6096380.1158No
Same data, Welch-1.03519.670.3258No

The same 10-mpg gap is still significant with only 10 cars per group, but a 3-mpg gap with 20 per group is not. The last two rows show why the choice of test matters: when the smaller group has the larger spread, the pooled test understates the uncertainty and its p-value is about a third of Welch’s.

Reading the p-Value

The p-value is the probability of a t at least this extreme if the population means were equal. If it is below α, the difference is statistically significant. A tiny p-value says the difference is unlikely to be chance, not that it is large or important; report the difference and its interval too. Use the one-tailed p only if you chose the direction before seeing the data.

Common Mistakes With t-Tests

Treating paired data as two independent samples. Before-and-after measurements on the same people are correlated; the two-sample test throws that information away and usually loses power.

Entering the standard error instead of the standard deviation. Some reports give mean ± SE. Multiply the SE by √n to get the SD.

Running many t-tests on several groups. Comparing three or more groups pair by pair inflates the false-positive rate; analysis of variance (ANOVA) is the usual tool.

Ignoring the assumptions. Observations must be independent, and each group should be roughly normal or large (STAT 500 uses n > 30 as a guide for the paired case). Heavily skewed small samples call for a nonparametric test.

Frequently Asked Questions

How do I calculate a two-sample t-test?
t = (mean₁ − mean₂) ÷ SE, with SE from the pooled SD (equal variances) or √(s₁²/n₁ + s₂²/n₂) (Welch); compare t with the critical value for its degrees of freedom.
Should I use Welch or the pooled t-test?
Welch unless you have good reason to assume equal variances. It gives nearly the same answer when variances are equal and a more honest one when they are not.
What does p < 0.05 mean?
If the true means were equal, a difference this large would happen less than 5% of the time by chance.
How do I run a paired t-test?
Take the difference for each pair and run a one-sample t-test of those differences against 0.
What is the difference between a t-test and a z-test?
A z-test uses a known population standard deviation; a t-test estimates it from the sample, so it uses the t distribution, which has heavier tails at small sample sizes.
How do I do a t-test in Excel?
Use =T.TEST(array1, array2, tails, type) with tails 1 or 2 and type 1 (paired), 2 (equal variance) or 3 (unequal variance). It returns the p-value, not t.
What is the critical t for 326 degrees of freedom?
About ±1.9673 at α = 0.05, two-tailed.

How to Use This Calculator

  1. Choose the test — pooled, Welch or one-sample.
  2. Enter summary statistics — each group’s mean, sample standard deviation and size.
  3. Set the significance level — 0.05 is common.
  4. Read the result — t, degrees of freedom, p-values, critical value and decision.
📚 Sources & References
  1. [1] NIST/SEMATECH e-Handbook of Statistical Methods. 1.3.5.3 Two-sample t-test for equal means (AUTO83B example). Accessed Oct 2026. itl.nist.gov
  2. [2] NIST/SEMATECH e-Handbook. 1.3.5.3.1 Data used for the two-sample t-test example. Accessed Oct 2026. itl.nist.gov
  3. [3] Penn State Eberly College of Science. STAT 500 Applied Statistics, Lesson 7: Comparing two population parameters. Accessed Oct 2026. online.stat.psu.edu
  4. [4] Microsoft Support. T.TEST function. Accessed Oct 2026. support.microsoft.com
✅ Editorial Standards — Every calculator is built from peer-reviewed formulas and official data sources, editorially reviewed for accuracy, and updated regularly. Read our full methodology · About the author