T-Test Calculator

Perform one-sample, two-sample, Welch's, and paired t-tests online. Get t statistic, p-value, degrees of freedom, Cohen's d, and confidence intervals instantly.

About the T-Test Calculator

The t-test is the workhorse of statistical hypothesis testing for comparing means. Whether you're testing if a sample mean differs from a known value (one-sample), comparing two independent groups (two-sample), or analyzing paired measurements (paired t-test), this tool handles it all.

This calculator supports four variants: one-sample t-test, independent two-sample t-test (pooled variances), Welch's t-test (unequal variances), and paired t-test. Enter your summary statistics, select the test type and tail direction, and instantly get the t statistic, p-value, degrees of freedom, Cohen's d effect size, and a confidence interval for the mean difference.

T-tests are fundamental in medical research (drug efficacy), psychology (treatment effects), engineering (quality comparison), education (teaching method evaluation), business (A/B testing), and virtually any field that compares group averages. Check the example with realistic values before reporting. Use the steps shown to verify rounding and units. Cross-check this output using a known reference case. Use the example pattern when troubleshooting unexpected results.

Why Use This T-Test Calculator?

Computing a t-test by hand requires calculating pooled variances, looking up critical values in tables, and manually determining significance — processes prone to error. This calculator handles all four t-test variants, automatically computes degrees of freedom (including Welch-Satterthwaite for unequal variances), and provides effect sizes and confidence intervals alongside the p-value, giving you a complete picture in seconds.

How to Use This Calculator

  1. Select the t-test variant: one-sample, two-sample, Welch's, or paired.
  2. Choose tail direction: two-tailed, right-tailed, or left-tailed.
  3. Enter the summary statistics for your data (means, standard deviations, sample sizes).
  4. Set your significance level alpha (default 0.05).
  5. Review the t statistic, p-value, and reject/fail-to-reject decision.
  6. Check Cohen's d effect size to assess practical significance.
  7. Examine the confidence interval for the mean difference.

Formula

One-Sample t-Test: t = (x̄ − μ₀) / (s / √n), df = n − 1 Two-Sample t-Test (pooled): t = (x̄₁ − x̄₂) / √(s²p(1/n₁ + 1/n₂)) s²p = ((n₁−1)s₁² + (n₂−1)s₂²) / (n₁ + n₂ − 2) df = n₁ + n₂ − 2 Welch's t-Test: t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂) df = (s₁²/n₁ + s₂²/n₂)² / ((s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1)) Paired t-Test: t = d̄ / (s_d / √n), df = n − 1

Example Calculation

Result: t(98) = 1.7408, p = 0.0849

Comparing two groups of 50 yields t = 1.74 with 98 degrees of freedom. The two-tailed p-value of 0.085 exceeds 0.05, so we fail to reject H₀. Cohen's d = 0.35, indicating a small-to-medium effect. The 95% CI for the mean difference includes zero: [−0.056, 0.856].

Tips & Best Practices

Choosing the Right T-Test

One-sample t-test: comparing a single group to a known value (e.g., testing if average reaction time differs from 250ms). Two-sample t-test: comparing independent groups (e.g., treatment vs control). Paired t-test: comparing the same subjects under two conditions (e.g., before and after treatment, left vs right hand). When in doubt between pooled and Welch's two-sample tests, use Welch's — it's valid under both equal and unequal variances.

Interpreting Results Beyond the P-Value

A complete t-test report includes the t statistic, degrees of freedom, p-value, mean difference, confidence interval, and effect size. The confidence interval is arguably more informative than the p-value: it shows the range of plausible values for the true difference, giving you both significance and magnitude information in one quantity.

Common Pitfalls

Multiple comparisons: running many t-tests inflates the false positive rate — use ANOVA or correction methods instead. Violated assumptions: the pooled t-test with very unequal variances and unequal sample sizes gives unreliable results — switch to Welch's. Confusing statistical and practical significance: a p-value of 0.001 with d = 0.05 means a real but trivially small effect.

Frequently Asked Questions

When should I use a t-test vs a z-test?

Use a t-test when the population standard deviation is unknown (which is almost always). Use a z-test only when σ is known and the sample is large. In practice, the t-test is almost always the correct choice.

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

The pooled (Student's) t-test assumes equal variances in both groups. Welch's t-test does not make this assumption and uses a modified degrees of freedom formula. Welch's is recommended as the default because it's valid regardless of variance equality.

What does degrees of freedom (df) mean?

Degrees of freedom determines the shape of the t-distribution used for p-value calculation. Higher df means the distribution is closer to normal. For one-sample: df = n−1. For two-sample: df = n₁+n₂−2. Welch's df is typically fractional.

Can I use a t-test for non-normal data?

The t-test is robust to moderate non-normality, especially with larger samples (n > 30) due to the Central Limit Theorem. For small samples from heavily skewed or outlier-prone distributions, use non-parametric alternatives like the Wilcoxon test.

What assumptions does the t-test require?

Independence of observations, approximate normality of the sampling distribution, and (for the pooled test) equal variances in both groups. Welch's test relaxes the equal variance assumption.

What if I have raw data instead of summary statistics?

Compute the mean, standard deviation, and sample size from your raw data first, then enter those values. Alternatively, use our standard deviation calculator to get these summary statistics.

Related Pages