Skip to main content
ilovecalcs logoilovecalcs.

Statistics · Live

T-Test Calculator

Perform a Student's t-test for independent samples, paired samples, or a one-sample test. Paste your data, choose the test type, and instantly get the t-statistic, degrees of freedom, p-value, and a clear significance decision.

How it worksReal-time

Inputs

Configure the test

Separate values with commas, spaces, or new lines.

Separate values with commas, spaces, or new lines.

Independent Samples T-Test

Two-tailed · α = 0.05

t-statistic

4.5132

df

11.09

p-value

0.0009

Significant result (p = 0.0009 < α = 0.05)

Reject the null hypothesis. The difference is statistically significant.

Critical value: |t| > 2.1989 to reject H₀ at α = 0.05 (two-tailed)

Summary statistics

Descriptive statistics by group

GroupnMeanSDSE
Group A860.86520.3059
Group B84.41250.49120.1737

Interpretation

How to read these results

t = 4.5132 — the standardised difference between the two groups. Larger absolute values provide stronger evidence against H₀.

df = 11.09 — degrees of freedom used to determine the shape of the t-distribution. The Welch-Satterthwaite approximation is used (does not assume equal variances).

p = 0.0009 — the probability of observing a t-statistic this extreme (or more) if H₀ were true. This is a two-tailed probability (difference in either direction).

Statistics guide

What is a Student's t-test and when do you use it?

A t-test is a statistical hypothesis test used to determine whether there is a statistically significant difference between the means of two groups, or between a sample mean and a known or hypothesised population mean. It was developed by William Sealy Gosset in 1908 under the pseudonym "Student," hence the name Student's t-test.

The core idea is to take the observed difference in means and ask: if the null hypothesis (no real difference) were true, how likely is it to observe a difference this large or larger just by chance? This probability is the p-value. A small p-value gives evidence against the null hypothesis.

The three types of t-test

  • Independent samples (Welch's): Tests whether the means of two independent groups differ. "Independent" means the individuals in Group A are different people (or observations) from those in Group B. This calculator uses Welch's variant, which does not assume equal variances and is more robust than the classic Student's t-test.
  • Paired samples: Tests whether the mean difference between paired observations is zero. Pairs might be before-and-after measurements on the same subjects, or matched controls. The test is equivalent to a one-sample test on the differences.
  • One-sample: Tests whether a sample mean equals a hypothesised population mean (mu-zero). Useful when you know the theoretical or historical value you want to compare against.

The t-statistic formula

For the independent samples case (Welch's), the t-statistic is:

t = (x1_bar - x2_bar) / sqrt(s1^2/n1 + s2^2/n2)

where x-bar is the sample mean, s is the sample standard deviation, and n is the sample size. The denominator is the standard error of the difference between means.

For the one-sample and paired tests:

t = (x_bar - mu0) / (s / sqrt(n))

where mu0 is the hypothesised mean (or zero for the paired test, which operates on the differences).

Degrees of freedom

Degrees of freedom (df) determine the shape of the t-distribution used to compute the p-value. For the one-sample and paired tests, df = n - 1. For Welch's independent test, the degrees of freedom are approximated using the Welch-Satterthwaite formula:

df = (s1^2/n1 + s2^2/n2)^2 / ((s1^2/n1)^2/(n1-1) + (s2^2/n2)^2/(n2-1))

This formula produces a non-integer result in most cases, which is why you often see df values like 14.3 or 22.7. The non-integer df is perfectly valid and is standard practice for Welch's test.

The p-value and how to interpret it

The p-value is the probability of observing a t-statistic at least as extreme as the one calculated, assuming the null hypothesis is true. It is computed by integrating the t-distribution from |t| to infinity.

  • Two-tailed p-value: Tests for a difference in either direction. This is the default and most common choice. p = P(|T| > |t|) = 2 x P(T > |t|).
  • One-tailed p-value: Tests for a difference in a specific direction (one group being higher or lower). Use only when you have a strong directional hypothesis before seeing the data. p = P(T > |t|) for the observed direction.

The null hypothesis is rejected when p is less than the significance level alpha (commonly 0.05). A rejected null hypothesis does not prove the alternative is true: it means the data are inconsistent with the null at the chosen significance threshold.

Significance level (alpha)

Alpha (0.01, 0.05, or 0.10) is the probability of incorrectly rejecting a true null hypothesis (a Type I error). Choosing alpha = 0.05 means you accept a 5% chance of a false positive across many repeated tests under a true null. Lower alpha (0.01) is more conservative and reduces false positives at the cost of more false negatives.

What the t-test does not tell you

  • Effect size. A statistically significant result may reflect a trivially small difference when samples are large. Always pair the p-value with a measure of effect size such as Cohen's d or a confidence interval for the mean difference.
  • Causation. The t-test tests for a statistical association, not a causal relationship. Confounders can produce significant results even when there is no causal link.
  • Practical significance. A difference can be statistically significant but too small to matter in practice.

Assumptions of the t-test

  • Normality: The data (or the differences, for paired) should be approximately normally distributed. The t-test is robust to moderate violations when n is large (central limit theorem), but very skewed data with small samples can be problematic.
  • Independence: Observations within each group should be independent of each other.
  • Scale data: The variable being tested should be continuous or interval-scale.

Disclaimer

This calculator uses the exact t-distribution p-value (via the regularised incomplete beta function). Results assume the data meet the t-test assumptions listed above. For violated assumptions, consider non-parametric alternatives such as the Mann-Whitney U test (independent) or the Wilcoxon signed-rank test (paired). Consult a statistician for critical research decisions.