KKC Tools
All tools →

T-Test Calculator: One-Sample, Two-Sample and Paired t-Tests

Compute Student-t and Welch's t-statistics, degrees of freedom, exact p-values, confidence intervals of differences, and standardized effect sizes from summary statistics or raw observations.

A t-test checks whether two means differ by more than chance. Group means of 75 and 70 (SD 10 and 12, 30 each) give Welch's t = 1.753 with about 56 degrees of freedom: a two-sided p-value of 0.085, so the difference is not significant at the 5% level.

Two-Sample Independent Groups

Group 1 (Treatment / A)
Group 2 (Control / B)
Standard null hypothesis: Δ = 0
Welch's Two-Sample t-Test
t = 1.753
df ≈ 56.17·p = 0.085 (two-tailed)·α = 0.05
At α = 0.05, the difference of 5.00 points is not statistically significant (Welch t = 1.753, df ≈ 56.17, p = 0.085).
If the true difference were 0, a difference at least this large would appear about 8.5% of the time due to random sampling chance alone.
p-Value (2-tailed)0.0850p ≥ α (Not Significant)
Critical t (t*)±2.003Threshold at α = 0.05
95% CI of Difference[-0.71, 10.71]SE(diff) = 2.852
Effect Sized = 0.453Hedges' g = 0.447
Student-t Distribution (df = 56.2)
━ Curve- - Critical t (±2.00)● Observed t (1.75)
0+2.00-2.00t = 1.75
GroupSample Size (n)Mean (x̄)SD (s)Std Error (SE)
Group 13075.00010.0001.826
Group 23070.00012.0002.191
Difference (1 − 2)—5.000—2.852
Assumption Checklist & Interpretation Guidance
• Welch vs Pooled: Welch's t-test does not assume equal variances. It maintains robust Type I error rates across both equal and unequal variance scenarios (Delacre et al., 2017).
• Normality: t-tests assume continuous data drawn from approximately normal distributions. By the Central Limit Theorem, deviations from normality are less problematic as sample size exceeds 30.
• Interpretation of p: A p-value of 0.085 is the probability of observing test statistic |t| ≥ 1.753 assuming the null hypothesis is true; it is not the probability that the null hypothesis itself is true.
  • Welch, pooled & paired
  • Raw data or summary stats
  • p-value, CI & effect size
  • t-curve chart

100% free · No sign-up · Runs in your browser, nothing is uploaded

How to Use the T-Test Calculator

This statistical calculator allows researchers, analysts, and students to evaluate statistical hypotheses across three testing methodologies:

  1. Select your test structure: Choose Two-Sample for comparing two distinct groups, Paired for matched or repeated-measures samples, or One-Sample to compare a single sample against a hypothesized benchmark mean (μ₀).
  2. Choose your input format: Use Summary Stats if you already have the sample size (n), sample mean (x̄), and standard deviation (s). Alternatively, toggle to Raw Data to paste comma-separated or whitespace-separated numbers directly.
  3. Configure hypothesis parameters: Adjust the significance threshold (α = 0.05 standard, 0.01, or 0.10) and hypothesis direction (two-tailed non-directional vs. one-tailed directional).
  4. Review the findings: Analyze the hero statistical verdict, the exact p-value, critical t thresholds, confidence intervals, and the visual Student-t distribution curve.

Which T-Test Should I Use?

Selecting the appropriate t-test depends on your experimental design and whether observations are linked:

  • Independent Two-Sample Test: Participants in Group A are entirely separate individuals from participants in Group B (e.g., comparing user retention across two distinct interface designs or test scores between two different classrooms).
  • Paired (Dependent) Test: Each observation in Group 1 matches an observation in Group 2 (e.g., measuring blood pressure before and after medical treatment on the same patient cohort, or comparing twin studies).
  • One-Sample Test: You have a single observed sample and want to determine whether its mean deviates significantly from a known historical standard, regulatory requirement, or manufacturing specification (e.g., testing if machine parts average 100 mm in diameter).

Two-Sample T-Test: Welch vs. Student's Pooled

When comparing two independent sample means, classical statistics provides two distinct approaches:

Welch's t = (x̄₁ − x̄₂ − Δ) ÷ √[ (s₁² ÷ n₁) + (s₂² ÷ n₂) ]
df_Welch = [ (s₁²/n₁ + s₂²/n₂)² ] ÷ [ (s₁²/n₁)² ÷ (n₁ − 1) + (s₂²/n₂)² ÷ (n₂ − 1) ]

