T-Test Calculator

Figran

Paste two groups to get the p value, effect size and a graph with the significance bracket.

  • Welch, paired or Mann–Whitney
  • Effect size with 95% CI
  • Graph with p value bracket

Data

Design
Input

Test

Test
Options

Plot
Error bars
Bracket label
Color
Width
p = 0.0064

Welch t (14.97) = 3.17 · mean difference 5.25 (95% CI 1.72 to 8.78) · g = 1.36

051015202530Tooth lengthOJVCp = 0.0064

Descriptive statistics

GroupnMeanSDSEMMedianQ1–Q3Min–max
OJ1013.234.461.4112.259.70–16.188.20–21.50
VC107.982.750.877.155.95–10.904.20–11.50

Test results

t3.17
df14.97
pp = 0.0064
95% CI1.72 – 8.78
Hedges' g1.36 [0.39, 2.29]
p < α (0.05)Yes

Assumption checks

Shapiro–Wilk OJW = 0.89, p = 0.18
Shapiro–Wilk VCW = 0.89, p = 0.17
SD ratio (larger / smaller)1.62

Use these as a description, not as a gate for choosing the test.

Report

Results

OJ (M = 13.23, SD = 4.46, n = 10); VC (M = 7.98, SD = 2.75, n = 10). Welch t(14.97) = 3.17, p = .0064; mean difference = 5.25, 95% CI [1.72, 8.78], Hedges' g = 1.36, 95% CI [0.39, 2.29].

Methods

Groups were compared with Welch's t test (two-sided, α = 0.05).

T-test calculator examples

Explore real datasets and load one to try the calculator.

051015202530Tooth lengthOJVCp = 0.0064

Unpaired t test: vitamin C and tooth growth

Compare tooth length under two vitamin C supplements.

Source: R ToothGrowth (Crampton 1947) · 10 + 10 guinea pigs

−4−202468Extra sleep (hours)Drug 1Drug 2p = 0.0028

Paired t test example: two sleep drugs

Compare extra sleep after the same participants take two sleep drugs.

Source: R sleep (Student 1908) · 10 paired observations

050100150200250Ozone (ppb)MayAugustp < 0.0001

Mann–Whitney U test: skewed ozone levels

Compare the distributions of ozone in May and August.

Source: R airquality · 26 + 26 daily readings

01234ScoreVisit 1Visit 2p = 0.039

Wilcoxon signed-rank test: depression scores

Compare paired scores at two visits after treatment begins.

Source: Hollander & Wolfe 1973 · 9 paired observations

025050075010001250Speed (km/s − 299,000)Measurementsp < 0.0001

One-sample t test example: Michelson’s speed of light

Compare measurements with a reference value.

Source: R morley · 20 measurements

0100200300400500Weight (g)CaseinHorsebeanp < 0.0001

From mean, SD and n: chick weights by feed

Compare two groups from summary statistics.

Source: R chickwts · 12 + 10 chicks

0102030Insect countSpray ASpray C****

Bar graph with significance stars: insect sprays

Compare insect counts after two sprays.

Source: R InsectSprays · 12 + 12 observations

02468Dry weight (g)TreatmentControlp = 0.047

Student’s t test: plant dry weight

Compare treatment and control plant weights.

Source: R PlantGrowth · 10 + 10 plants

How to do a t test

Compare your data and make a figure in four steps.

  1. 1Choose a design

    Paste the values for each group.

  2. 2Choose a test

    Welch is the default for two independent groups.

  3. 3Read the results

    Review the p value, interval and effect size.

  4. 4Export your work

    Choose a graph style and download or copy the results.

Which t test should I use?

Choose a test that matches your design and data.

DesignData / assumptionsTestEffect sizePlot
Two groupsContinuous data; equal variances not assumedWelch t testgDots
Two groupsContinuous data; equal variances assumedStudent t testgDots
PairedPaired continuous differencesPaired t testdzPaired lines
One groupContinuous values versus a reference meanOne-sample t testdDots
Two groupsIndependent ordinal or non-normal dataMann–Whitney U (Wilcoxon rank-sum)rrbBox + dots
PairedPaired or one-sample differences; symmetric distributionWilcoxon signed-rankrrbPaired lines
One groupPaired or one-sample differences; symmetric distributionWilcoxon signed-rankrrbDots

Welch's t test by default

Welch’s test accommodates unequal variances and is a practical default for independent groups.

Normality and equal variances

Assumption checks describe the data; avoid using a preliminary normality test as an automatic gate for choosing a test.

References: Delacre et al. (2017) · Ruxton (2006) · Rochon et al. (2012)

T test formulas

These formulas connect the estimates with their uncertainty.

Welch t test

t=x̄1−x̄2v1+v2,vi=si2nidf=(v1+v2)2v12n1−1+v22n2−1

Student t test

sp2=(n1−1)s12+(n2−1)s22n1+n2−2t=x̄1−x̄2sp1/n1+1/n2

Paired t test / One-sample t test

tpaired=d̄sd/n,tone=x̄−μ0s/n

Hedges’ g

g=J(df)x̄1−x̄2sp

For the default example, (13.23 − 7.98) / √(4.46²/10 + 2.75²/10) ≈ 3.17.

Rank tests

U is the first group’s rank sum minus n₁(n₁ + 1)/2. The displayed V and effect size use ranks after removing zero differences. For exact p values, zeros are included in ranking and excluded from sign assignments, matching R 4.6; larger samples use a continuity-corrected normal approximation.

References: Student (1908) · Welch (1947) · Mann & Whitney (1947) · Wilcoxon (1945)

T-test calculator FAQ

Which t test should I use?

Use Welch for independent groups, a paired test for repeated measurements, and a one-sample test against a fixed value. For three or more groups, consider ANOVA. ANOVA calculator.

Should I use Welch’s or Student’s t test?

Welch is a useful default because it accommodates unequal variances while remaining effective when variances are similar. R uses Welch by default; GraphPad QuickCalcs also offers it.

What is the difference between paired and unpaired tests?

A paired test analyzes matched differences. Group summaries alone do not preserve the pairing.

When should I use Mann–Whitney or Wilcoxon?

Consider rank tests for ordered or markedly skewed data. They compare ranks and distributions rather than means. A log transform may be appropriate for fold-change data.

Do I need to test normality before a t test?

No; a preliminary normality test should not be an automatic gate for choosing a test. Avoid post-hoc power based on a nonsignificant p value; plan sample size before collecting data. Power analysis calculator.

One-tailed or two-tailed?

Use a two-sided test unless a direction was specified before collecting the data.

How do I report a t test result?

Report the group summaries, statistic, degrees of freedom, p value, confidence interval and effect size.

What do the asterisks on the graph mean?

One, two, three and four stars indicate p below 0.05, 0.01, 0.001 and 0.0001, respectively. State the thresholds and test in the legend. To add labels manually to an existing figure, use: Bar graph maker · Box plot maker.

Do the results match R, GraphPad Prism and Excel?

The t tests follow standard formulas used by R, Prism and Excel; Excel T.TEST types 1, 2 and 3 select paired, Student and Welch tests. Small-sample rank tests use the R 4.6 exact conditional distribution; SPSS and older R approximations may differ. For exact signed-rank p values, zero differences are included when ranking but excluded from the sign distribution, as in R. The displayed V and effect size use ranks after removing zeros, so R may display a different V. Data stay in your browser. For additional effect sizes, use: Effect size calculator.

Compare your two groups

Calculate a test and make a figure from your data.

Run a t test