T-Test Calculator

This t-test calculator runs a one-sample, paired or two-sample t-test from raw data or from summary statistics. You get the t statistic, degrees of freedom, p-value, confidence interval, effect size and a ready-to-paste APA-style sentence.

Checks on your data

  • Group 1: with n = 8 this method assumes the data are roughly bell-shaped. That cannot be proven from so few points, so look at the histogram or box plot. Plot a histogram →
  • Group 2: with n = 8 this method assumes the data are roughly bell-shaped. That cannot be proven from so few points, so look at the histogram or box plot. Plot a histogram →
  • The group spreads are similar. Welch’s test is still valid and loses almost nothing compared with the pooled test.

Results

t statistic
-3.9219
p-value
0.0015341
two-tailed
Decision at α = 0.05
Reject H₀
statistically significant
Degrees of freedom
14
Standard error
0.761738
Critical t (±2.1448)
2.1448
95% CI for the mean
-4.62127 to -1.35373
Cohen's d (pooled SD)
-1.961
large effect
Hedges' g (small-sample corrected)
-1.854
Group 1 mean (SD, n)
24.8375 (1.52778, 8)
Group 2 mean (SD, n)
27.825 (1.51916, 8)
APA-style sentence
Welch’s t-test: t(14) = -3.92, p = .00153, d = -2, 95% CI [-4.62, -1.35].
t distribution (df = 14): shaded = rejection region, line = your t
-4-2024t = -3.92
Group means with 95% confidence intervals
Group 1: 23.56 to 26.11Group 2: 26.55 to 29.1242628
Show step-by-step solution
  1. Test: Welch’s t-test (unequal variances). H₀: μ₁ − μ₂ = 0.
  2. Standard error = 0.761738; difference being tested = -2.9875.
  3. t = -2.9875 ÷ 0.761738 = -3.9219 with 14 degrees of freedom.
  4. p-value (two) = 0.0015341; critical value = 2.1448.
  5. p < α, so we reject H₀ at α = 0.05.
ComparesOne or two means
Statistict = difference / SE
Default two-sampleWelch (no equal-variance assumption)
Reportsp, CI, Cohen’s d

What Is T-Test?

A t-test checks whether a mean differs from a target value or whether two means differ from each other when the population standard deviation is unknown and has to be estimated from the sample. It is the standard choice for small samples and for most real data.

Choose the test that matches your design: one-sample (one group against a value), paired (the same subjects measured twice) or two-sample. The two-sample test defaults to Welch's version, which does not assume equal variances, and the pooled equal-variance version is available too. The verdict beneath the results flags assumptions worth checking.

Below you will find the t-test formulas, a variables table, worked examples, assumptions and answers to common questions such as t-test versus z-test and when to use a paired test.

How to Use the T-Test Calculator

  1. Pick the test: two independent groups, paired measurements, or one sample against a known value.
  2. Choose raw data or summary statistics and enter your numbers.
  3. Set the alternative hypothesis (two-tailed unless you have a directional hypothesis fixed in advance) and the significance level.
  4. Read the decision, p-value, confidence interval and effect size. Use the chart to see where your t falls on the t distribution.
  5. Check the assumptions section below before reporting the result.

T-Test Formula

One-sample and paired t statistic

t=xˉ−μ0s/n,df=n−1t=\frac{\bar{x}-\mu_0}{s/\sqrt{n}},\quad df=n-1

For paired data, x̄ and s are the mean and SD of the differences.

Welch two-sample t statistic

t=xˉ1−xˉ2s12n1+s22n2t=\frac{\bar{x}_1-\bar{x}_2}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}

Welch–Satterthwaite degrees of freedom

df=(s12n1+s22n2)2(s12/n1)2n1−1+(s22/n2)2n2−1df=\frac{\left(\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}\right)^2}{\frac{(s_1^2/n_1)^2}{n_1-1}+\frac{(s_2^2/n_2)^2}{n_2-1}}

Pooled variance (equal-variance test)

sp2=(n1−1)s12+(n2−1)s22n1+n2−2,t=xˉ1−xˉ2sp1/n1+1/n2s_p^2=\frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2},\quad t=\frac{\bar x_1-\bar x_2}{s_p\sqrt{1/n_1+1/n_2}}

Cohen’s d

d=xˉ1−xˉ2spd=\frac{\bar x_1-\bar x_2}{s_p}

T-Test Variables Explained

SymbolMeaningNotes
tTest statisticDifference measured in standard errors
x̄, s, nSample mean, standard deviation and sizeFor each group
μ₀Hypothesised meanOne-sample test
dfDegrees of freedomn − 1, or Welch–Satterthwaite for two groups
SEStandard errorSpread of the estimated difference

T-Test Worked Example

Using the example values (press “Load example” above to try them):

  1. Test: Welch’s t-test (unequal variances). H₀: μ₁ − μ₂ = 0.
  2. Standard error = 0.761738; difference being tested = -2.9875.
  3. t = -2.9875 ÷ 0.761738 = -3.9219 with 14 degrees of freedom.
  4. p-value (two) = 0.0015341; critical value = 2.1448.
  5. p < α, so we reject H₀ at α = 0.05.

Result: t statistic = -3.9219; p-value = 0.0015341; Decision at α = 0.05 = Reject H₀.

