T-Test Calculator

Compute one-sample, independent two-sample (Welch & pooled), and paired Student's t-tests with exact p-values, degrees of freedom, and Cohen's d.

Calculation Mode
Calculation Inputs

Compare means of two independent groups. Welch's unequal variances test is used by default.

Auto-Computed
Statistical Visualizations & Distributions

Interactive, data-driven visualization computed from your current input values.

Student's t-Distribution (df = 62.9)

H₀: μ₁ = μ₂ vs H₁ (two-tailed). Observed t = 2.34

Null Distribution H₀P-Value Area (0.02246)Critical α CutoffObserved (2.34)
-t_α/2 (-2)+t_α/2 (+2)t: 2.34-4-2.7-1.301.32.74t-StatisticDensity f(t)
Statistical Analysis SummaryStatistically Significant
t-Statistic
2.3402
Critical Value: ±1.9984
P-Valueα = 0.05
0.02246
p < 0.05 (Significant at α)
95% Conf. Interval[0.394, 5.006]
Cohen's d0.578Medium effect
Degrees of Freedom (df)62.91
Sample Size (N)n₁=30, n₂=35
Standard Error (SE)1.1538

Step-by-Step Mathematical Derivation

Detailed derivation with exact formulas, user input substitutions, and statistical interpretations.

Step 1

Compute Mean Difference

Formula
Δ = x1 − x2
Substitution & Values
Δ = 24.5 − 21.8
Result:
Δ = 2.7

Observed difference in average sample measurements.

Step 2

Compute Welch's Standard Error & df

Formula
SE = √s12n1 + s22n2
Substitution & Values
SE = √4.2230 + 5.1235
Result:
SE = 1.1538, df = 62.91

Welch-Satterthwaite adjustment provides robust error estimation without assuming equal variances (df = 62.91).

Step 3

Calculate t-Statistic

Formula
t = x1 − x2SE
Substitution & Values
t = 2.71.1538
Result:
t = 2.3402

The mean difference is 2.34 standard errors from the null difference of 0.

Step 4

Calculate P-Value from Student's t Distribution

Formula
p = 2 · P(Tdf ≥ |t|)
Substitution & Values
t = 2.3402, df = 62.91, α = 0.05
Result:
p = 0.02246, tcrit = ±1.9984

Exact probability under H₀ with 62.91 degrees of freedom is 0.02246. Statistically significant (p < α).

Step 5