The classical Student's t-test pools sample variances into a single estimate (s_p²), requiring the strict assumption of equal population variances (σ₁² = σ₂²). However, when group sample sizes or variances are unequal, Student's t-test exhibits compromised Type I error control.

Methods papers such as Delacre, Lakens & Leys (2017) and Ruxton (2006) recommend Welch's t-test as the default for two independent groups. Welch's test does not assume equal variances; when the variances are equal it gives nearly the same result as the pooled test, and when they differ it keeps the false-positive rate closer to the α you chose. This calculator uses Welch by default.

Paired T-Test Methodology

A paired t-test calculates pairwise differences for each subject: dᵢ = x₁ᵢ − x₂ᵢ. The test evaluates whether the mean difference (d̄) differs from the hypothesized difference (under standard null testing, Δ = 0):

t = (d̄ − Δ) ÷ (s_d ÷ √n), with df = n − 1

Because each participant acts as their own control, between-subject variance is mathematically eliminated, frequently providing higher statistical power to detect small experimental effects.

One-Sample T-Test Methodology

A one-sample t-test evaluates whether the sample average (x̄) differs from an external target or known constant benchmark (μ₀):

t = (x̄ − μ₀) ÷ (s ÷ √n), with df = n − 1

For instance, if a sample of 25 precision bolts has an average diameter of 104 mm with a standard deviation of 10 mm, testing against a specification benchmark of μ₀ = 100 mm yields t = (104 − 100) ÷ (10 ÷ √25) = 2.000 with df = 24.

Reading the Results: p-Value, Confidence Interval, and Effect Size

Proper statistical reporting requires interpreting three complementary metrics:

  • p-Value: Indicates the probability of observing data this extreme if no true difference existed in the population. If p < α, the difference is statistically significant (we reject the null hypothesis H₀). If p ≥ α, we fail to reject H₀. We never "accept the null hypothesis".
  • Confidence Interval of the Difference: Reflects the precision of our estimate. A 95% confidence interval indicates that under repeated sampling, 95% of such calculated intervals would cover the true population mean difference.
  • Standardized Effect Size (Cohen's d & Hedges' g): Measures magnitude independent of sample size: d = (x̄₁ − x̄₂) ÷ s_pooled. Hedges' g applies a sample-size correction factor j = 1 − 3 ÷ (4·df − 1) to eliminate small-sample bias.

Degrees of Freedom (df)

Degrees of freedom represent the number of independent values or quantities that can vary in an analysis without violating given mathematical constraints. In a one-sample or paired t-test, once the sample mean or mean difference is fixed, exactly n − 1 observations are free to vary. In Welch's t-test, the Welch–Satterthwaite approximation produces non-integer degrees of freedom that precisely calibrate the tail probabilities of the t-distribution curve.

Assumptions and Practical Considerations

Before drawing definitive conclusions from a t-test, verify the following experimental conditions:

  • Continuous Scale: The dependent variable should be measured on an interval or ratio scale.
  • Independent Observations: Data collection must ensure that observations are mutually independent within and between groups.
  • Outlier Sensitivity: Because the arithmetic mean and sample variance are sensitive to extreme values, examine your data for extreme outliers using our IQR Calculator or Standard Deviation Calculator.
  • Testing Proportions: If you are comparing conversion rates or categorical proportions rather than numerical averages, use our A/B Test Significance Calculator.

Frequently Asked Questions

What is a t-test?

A t-test is an inferential statistical test that assesses whether the difference between sample means is statistically significant or could reasonably be attributed to random sampling variability. Introduced by William Sealy Gosset in 1908 under the pen name "Student", the test relies on the Student-t distribution when population standard deviations are unknown and estimated from sample data.

Which t-test should I use: one-sample, two-sample, or paired?

Use a one-sample t-test when comparing a single group mean against a known constant benchmark (μ₀). Use a paired t-test when observations are matched or come in pairs (such as pre-test and post-test scores from the same subjects). Use an independent two-sample t-test when comparing two completely distinct, unrelated participant or experimental groups.

Why does this calculator default to Welch’s t-test instead of Student’s pooled t-test?

Classical Student’s t-test assumes homogeneity of variance (equal variances across both groups). When the variances differ, and especially when the group sizes differ too, the pooled test’s false-positive rate can drift away from the α you chose. Welch’s test does not assume equal variances and gives almost the same answer as the pooled test when the variances are equal, so this calculator uses Welch by default. Pick the pooled test only if you have a reason to assume equal variances.

What is the correct statistical interpretation of a p-value?

