T-Test Calculator

Calculate one-sample, two-sample, or paired t-test statistic and interpret results. Find t-statistic, degrees of freedom, and whether the difference is statistically significant.

📊 Statistics📐 t = (x̄ - μ) / (s / √n)🔢 Math
Test type
Sample mean x̄ (or difference)
Population/null mean μ (or 0 for paired)
Standard deviation s
Sample size n
Please enter valid values.

Formula & Reference

VariableSymbolFormulaUnits
T-Test Calculatort = (x̄ - μ) / (s / √n)dimensionless

Step-by-Step Examples

Example 1
Student Grade Test

Class mean = 75, expected mean = 72, s = 12, n = 36. Is the class performing differently?

  • SE = 12/sqrt(36) = 12/6 = 2.0
  • t = (75-72)/2.0 = 1.5
  • df = 36-1 = 35
  • Critical t ≈ 2.03 (df=35, α=0.05, two-tailed)
  • |t| = 1.5 < 2.03: not significant
✓ t = 1.5, not significant
Example 2
Drug Effect

Before: mean=120, After: mean=112, s(diff)=15, n=30 patients (paired test).

  • Mean difference = 120-112 = 8
  • t = 8/(15/sqrt(30)) = 8/2.739 = 2.92
  • df = 29, critical t ≈ 2.045
  • 2.92 > 2.045: significant at α=0.05
  • Drug significantly reduced blood pressure
✓ t = 2.92, significant
Example 3
Product Quality

Machine A: mean=10.2, s=0.3. Machine B: mean=10.5, s=0.4. n=20 each. Are they different?

  • SE_pooled = sqrt((0.09+0.16)/2) × sqrt(2/20) = 0.112
  • t = (10.5-10.2)/0.112 = 2.68
  • df = 38, critical t ≈ 2.024
  • Significant difference between machines
✓ t = 2.68, significant difference

Real-World Applications

Common Mistakes to Avoid

⚠️
Using t-test when n is very small

With n < 5, even the t-test is unreliable. Consider non-parametric tests like Wilcoxon signed-rank test.

⚠️
Forgetting equal variance assumption

Two-sample t-test assumes equal population variances (or use Welch's t-test correction). Test with Levene's or F-test first.

⚠️
Ignoring whether data is paired

Paired t-test is more powerful for before/after designs. Using two-sample test when data is paired wastes statistical power.

Frequently Asked Questions

What is a t-test?
A statistical test comparing means when the population standard deviation is unknown. Uses t-distribution (wider than normal) to account for the extra uncertainty from estimating SD from data.
When to use t-test vs z-test?
T-test: unknown population SD, small to moderate n. Z-test: known population SD (rare in practice) or very large n (>100, t ≈ z). In practice, t-test is almost always more appropriate.
What is degrees of freedom?
df = n-1 for one-sample t-test. Higher df = t-distribution approaches normal distribution. With df > 30, critical t ≈ 1.96 (same as z-test).
What is Welch's t-test?
A modification that does not assume equal variances between groups. Formula adjusts df downward. More robust than standard two-sample t-test. Most software uses Welch's by default.
What sample size do I need?
Power analysis (G*Power software): typically n=30+ per group for 80% power to detect a medium effect (Cohen's d=0.5) at α=0.05. Larger samples detect smaller effects.

Related Math Calculators

Formula Explorer connections

Interpretation: This formula summarizes data, models uncertainty or supports inference about a population or random process. Assumption: The sampling design and distribution assumptions must match the data. Independence, sample size, outliers and measurement quality can materially affect interpretation.

Two-Way Frequency Table Calculator →Variance and Standard Deviation Calculator →Weighted Probability Calculator →Math Formula Explorer →