T Test Calculator

Compare means with a one-sample, paired or independent-samples t test (Student's or Welch's), using raw data or just means, SDs and sample sizes. You get t, df, p, the mean difference with a 95% confidence interval, Cohen's d and an APA 7 sentence.

Results
StatisticValue
t4.09
df4.59
p-value0.011
Mean difference0.90
95% CI[0.32, 1.48]
Cohen's d2.57

APA report

t(4.59) = 4.09, p = .011, d = 2.57

Have full study data?

Upload your dataset and generate a complete paper draft with statistics, figures, and references—free preview.

Generate paper

How to use the t test calculator

1. **Choose the test type:** - **One-sample:** compare one group's mean with a known or hypothesised value (e.g. a scale midpoint of 3). - **Paired:** compare two measurements on the same participants (pre/post, left/right). - **Independent:** compare two separate groups (treatment vs control). 2. **Enter your data.** Paste raw values (one per line, or a column from Excel/CSV), or switch to **summary statistics** and type each group's mean, standard deviation and n. 3. For independent samples, choose **Welch** (does not assume equal variances) or **Student** (assumes equal variances). 4. Choose a two-tailed or one-tailed test. 5. Read t, df, p, the mean difference with its 95% CI and Cohen's d, then copy the APA 7 sentence.

All calculations run in your browser; your data are never uploaded.

What a t test is and when to use it

A t test checks whether a difference in means is larger than you would expect from sampling variability alone. The t statistic is the observed difference divided by its standard error, and it follows a t distribution with a given number of degrees of freedom.

Use a t test when your outcome is **continuous** (scores, times, blood pressure) and you are comparing **one or two** means. For three or more groups use the [ANOVA calculator](/tools/anova-calculator); for categorical outcomes use the [chi square calculator](/tools/chi-square-calculator); for skewed data with small samples, consider the [Mann-Whitney U test calculator](/tools/mann-whitney-u-test-calculator).

**Student or Welch?** Welch's t test does not require equal group variances and performs well even when variances happen to be equal, which is why many statisticians recommend it as the default for independent groups. Student's test is still common in textbooks and older papers.

Assumptions

  • **Continuous outcome** measured on an interval or ratio scale.
  • **Independence:** observations within a group are independent (and, for the independent test, the two groups are separate people). In a paired test, it is the pairs that must be independent.
  • **Approximate normality** of the data in each group (or of the differences, for a paired test). With moderate sample sizes the t test is fairly robust; check a histogram or Q-Q plot for strong skew or outliers.
  • **Equal variances** for Student's independent test only. If unsure, use Welch.

Formulas

  • **One-sample:** `t = (x̄ − μ0) / (s / √n)`, `df = n − 1`.
  • **Paired:** compute differences d = x1 − x2, then `t = d̄ / (s_d / √n)`, `df = n − 1`.
  • **Independent, Student:** pooled SD `sp = √( ((n1 − 1)s1² + (n2 − 1)s2²) / (n1 + n2 − 2) )`, `t = (x̄1 − x̄2) / (sp × √(1/n1 + 1/n2))`, `df = n1 + n2 − 2`.
  • **Independent, Welch:** `t = (x̄1 − x̄2) / √(s1²/n1 + s2²/n2)`, with the Welch–Satterthwaite df `df = (s1²/n1 + s2²/n2)² / ( (s1²/n1)²/(n1 − 1) + (s2²/n2)²/(n2 − 1) )`.
  • **95% CI for the difference:** `difference ± t_crit × SE`.
  • **Cohen's d** (independent): `d = (x̄1 − x̄2) / sp`. Rough benchmarks: 0.2 small, 0.5 medium, 0.8 large.

Worked example

Exam scores for students taught with a new method (A) and the standard method (B):

  • A: 78, 85, 72, 90, 81, 76, 88, 84 → mean = 81.75, SD = 6.16, n = 8
  • B: 70, 74, 68, 80, 72, 75, 66, 71 → mean = 72.00, SD = 4.38, n = 8

**Student's t test:** pooled SD = 5.34, SE = 2.67, so t = 9.75 / 2.67 = **3.65**, df = 14, two-tailed **p = .003**. Mean difference = 9.75, 95% CI [4.02, 15.48]. Cohen's d = 9.75 / 5.34 = **1.83**.

**Welch's t test:** t = 3.65, df = 12.63, p = .003, 95% CI [3.96, 15.54]. The two versions agree closely here because the group sizes are equal and the SDs are not very different.

The CI does not include 0, which matches the significant p value.

How to interpret and report a t test in APA 7

If p < .05, the means differ more than chance would usually produce. The 95% CI shows the plausible range for the true difference, and Cohen's d shows its size in standard-deviation units; a d of 1.83 is a very large effect, but with only 8 students per group the CI is wide.

APA 7 asks for means and SDs, t with df, the exact p, and an effect size:

> Students taught with the new method scored higher (*M* = 81.75, *SD* = 6.16) than students taught with the standard method (*M* = 72.00, *SD* = 4.38), *t*(14) = 3.65, *p* = .003, *d* = 1.83, 95% CI [4.02, 15.48].

For Welch's test, report the fractional df: *t*(12.63) = 3.65.

If you have the full dataset and need the whole manuscript, Data2Paper's [Generate Paper](/generate-paper) can run the analyses and draft the paper with methods, results, tables and figures, with a free preview of the first part.

Common mistakes

  • **Using an independent test on paired data** (or vice versa). Pre/post scores from the same people need a paired test.
  • **Running several t tests instead of ANOVA** when you have three or more groups, which inflates the false-positive rate.
  • **Reporting only p.** Include the means, SDs, CI and effect size.
  • **Wrong df.** Paired and one-sample use n − 1; Student's independent uses n1 + n2 − 2.
  • **Choosing one-tailed after seeing the data** to push p below .05.
  • **Ignoring outliers** that drive the whole difference.

Already have a t value and df? The [p value calculator](/tools/p-value-calculator) converts it directly.

FAQ

Related calculators