⚗️ T-Test Calculator

One-sample, two-sample or paired — paste data or type mean, SD and n. Get t, df, the p-value, the decision, a confidence interval and the effect size.

Google Classroom Save to Pinterest Email me

T-test formulas

Testt statisticDegrees of freedom
One-samplet = (x̄ − μ₀) ÷ (s ÷ √n)n − 1
Pairedt = d̄ ÷ (s_d ÷ √n), using the differencesn − 1 (pairs)
Two-sample, Welcht = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂)Welch–Satterthwaite (usually not a whole number)
Two-sample, pooledt = (x̄₁ − x̄₂) ÷ √(s_p²(1/n₁ + 1/n₂))n₁ + n₂ − 2

Worked examples (checked against R and SciPy)

Two-sample (Welch). Exam scores in two sections: A = 78, 85, 92, 70, 88, 81, 76, 90, 84, 79 and B = 72, 80, 68, 75, 83, 70, 77, 69, 74, 71. Means 82.3 and 73.9, SDs 6.82 and 4.91. SE = √(6.82²/10 + 4.91²/10) = 2.656, t = 8.4 ÷ 2.656 = 3.16, df = 16.36, two-tailed p = 0.0059 → significant at 0.05.

Paired. Quiz scores before and after tutoring for 8 students: before 62, 70, 55, 68, 74, 60, 66, 71; after 68, 74, 61, 70, 79, 63, 72, 75. Mean difference 4.5, SD of differences 1.51, t = 4.5 ÷ (1.51 ÷ √8) = 8.42, df = 7, p = 0.00007.

One-sample. 40 students sleep a mean of 6.8 hours (s = 1.2). Is that different from 7? t = (6.8 − 7) ÷ (1.2 ÷ √40) = −1.05, df = 39, two-tailed p = 0.298 → not significant.

Writing it up (APA style)

“Section A (M = 82.3, SD = 6.8) scored higher than section B (M = 73.9, SD = 4.9), Welch’s t(16.36) = 3.16, p = .006, d = 1.41.” The logic of H₀, H₁ and p-values is explained in the lesson Hypothesis tests and p-values. For an interval estimate instead of a test, use the confidence interval calculator.

Commands: Excel / Sheets =T.TEST(range1, range2, tails, type) (type 1 paired, 2 equal variance, 3 unequal); TI-84 STAT → TESTS → 2:T-Test, 4:2-SampTTest; R t.test(a, b).

Questions and answers

Which t-test should I use?

One-sample: one group compared with a fixed number (is the mean sleep 7 hours?). Two-sample (independent): two separate groups of different people (online vs. in-person sections). Paired: the same people measured twice, or matched pairs (before and after a tutoring program).

Welch or pooled (Student’s) two-sample t-test?

Use Welch’s test unless your instructor asks for the pooled version. Welch does not assume equal variances, works just as well when they are equal, and is the default in R and in many textbooks. The pooled test assumes both groups have the same population SD and uses df = n₁ + n₂ − 2.

How do I interpret the p-value?

If the null hypothesis were true, the p-value is the probability of getting a t statistic at least as extreme as yours. If p is below your significance level α (usually 0.05), reject H₀. A p-value is not the probability that H₀ is true, and a large p-value does not prove H₀.

One-tailed or two-tailed?

Use two-tailed unless you decided before seeing the data that only one direction matters (for example “the new method increases scores”). A one-tailed p-value is half the two-tailed one when the effect goes in the predicted direction.

What does Cohen’s d tell me?

Effect size: the difference in means measured in standard deviations. Rough guide: 0.2 small, 0.5 medium, 0.8 large. With a big sample even a tiny, unimportant difference can be significant, so report d along with p.

What are the conditions for a t-test?

Random sampling or random assignment, independent observations, and roughly normal data — or large samples (n ≥ 30 per group is a common rule), because of the central limit theorem. Check for strong skew and outliers in small samples.

More free tools for college students

📏 Standard deviation calculatorSample and population SD, variance, mean, median, quartiles — with every step.🔔 Z-score calculatorValue to z-score and percentile, z to probability, percentile to z — with the curve shaded.🎯 Confidence interval calculatorIntervals for a mean or a proportion, margin of error, and the sample size you need.📉 Linear regression calculatorLine of best fit, r and r², slope test and prediction, with a scatterplot.🎓 GPA calculatorSemester and cumulative GPA on a 4.0 or 4.3 scale, with credit hours and a target-GPA planner.📝 Final grade calculatorWhat you need on the final to get an A, B or C — and what each final score would leave you with.⚖️ Weighted grade calculatorYour course grade from syllabus weights, in percent or points, plus what you need on the rest.📊 Statistics calculatorsStandard deviation, z-score, t-test, confidence interval and regression — with the steps shown.🃏 Flashcard makerMake a deck, learn it with spaced repetition, quiz yourself, print it, share it by link.🍅 Pomodoro study roomOne link, one shared focus timer for your whole study group — everyone sees the same countdown.📅 Class schedule makerYour weekly classes as a printable timetable and a phone lock-screen wallpaper.🔢 Word & character counterWords, characters, sentences, reading and speaking time, page estimate and a word-limit bar.🗂️ Essay outline builderIntro, body paragraphs, counterargument and conclusion with a word budget — copy, print or share.🎯 Thesis statement generator & checkerTurn your topic and reasons into thesis statements, then check yours for weak spots.🗓️ Exam study plannerYour exams in, a day-by-day study plan for finals out.📊 Live class pollStudents answer from their phones with a code or QR; the results fill the projector live.📋 Rubric generatorCriteria × performance levels with weights and points, ready to print, share or save as PDF.📑 Syllabus template builderFill in your course and get a clean one-to-three-page syllabus with schedule, grading and policies.🪑 Exam seating chart makerSpread students across the room with spacing and alternating exam versions. Print one chart and a seat list.🔖 APA, MLA & Chicago citation generatorBooks, articles and websites, plus a works-cited list.