EasyUnitConverter.com

T-Test Calculator

Perform one-sample, two-sample (independent), or paired t-tests. Calculate t-statistics, p-values, degrees of freedom, and confidence intervals. See also our Z-Test Calculator, P-Value Calculator, and Confidence Interval Calculator.

How to Use the T-Test Calculator

The Student's t-test is used to determine whether there is a statistically significant difference between means. Choose one-sample to compare a sample mean against a known population mean, two-sample (independent) to compare means from two separate groups, or paired to compare means from the same group measured twice (before/after studies).

Enter your summary statistics: sample mean, standard deviation, and sample size. For two-sample tests, provide statistics for both groups. For paired tests, enter the mean difference, standard deviation of differences, and number of pairs. Select your significance level and tail type, then click Calculate to get the t-statistic, p-value, and confidence interval.

The t-test assumes approximately normal data (robust for n > 30 by CLT), independent observations, and for the two-sample test, the Welch approximation handles unequal variances. If your sample size is large (n > 30) and population standard deviation is known, consider using a z-test instead.

Formula

One-Sample t-test:

t = (x̄ - μ₀) / (s / √n)

df = n - 1

Two-Sample t-test (Welch's):

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

Confidence Interval:

CI = (x̄₁ - x̄₂) ± t*(α/2, df) × SE

Example Calculation

A researcher tests whether a sample of 30 students has a mean IQ different from 100:

Given: x̄ = 105, s = 15, n = 30, μ₀ = 100

SE = 15 / √30 = 15 / 5.477 = 2.739

t = (105 - 100) / 2.739 = 1.826

df = 30 - 1 = 29

p-value (two-tailed) ≈ 0.0783

At α = 0.05: Fail to reject H₀ (p > 0.05)

95% CI: [−0.370, 10.370]

The evidence is insufficient to conclude the mean differs from 100.

T Critical Values Reference Table

dft₀.₁₀t₀.₀₅t₀.₀₂₅t₀.₀₁
16.31412.70631.82163.657
22.9204.3036.9659.925
52.0152.5713.3654.032
101.8122.2282.7643.169
151.7532.1312.6022.947
201.7252.0862.5282.845
251.7082.0602.4852.787
301.6972.0422.4572.750
601.6712.0002.3902.660
1.6451.9602.3262.576

Frequently Asked Questions

What is a t-test?

A t-test is a statistical hypothesis test used to determine whether there is a significant difference between the means of one or two groups. It uses the t-distribution, which accounts for the extra uncertainty when the population standard deviation is unknown and must be estimated from the sample. The test produces a t-statistic and p-value that indicate whether the observed difference is likely due to chance.

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

Use a t-test when the population standard deviation is unknown (estimated from sample data) or when sample sizes are small (n < 30). Use a z-test when the population standard deviation is known and the sample size is large. In practice, the t-test is almost always preferred because population σ is rarely known. As sample size increases, the t-distribution approaches the standard normal distribution.

What is the difference between one-tailed and two-tailed tests?

A two-tailed test checks for any difference (H₁: μ ≠ μ₀), while a one-tailed test checks for a specific direction (H₁: μ > μ₀ or H₁: μ < μ₀). Two-tailed tests are more conservative — the p-value is double that of a one-tailed test. Use one-tailed only when you have a strong prior reason to test in one direction and would not act on a difference in the other direction.

What assumptions does the t-test require?

The t-test assumes: (1) data are continuous, (2) observations are independent, (3) data are approximately normally distributed (less critical for n > 30 due to CLT), and (4) for two-sample tests, groups are independent. Welch's t-test does not require equal variances. Violations of normality can be addressed with non-parametric alternatives like the Mann-Whitney U test or Wilcoxon signed-rank test.

What is Welch's t-test?

Welch's t-test is a modification of the two-sample t-test that does not assume equal variances between groups. It adjusts the degrees of freedom using the Welch-Satterthwaite equation, resulting in a non-integer df. It is generally recommended over the pooled (Student's) t-test because it performs well regardless of whether variances are equal, with minimal loss of power when they are.

How do I interpret the p-value from a t-test?

The p-value is the probability of observing a t-statistic as extreme as (or more extreme than) the one calculated, assuming the null hypothesis is true. If p < α (typically 0.05), reject H₀ and conclude the difference is statistically significant. A small p-value does not indicate a large effect — always report effect size (Cohen's d) and confidence intervals alongside p-values for complete interpretation.