The p-value is the probability of observing a test statistic at least as extreme as the one calculated, assuming that the null hypothesis (H₀) of no true difference is completely true. It is NOT the probability that the null hypothesis itself is true, nor does it measure the magnitude or practical importance of the observed difference.

When should I choose a one-tailed versus a two-tailed hypothesis test?

A two-tailed test evaluates for differences in either direction (x̄₁ ≠ x̄₂) and is the standard scientific default. A one-tailed test (x̄₁ > x̄₂ or x̄₁ < x̄₂) should only be chosen prior to data collection when an effect in the opposing direction is theoretically impossible or completely irrelevant to decision-making.

What are the core mathematical assumptions of a t-test?

The primary assumptions include: (1) Continuous interval or ratio data, (2) Independence of observations (or paired independence for paired designs), (3) Approximate normality of data distributions (or normality of pairwise differences), and (4) Homogeneity of variance (required only for Student’s pooled test, but avoided by using Welch’s t-test).

What is Cohen’s d and Hedges’ g effect size?

While the p-value evaluates statistical significance, effect size quantifies practical magnitude. Cohen’s d measures the standardized difference between means in units of pooled standard deviation. For smaller sample sizes (n < 20), Cohen’s d exhibits a slight upward bias; Hedges’ g multiplies d by a small-sample correction factor to reduce that bias.

How are degrees of freedom (df) calculated in Welch’s t-test?

While Student’s pooled test uses the integer df = n₁ + n₂ − 2, Welch’s t-test computes fractional degrees of freedom using the Welch–Satterthwaite equation based on the variance and sample size of each group. This fractional df adjusts the shape of the t-distribution curve to accurately reflect the true uncertainty of the unequal variance components.

Can I calculate a t-test using only sample size, mean, and standard deviation?

Yes. Because the t-statistic, degrees of freedom, standard error, and p-value depend entirely on the sample sizes (n), arithmetic means (x̄), and sample standard deviations (s), you do not need raw individual records if these summary statistics are already available.

What should I do if my sample size is small or data are non-normal?

When sample sizes exceed 30, the Central Limit Theorem helps ensure that the sampling distribution of the mean is approximately normal even if the underlying data exhibit moderate skewness. For very small sample sizes (n < 15) with heavy skewness or severe outliers, consider non-parametric alternatives such as the Mann–Whitney U test (for two independent groups) or Wilcoxon signed-rank test (for paired data).

How does a t-test differ from a z-test or ANOVA?

A z-test requires known population standard deviation (σ), which is rarely available in real-world research. A t-test uses the sample standard deviation (s) and Student-t distribution. One-Way ANOVA extends this comparison to three or more simultaneous groups without compounding Type I error rates.

How This Calculator Works: Formula, Defaults & Sources

Formula

  • Welch (default): t = (x̄₁ − x̄₂ − Δ) ÷ √(s₁²/n₁ + s₂²/n₂); df by the Welch–Satterthwaite equation
  • Pooled: sp² = ((n₁ − 1)s₁² + (n₂ − 1)s₂²) ÷ (n₁ + n₂ − 2); t = (x̄₁ − x̄₂ − Δ) ÷ (sp √(1/n₁ + 1/n₂)); df = n₁ + n₂ − 2
  • Paired: one-sample test on the differences dᵢ; one-sample: t = (x̄ − μ₀) ÷ (s ÷ √n), df = n − 1
  • p-value from the Student-t CDF (regularized incomplete beta); two-tailed p = 2(1 − F(|t|))
  • CI = difference ± t* × SE; Cohen’s d = difference ÷ pooled SD (or ÷ s for one-sample/paired); Hedges’ g = d × (1 − 3 ÷ (4·df − 1))

Default values (you can change them)

  • Test: Welch two-sample, two-tailed, α = 0.05 (all editable)
  • Worked example: means 75 vs 70, SD 10 vs 12, n 30 each: Welch t = 1.753, df = 56.17, p = 0.085; pooled df = 58, p = 0.0848

Sources

  • NIST/SEMATECH e-Handbook of Statistical Methods — two-sample t-test, including the unequal-variance (Welch) form and its degrees of freedom
  • Delacre, Lakens & Leys (2017), International Review of Social Psychology — argues for Welch’s t-test as the default for two independent groups

Results are planning estimates, not engineering advice. Confirm quantities with your supplier and follow your plans and local building code. Last updated: November 25, 2026. Spotted a wrong number? Email us or use the contact page.

💡Suggest a Tool