Which t-test should I use?

If you are unsure whether the groups are independent or paired, ask: is each value in one group linked to a specific value in the other, such as the same person or matched pair? If yes, use the paired test.

Choosing the right t-test
Your dataTestWhy
Two separate groups of different subjectsTwo-sample (Welch)Independent observations; no equal-variance assumption
Same subjects measured twice (before / after)Paired t-testUses the within-subject differences and removes between-subject noise
One group compared with a target or standard valueOne-sample t-testTests whether the mean differs from a fixed number
Two groups and you are sure variances are equalPooled two-sampleSlightly more power; rarely worth the assumption
Three or more groupsANOVA, not repeated t-testsRepeated t-tests inflate the false-positive rate

How to interpret the results

The p-value is the probability of seeing a t statistic at least this extreme if the null hypothesis were true. It is not the probability that the null is true, and it does not measure the size of the effect. If p is below your chosen α, the data are inconsistent enough with the null hypothesis that you reject it.

Always read the confidence interval and effect size alongside the p-value. A very large sample can make a trivial difference significant, while a small sample can make a large difference non-significant. Cohen’s d expresses the difference in standard deviation units so you can judge practical importance.

Cohen’s d benchmarks (rules of thumb)
|d|LabelMeaning in practice
below 0.2NegligibleHard to see in practice
0.2 to 0.5SmallNoticeable on careful study
0.5 to 0.8MediumVisible to the naked eye
0.8 and aboveLargeObvious difference

Assumptions and what to do when they fail

  • Independence: each observation is independent of the others (except pairs in a paired test).
  • Scale: the outcome is measured on an interval or ratio scale.
  • Approximate normality: of the data (or of the differences for paired data). With n of 30 or more per group, the test is robust to moderate non-normality.
  • No extreme outliers: they distort both the mean and the SD. Check a plot of the data.
  • Equal variances (pooled test only): Welch’s test avoids this assumption.
  • If normality fails badly with small samples, consider the Mann-Whitney U test (independent) or Wilcoxon signed-rank test (paired).

How to report a t-test (APA style)

Report the test, degrees of freedom, t value, exact p-value, effect size and confidence interval. The calculator writes this sentence for you in the results list, in the format: t(df) = value, p = value, d = value, CI [low, high]. Add the group means and standard deviations in the text or a table.

Where T-Test Is Used

Comparing a mean with a target

Testing whether an average differs from a specification or published value.

Before and after studies

Using a paired t-test on the same people or items measured twice.

Comparing two groups

Checking whether two independent group means differ.

Reporting results

Copying a ready APA-style sentence with t, df, p and the effect size.

Common T-Test Mistakes to Avoid

  • Using an independent-samples test for paired data, which throws away the pairing and loses power.
  • Running many t-tests on the same data without correcting for multiple comparisons.
  • Choosing a one-tailed test after seeing which direction the data went.
  • Interpreting “not significant” as proof of no difference.
  • Ignoring unequal sample sizes and variances when using the pooled test.
  • Default to Welch’s test for two independent groups.
  • Decide one-tailed or two-tailed before collecting data.
  • Report an effect size and interval, not only the p-value.
  • For paired data, enter before and after in the same order.

T-Test Terms and Definitions

Degrees of freedom
The number of independent pieces of information, which determines the shape of the t distribution.
Standard error
The standard deviation of the sampling distribution of the difference in means.
Critical value
The t value beyond which you reject the null at your chosen α.
Effect size
A standardised measure of how large the difference is, independent of sample size.

T-Test FAQs

What is a t-test used for?

To compare means: either one sample against a known value, two independent groups against each other, or two measurements on the same subjects.

What is the difference between a t-test and a z-test?

A z-test uses a known population standard deviation; a t-test uses the sample standard deviation and the heavier-tailed t distribution. With large samples they give nearly the same result.

Should I use Welch’s t-test or the pooled t-test?

Welch’s test is the safer default, because it works whether or not the variances are equal. The pooled test gains only a little power when variances really are equal.

What does the p-value mean?

It is the probability of getting a result at least as extreme as yours if the null hypothesis were true. A small p-value is evidence against the null, not a probability that the null is false.

What sample size do I need for a t-test?

The test works with small samples if the data are close to normal. For skewed data aim for 30 or more per group. Use a power analysis to plan the size you need to detect a given effect.

When should I use a paired t-test?

When each observation in one group is naturally linked to one in the other, such as before-and-after measurements on the same people or matched pairs.

What is Cohen’s d?

A standardised effect size: the difference between means divided by the pooled standard deviation. Roughly 0.2 is small, 0.5 medium and 0.8 large.

Can I use a t-test with more than two groups?

No. Use ANOVA for three or more groups, then follow up with post-hoc comparisons if the overall test is significant.

What is the difference between Student's and Welch's t-test?

Student's two-sample test pools the variances and assumes they are equal. Welch's test does not assume equal variances and adjusts the degrees of freedom, which is why it is the default here.

What if my data are not normally distributed?

The t-test is fairly forgiving with moderate or large samples, but strong skew or outliers in small samples can mislead it. In that case consider a rank-based alternative such as the Mann-Whitney U or Wilcoxon test.

Related calculators

Last updated 2026-11-09. See our disclaimer.