Effect Size (Cohen's d) & Confidence Interval

Formula
d = x1 − x2spooled, CI = Δ ± t^× · SE
Substitution & Values
d = 2.7spool, 2.7 ± 1.998 × 1.154
Result:
d = 0.578, CI = [0.394, 5.006]

Cohen's d of 0.578 indicates a medium standardized effect size.

Statistical Interpretation & Assumptions

Evaluation & Analysis Guidelines

Statistical Decision: Reject H₀ at α = 0.05 (Statistically Significant)
Required Assumptions:
  • Independent continuous samples
  • Unequal population variances permitted (Welch robust method)
  • Approximate normality or adequate sample size in both groups

Student's & Welch's T-Test Formulas

Mathematical definitions for Welch's unequal variances test, Welch-Satterthwaite degrees of freedom, and Cohen's d effect size.

Welch's Unequal Variances T-Test Formula

t = x1 − x2√s12n1 + s22n2, df = ≤ft(s12n1 + s22n2)2(s12/n1)2n1−1 + (s22/n2)2n2−1

Welch's t-test does not assume equal population variances and provides superior Type I error control compared to Student's pooled t-test across unequal sample sizes.

Worked Example: Group 1 (n=30, x̄=24.5, s=4.2), Group 2 (n=35, x̄=21.8, s=5.1). SE = 1.1537, df = 62.97. t = 2.3403, p = 0.0225. We reject H₀ at α = 0.05.

One-Sample T-Test Formula

t = x − μ0s / √n, df = n − 1

Tests if the sample mean differs from a known constant when population variance is unknown and estimated by the sample standard deviation s.

Worked Example: Sample n = 25, x̄ = 52.4, s = 6.8 against benchmark μ₀ = 50. SE = 6.8/√25 = 1.36. t = (52.4 - 50) / 1.36 = 1.7647, df = 24. Two-tailed p = 0.0903.

Paired Samples T-Test Formula

t = d − μdsd / √n, df = n − 1

Tests whether the average pairwise difference d̄ in matched or repeated-measures designs differs from the null hypothesis difference (typically 0).

Worked Example: Pre-test vs post-test score differences for 20 students: d̄ = 3.2, s_d = 4.5. SE = 4.5/√20 = 1.0062. t = 3.1802, df = 19, p = 0.0049 (Significant).

How to Choose & Run Welch's, Student's, Paired & One-Sample T-Tests

Evaluates whether sample mean differences exceed random sampling noise when true population standard deviations are unknown and estimated from sample variance.

  1. 1

    Match Mode to Your Study Design

    Select Independent Samples for two unrelated groups, One-Sample to compare one cohort mean against a fixed reference μ₀, or Paired Samples for before/after measurements on the same subjects.

  2. 2

    Keep Welch's Unadjusted Default for Two Independent Groups

    Unless historical equality of variances is guaranteed, leave Welch's unequal-variance mode active; it uses the Welch-Satterthwaite df approximation to preserve true α control.

  3. 3

    Pair P-Value With Cohen's d Effect Size

    Check both statistical significance (p < α) and practical magnitude (Cohen's d), since large samples can yield small p-values for negligible differences.

T-Test Selection Matrix & Cohen's d Magnitude Benchmarks

Selecting the right T-test variant and interpreting practical difference strength via Cohen's d.

Test VariantSample StructureDegrees of FreedomCohen's d Benchmarks
Welch's Independent T-Test2 unrelated groups, unequal σWelch-Satterthwaite fractional df|d| ≈ 0.20 (Small Effect)
Student's Pooled T-Test2 unrelated groups, equal σ₁=σ₂df = n₁ + n₂ − 2|d| ≈ 0.50 (Medium Effect)
One-Sample T-Test1 cohort vs known constant μ₀df = n − 1|d| ≥ 0.80 (Large Effect)
Paired Samples T-TestPre/Post or matched subject pairsdf = n_pairs − 1Uses difference SD (s_d)

Normality, Outliers & Multiple Comparisons

Comparing 3+ Groups With Sequential T-Tests

Never compare 3 or more groups using pairwise T-tests alone — false positives multiply rapidly. Run One-Way ANOVA first to verify overall group differences.

Heavy Skewness in Tiny Samples (n < 15)

While T-tests resist moderate non-normality as n approaches 30, severe outliers in very small cohorts distort s and t; consider non-parametric rank tests in extreme cases.

T-Test Calculator — Worked Examples

Real-world scenarios and verified benchmark inputs for the T-Test Calculator.

Clinical Drug Trial Comparison (Welch)

Comparing recovery time between treatment (n=30, x̄=24.5, s=4.2) and control (n=35, x̄=21.8, s=5.1).

Resultt = 2.3403, df = 62.97, p-value = 0.02253 (Reject H₀)

One-Sample Classroom Benchmark

Checking whether a class sample (n=25, x̄=52.4, s=6.8) differs significantly from a national benchmark of 50.

Resultt = 1.7647, df = 24, p-value = 0.09033 (Fail to Reject H₀)

Pre vs Post Training Intervention (Paired)

Evaluating employee productivity score gains (d̄=3.2, s_d=4.5) across 20 matched participants.

Resultt = 3.1802, df = 19, p-value = 0.00492 (Reject H₀)

T-Test Calculator — Frequently Asked Questions

Expert answers on t-tests, Welch vs pooled variances, sample size balance, and effect size interpretations.

Why does YourCalculate use Welch's t-test by default instead of Student's pooled t-test?

Decades of statistical literature (Ruxton 2006, Delacre et al. 2017) demonstrate that Welch's t-test maintains accurate Type I error rates when group variances and sample sizes differ, with virtually no power loss when variances are equal. It is the standard default in R, SciPy, and biostatistics.

Why are degrees of freedom fractional in Welch's t-test?

Welch's t-test uses the Welch-Satterthwaite approximation equation to compute effective degrees of freedom from the two groups' sample variances and sample sizes. Unlike pooled Student's df (n₁ + n₂ − 2), this weighted formula produces non-integer values that calibrate the t-distribution tails accurately.

How do I choose between an Independent Samples and Paired Samples T-test?

Use an Independent Samples T-test when comparing two completely separate groups of subjects (e.g., Group A vs Group B). Use a Paired Samples T-test when measurements come from the same subjects before and after an intervention, or matched pairs where each subject pairs directly with one partner.

How do I interpret Cohen's d effect size alongside p-values?

P-values indicate whether an effect is unlikely due to random sampling variation, whereas Cohen's d quantifies practical magnitude in standard deviation units: d ≈ 0.2 is small, d ≈ 0.5 is medium, and d ≥ 0.8 is large.

When should I run One-Way ANOVA instead of multiple T-tests?

If you need to compare 3 or more group means simultaneously, running separate pairwise T-tests inflates your family-wise false positive (Type I error) rate. Use One-Way ANOVA first to run an omnibus F-test across all groups before conducting post-hoc comparisons.

What assumptions does a T-test require when sample sizes are small?

For small samples (n < 30), the underlying population or paired differences should be approximately normal without extreme outliers. For larger samples, the Central Limit Theorem ensures sample means remain approximately normal even under moderate skewness.

Related Calculators

Explore connected statistics & probability and related computation tools.

Browse all Statistics & Probability calculators
Statistics & Probability

Z-Test Calculator

Available
Statistics & Probability

One-Way ANOVA Calculator

Available
Statistics & Probability

P-Value Calculator

Available
Statistics & Probability

Confidence Interval Calculator

Available