STATISTICSInference & TestsStatistics Calculator
📊

T-Test Calculator

Free t-test calculator with step-by-step breakdown. One-sample, two-sample, Welch, paired t-tests. R

Run CalculatorExplore data analysis and statistical calculations

Why This Statistical Analysis Matters

Why: Statistical calculator for analysis.

How: Enter inputs and compute results.

t
STATISTICSInference & Tests

T-Test — The Most Used Hypothesis Test

One-sample, two-sample (pooled/Welch), paired. Raw data or summary stats. Assumptions check, effect size, power analysis.

Real-World Scenarios — Click to Load

Test Configuration

One-Sample Data

t_test_results.sh
CALCULATED
$ t_test --type="one-sample" --tail="two-tailed" --alpha=0.05
Decision
FAIL TO REJECT
t-statistic
0.8333
df = 24.0
p-value
0.4726
95% CI
[97.047, 106.953]
Cohen's d
0.1667
Negligible
Power
17.4%
n for 80% Power
283
Assumptions
Small n: verify normality
Share:
T-Test Result
One-sample t-test
t = 0.833
p = 0.4726df = 24d = 0.17
numbervibe.com/calculators/statistics/t-test-calculator

t-Distribution: Rejection Region & p-value

Power vs Sample Size

Effect Size vs Cohen's Benchmarks

Calculation Breakdown

COMPUTATION
Standard Error
2.4000
SE = s/√n
t-statistic
0.8333
t = ( ext{estimate} - ext{null}) / ext{SE}
Degrees of freedom
24.0
DECISION
Critical value t*
±2.0639
α=0.05, two-tailed
p-value
0.4726
DECISION
FAIL TO REJECT H₀
CONFIDENCE INTERVAL
95% CI
[97.0467, 106.9533]
EFFECT SIZE & POWER
Cohen's d
0.1667 (Negligible)
Power
17.4%
SAMPLE SIZE PLANNING
n needed for 80% power
283 per group

⚠️For educational and informational purposes only. Verify with a qualified professional.

Key Takeaways

  • One-sample t: t = (x̄ − μ₀)/(s/√n). Use when σ is unknown and estimated by s
  • Pooled two-sample: Assumes equal variances. df = n₁ + n₂ − 2
  • Welch's t: Does NOT assume equal variances — the safer default for two-sample tests
  • Paired t: Tests the mean of paired differences. More powerful when pairing reduces variability
  • • Cohen's d benchmarks: 0.2 = small, 0.5 = medium, 0.8 = large effect
  • • The t-test is robust to moderate non-normality when n ≥ 30 (Central Limit Theorem)

Did You Know?

🍺The t-test was invented by William Sealy Gosset in 1908. He published under the pseudonym "Student" because his employer (Guinness brewery) prohibited staff from publishing.Source: Biometrika, 1908
📊Welch's t-test is now the default in R's t.test() function. The American Statistical Association recommends it over the pooled t-test in most cases.Source: R Documentation
🔬A paired t-test on 20 subjects can have higher power than an independent t-test on 100 subjects — if the pairing removes enough variability.Source: Montgomery & Runger, 2014
📈The t-distribution approaches the normal distribution as df → ∞. For df > 120, the difference between t* and z* critical values is less than 0.5%.Source: NIST Handbook
⚠️Post-hoc power (calculated after the test) is controversial. Many statisticians argue it adds no information beyond the p-value. Plan for power BEFORE collecting data.Source: Hoenig & Heisey, 2001
🏥The FDA requires that clinical trials demonstrate statistical significance in TWO independent trials, typically using t-tests or their variants, before drug approval.Source: FDA Guidance

Expert Tips — Choosing the Right T-Test

Welch's t: The Safe Default

Unless you have strong evidence of equal variances (Levene's p > 0.10), use Welch's t. It performs well even when variances are equal, with minimal power loss.

Paired vs Independent

If the same subjects are measured twice (before/after), use paired t. Using independent t here wastes information and reduces power dramatically.

Raw Data vs Summary Stats

Raw data allows assumptions checking (skewness, variance ratio). Summary stats are faster when you only have x̄, s, n from a published paper.

Non-Normal Data?

For n < 30 with skewed data, consider the Wilcoxon test (paired) or Mann-Whitney U (independent).

Decision Tree: Which T-Test?

QuestionAnswer→ Use
How many groups?One group vs known valueOne-sample t
Same subjects measured twice?Yes (before/after)Paired t
Two independent groups, equal variances?Yes (Levene p > 0.10)Pooled two-sample t
Two independent groups, unequal variances?Yes or unsureWelch's t (recommended)
More than 2 groups?YesUse ANOVA instead
Data highly non-normal, small n?YesUse non-parametric test

Why Use This Calculator vs Other Tools?

FeatureThis CalculatorR / PythonExcel
All 4 t-test types (one-sample, pooled, Welch, paired)⚠️ T.TEST only
Raw data AND summary stats input✅ (raw)⚠️ Summary only
Automatic assumptions check⚠️ Manual
Interactive t-distribution visualization⚠️ Code needed
Power analysis & sample size curve✅ (pwr pkg)
Cohen's d with benchmarks⚠️ Manual
Step-by-step calculation breakdown
Copy, share, AI analysis
No installation required

Frequently Asked Questions

When should I use Welch's t instead of pooled?

Use Welch's t as the default for two independent groups. It does not assume equal variances and performs nearly as well as pooled t when variances ARE equal. The American Statistical Association and R both default to Welch.

What is the difference between paired and independent t-tests?

Paired t uses the SAME subjects measured under two conditions (before/after, left/right). Independent t compares TWO SEPARATE groups. Using independent t for paired data wastes the within-subject correlation and loses power.

How do I check the normality assumption?

For raw data: check skewness (|sk| < 1 is OK), histogram, or Q-Q plot. For n ≥ 30, the CLT makes the t-test robust to non-normality. For small n with skewed data, use Mann-Whitney U or Wilcoxon.

What does Cohen's d mean practically?

d = 0.2 means the groups differ by 0.2 standard deviations (small, ~15% non-overlap). d = 0.8 is a large effect (~47% non-overlap). In clinical trials, even small effects can be practically significant if the outcome is important.

How do I plan my sample size?

Use the power curve chart. Specify: (1) smallest meaningful effect size d, (2) desired power (80%), (3) α (0.05). The curve shows n needed per group. Rule of thumb: n ≈ 16/d² per group for 80% power.

Can I use the t-test for proportions?

No — use the z-test for proportions instead. The t-test is for continuous data (means). See our Z-Test Calculator for proportion tests.

What if I have more than 2 groups?

Use ANOVA (Analysis of Variance) instead. Running multiple t-tests inflates Type I error. See our ANOVA Calculator.

T-Test by the Numbers

1908
Year invented by "Student"
2.045
t* for df=29, α=0.05
80%
Recommended minimum power
16/d²
Quick n per group formula

Disclaimer: This calculator is for educational and research planning purposes. It uses the Lanczos approximation for the gamma function and Abramowitz & Stegun for the normal CDF. For publishable research, verify with R, Python scipy, SAS, or SPSS. Always check assumptions: independence, normality (or n ≥ 30), and equal variances (for pooled t). Not professional statistical consulting.

👈 START HERE
⬅️Jump in and explore the concept!
AI