Skip to content
Statculator
Hypothesis Tests

T-Test Calculator

Free Student t-test calculator for one-sample, pooled, Welch or paired tests from summary stats or raw data. Get t, df, the p-value, Cohen’s d and every step.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try

Not sure? Same subjects measured twice → paired. Two separate groups → Welch is the safe default.

Use two-tailed unless you predicted the direction before seeing the data.

Usually 0.05 or 0.01.

Data input
Sample 1
Sample 2

Results

t statistic
1.9629
Welch’s t-test
p-value
0.0554
Two-tailed, df = 48.72

Fail to reject H₀ at α = 0.05

p = 0.0554 > 0.05. At the 5% level there is not enough evidence that the two population means differ.

Mean difference, x̄₁ − x̄₂
1.6
Welch df
48.7199
Standard error
0.8151
Critical t (α = 0.05)
±2.0099
95% CI for μ₁ − μ₂
(-0.0383, 3.2383)
Cohen’s d (average-variance SD)
0.5417 (medium)
SD ratio, larger / smaller
1.1071
Pooled t-test p (for comparison)
0.0538
Sample 1: x̄₁, s₁, n₁
14.2, 3.1, 25
Sample 2: x̄₂, s₂, n₂
12.6, 2.8, 28

Interpretation: The sample means differ by 1.6, which is 1.9629 standard errors from zero on 48.72 degrees of freedom. A difference this size could easily arise by chance if the population means were equal.

t distribution curve with the shaded probability region, markers at t = 1.963t = 1.963-4-3-2-101234t distribution, df = 48.72
Shaded area: rejection region at the chosen α. Dashed line: your test statistic.

Step-by-step solution

  1. 1

    State the hypotheses

    This is a two-tailed test.

    H₀: μ₁ − μ₂ = 0
    H₁: μ₁ − μ₂ ≠ 0
  2. 2

    Choose the significance level

    α = 0.05
  3. 3

    Find each sample’s variance of the mean

    Welch’s test keeps the two variances separate instead of pooling them.

    s₁² / n₁ = 3.1² / 25 = 0.3844
    s₂² / n₂ = 2.8² / 28 = 0.28
  4. 4

    Find the standard error of the difference

    SE = √(s₁²/n₁ + s₂²/n₂) = √(0.3844 + 0.28) = 0.8151
  5. 5

    Calculate the test statistic

    t = (x̄₁ − x̄₂) / SE = (14.2 − 12.6) / 0.8151 = 1.9629
  6. 6

    Find the Welch–Satterthwaite degrees of freedom

    df = (s₁²/n₁ + s₂²/n₂)² / [ (s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1) ]
    df = (0.3844 + 0.28)² / [ 0.3844²/24 + 0.28²/27 ]
    df = 0.4414 / 0.0091 = 48.7199
  7. 7

    Find the p-value

    Use the t distribution with the Welch–Satterthwaite df = 48.7199. The df need not be a whole number; rounding it down (to 48) gives a slightly more conservative test.

    p = 2 × P(t ≥ |1.9629|) = 0.0554
  8. 8

    Find the critical value

    Critical value: ±2.0099
    Reject H₀ if |t| ≥ 2.0099
  9. 9

    Decision: fail to reject H₀

    At the 5% level there is not enough evidence that the two population means differ.

    p = 0.0554 > α = 0.05
  10. 10

    Effect size and confidence interval

    d = (x̄₁ − x̄₂) / √[(s₁² + s₂²)/2] = 1.6 / 2.9538 = 0.5417
    95% CI for μ₁ − μ₂ = 1.6 ± 2.0099 × 0.8151 = (-0.0383, 3.2383)

What is a T-Test Calculator?

A t-test (Student’s t-test) compares means when the population standard deviation is unknown. Use the one-sample test to compare one mean with a fixed value, the two-sample (pooled) or Welch’s test to compare two independent groups, and the paired test for before-and-after or matched data. Each one divides a difference by its standard error, t = difference / SE, and reads the p-value from the t distribution with the right degrees of freedom.

What the T-Test Calculator does

This free t test calculator runs all four common t-tests from one form, so it works as a Student t test calculator, a Welch calculator and a paired t-test calculator in one. Pick the test type, enter summary statistics (mean, standard deviation and sample size) or paste raw data, and it will calculate the t-statistic, the degrees of freedom, the p-value, the critical value and the reject or fail-to-reject decision. Every test also reports Cohen’s d and a 95% confidence interval for the difference, draws the t distribution with the rejection region shaded, and shows each step with your numbers.

Choosing the right t-test depends on the study design, not on the numbers. Ask two questions: how many groups are there, and are the observations in different groups linked? The table in the next section answers both. For proportions, more than two groups or non-normal data, the How to Choose the Right Statistical Test guide covers the alternatives.

How to use the T-Test Calculator

  1. Choose the Test type that matches your design. If you are unsure, use the decision table below: one group against a standard, two separate groups, or the same subjects measured twice.
  2. Select the alternative hypothesis (two-tailed, left-tailed or right-tailed) and the significance level α.
  3. Pick Summary statistics if you only have the mean, SD and n for each group, or Raw data to paste the values. A one-sample test also needs the hypothesized mean μ₀.
  4. Read t, df, the p-value and the decision, then open the step-by-step solution to see the standard error, the effect size and the confidence interval.

Which t-test should I use?

Match the test to how the data were collected. Start with the design question: are you comparing one group to a standard, two separate groups, or before-and-after data? Then check what you have: raw data points or summary numbers (mean and standard deviation). This calculator accepts either for every test. Check the assumptions near the end of the page before you rely on the p-value.

Choosing a t-test by study design
DesignTestExample
One sample vs a known valueOne-sample t-testAverage fill volume vs the 250 ml label
Two separate groups, similar SDsTwo-sample (pooled) t-testExam scores for two classes taught the same way
Two separate groups, SDs or sizes differWelch’s t-testDelivery times from two couriers
Same subjects measured twice, or matched pairsPaired t-testBlood pressure before and after treatment

Paired or independent? The most common t-test mistake

Data are paired when each value in one column belongs with one value in the other: the same person before and after, two measurements on the same item, or twins split between treatments. Data are independent when the two groups contain different subjects and the order of rows means nothing.

Using the wrong test changes the standard error, not just the label. A paired test removes the subject-to-subject variation, so on genuinely paired data it is usually far more sensitive. Running an independent test on paired data throws that away and can miss a real effect; running a paired test on unrelated groups invents a pairing and gives a meaningless p-value. If the two columns can have different lengths, the data are not paired. For matched data with a differences table and Cohen’s d_z, use the Paired t-Test Calculator; for two separate groups with Levene’s test, use the Independent Samples t-Test Calculator.

One-tailed vs two-tailed t-test

A two-tailed test asks whether the means differ in either direction and splits α across both tails. A one-tailed test asks only whether the mean is higher, or only whether it is lower, and puts all of α in one tail. When the sample falls in the predicted direction, the one-tailed p-value is half the two-tailed one.

With this calculator’s one-sample defaults (x̄ = 52.3, s = 6.4, n = 30, μ₀ = 50), t = 1.9684 with df = 29. The two-tailed p is 0.0586, which is not significant at α = 0.05, while the right-tailed p is 0.0293, which is. The right-tailed critical value is 1.6991 instead of ±2.0452. That is why the direction must be fixed before you see the data: switching to one tail afterwards doubles the real false-positive rate.

T-test formulas

All four tests share one structure, t = (observed − hypothesized) / standard error. They differ in how the standard error and the degrees of freedom are calculated.

One-sample
t = (x̄ − μ₀) / (s / √n), df = n − 1
Two-sample (pooled)
t = (x̄₁ − x̄₂) / [ sₚ √(1/n₁ + 1/n₂) ], df = n₁ + n₂ − 2
Welch
t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂), df from Welch–Satterthwaite
Paired
t = d̄ / (s_d / √n), df = n − 1 (n = pairs)
Effect size
d = difference / SD (s, sₚ, √[(s₁² + s₂²)/2] or s_d)
Formula symbols
SymbolMeaning
x̄, s, nsample mean, standard deviation and size
μ₀hypothesized mean
sₚpooled standard deviation, √{[(n₁ − 1)s₁² + (n₂ − 1)s₂²] / (n₁ + n₂ − 2)}
d̄, s_dmean and SD of the paired differences
dCohen’s d: the difference in standard-deviation units (d_z for paired data)

The p-value is the probability, if H₀ is true, of a t statistic at least as extreme as the one observed. Critical values come from the t-table or the T Critical Value Calculator.

Sources: NIST/SEMATECH e-Handbook, Two-Sample t-Test for Equal Means; NIST/SEMATECH e-Handbook, section 7.2.2 (one-sample test of a mean); Student (1908), The probable error of a mean, Biometrika 6(1); Welch (1947), The generalization of “Student’s” problem, Biometrika 34(1–2).

Worked example: two-sample t-test

Comparing two teams’ task times

Problem. Team 1 (n₁ = 25) finished a task in a mean of 14.2 minutes (s₁ = 3.1); team 2 (n₂ = 28) took 12.6 minutes (s₂ = 2.8). The teams are different people and the SDs are similar, so use the pooled two-sample t-test at α = 0.05. These are the calculator’s two-sample defaults; choose Two-sample t-test (pooled) to follow along.

  1. 01Hypotheses: H₀: μ₁ − μ₂ = 0, H₁: μ₁ − μ₂ ≠ 0.
  2. 02Pooled variance: sₚ² = [24(3.1²) + 27(2.8²)] / 51 = (230.64 + 211.68) / 51 = 8.6729, so sₚ = 2.9450.
  3. 03SE = 2.9450 × √(1/25 + 1/28) = 0.8103; t = (14.2 − 12.6) / 0.8103 = 1.9745 with df = 51.
  4. 04Two-tailed p-value ≈ 0.0538; the critical values are ±2.0076.
  5. 05Effect size: d = 1.6 / 2.9450 = 0.54 (medium). 95% CI for μ₁ − μ₂: 1.6 ± 2.0076 × 0.8103 = (−0.03, 3.23), which just includes 0.
  6. 06Welch’s test on the same numbers gives t = 1.9629, df = 48.72 and p ≈ 0.0554, the same conclusion.

Answer. p ≈ 0.054 is just above 0.05, so fail to reject H₀. The 1.6-minute difference is a medium effect but not statistically significant at the 5% level; a larger sample would be needed to pin it down.

How to interpret t-test results

To report a result, give the test, t with its degrees of freedom, p, the effect size and the interval, for example: “Welch’s t-test, t(48.72) = 1.96, p = .055, d = 0.54, 95% CI [−0.04, 3.24].”

  • t statistic: the observed difference measured in standard errors. A t of 2 means the difference is about twice its standard error; its sign shows the direction.
  • p-value: if p ≤ α, reject H₀ and conclude the means differ. If p > α, the data do not show a difference, which is not proof that the means are equal.
  • Critical value: the cut-off from the t distribution. |t| beyond it gives the same decision as p ≤ α.
  • Cohen’s d: the size of the difference in standard-deviation units, about 0.2 small, 0.5 medium and 0.8 large. A big sample can make a tiny, unimportant difference significant, so read d next to p.
  • 95% confidence interval: the plausible range for the true difference. If it excludes 0, the two-tailed test at α = 0.05 is significant.

Worked examples: one-sample and paired t-tests

One-sample. A sample of n = 30 has x̄ = 52.3 and s = 6.4. Test H₀: μ = 50 at α = 0.05 (these are the calculator’s one-sample defaults). SE = 6.4 / √30 = 1.1685, so t = (52.3 − 50) / 1.1685 = 1.9684 with df = 29. The two-tailed p = 0.0586 is above 0.05, so fail to reject H₀. Cohen’s d = 2.3 / 6.4 = 0.36 (small), and the 95% CI for μ, (49.91, 54.69), includes 50.

Paired. Fifteen subjects were measured before and after, with mean difference d̄ = 1.8 and s_d = 2.9 (the paired summary defaults). SE = 2.9 / √15 = 0.7488, so t = 1.8 / 0.7488 = 2.4039 with df = 14. The two-tailed p = 0.0306 is below 0.05 and |t| exceeds the critical value 2.1448, so reject H₀. Cohen’s d_z = 1.8 / 2.9 = 0.62 (medium), and the 95% CI for the mean change is (0.194, 3.406), which excludes 0.

T-tests in R, Excel, Python and the TI-84

All of these use the same formulas as this calculator, so t and the p-value should match to rounding.

  • R: t.test(x, mu = 50) for one sample; t.test(x, y) runs Welch by default, add var.equal = TRUE for the pooled test, or paired = TRUE for paired data.
  • Excel: =T.TEST(a, b, tails, type) returns the p-value, with type 1 for paired, 2 for pooled and 3 for Welch. It does not return t or df.
  • Python (SciPy): ttest_1samp, ttest_ind (pass equal_var=False for Welch) and ttest_rel for paired data, all in scipy.stats.
  • TI-84: STAT → TESTS → T-Test (one sample) or 2-SampTTest, where Pooled: Yes gives the pooled test and No gives Welch.

Common use cases

  • Comparing a sample mean with a target, specification or published norm (one-sample).
  • Comparing treatment and control groups in an experiment (two-sample or Welch).
  • Evaluating a change measured on the same people before and after an intervention (paired).
  • Checking A/B test results on continuous metrics such as order value or time on task.
  • Choosing between tests: the overview of types of statistical tests sets t-tests beside correlation, regression, chi-square and nonparametric tests.

Assumptions and limitations

  • Independent observations. Each value comes from a different subject or unit (for the paired test, each pair is independent of the other pairs). Repeated measurements of the same person in one group break this.
  • A numeric outcome. The variable is measured on an interval or ratio scale, such as time, weight or a test score. For yes/no outcomes, use the Two Proportion Z-Test Calculator.
  • Approximately normal data. The values in each group, or the paired differences, should be roughly normal. With about 30 or more per group, moderate skew is tolerated; with small samples, check a histogram or run the Shapiro–Wilk Test Calculator.
  • Equal variances, for the pooled test only. The pooled two-sample test assumes both populations have the same variance. Welch’s test drops this assumption, which is why it is the safer default for two independent groups. The Levene’s Test Calculator checks it.
  • For more than two groups, running many t-tests inflates the false-positive rate; use one-way ANOVA instead.
  • If σ is known, use the Z-Test Calculator. For proportions (percentages of yes/no outcomes), use the Two Proportion Z-Test Calculator or the Chi-Square Test of Independence Calculator.
  • For small, skewed samples or ordinal data, rank-based tests (Mann–Whitney for independent groups, Wilcoxon signed-rank for pairs) are more reliable.
  • A significant p-value says a difference is unlikely to be zero, not that it is large or important. Report the effect size and the confidence interval alongside it.

Frequently asked questions

What are the main types of t-test?

There are three main types: the one-sample t-test (one mean against a fixed value), the independent two-sample t-test (two separate groups, in pooled or Welch form) and the paired t-test (matched or repeated measurements). They all compute t = difference / standard error but use different standard errors and degrees of freedom.

How do you calculate a t-test?

Subtract the hypothesized value from the observed difference, divide by the standard error to get t, find the degrees of freedom, and read the p-value from the t distribution. For one sample, t = (x̄ − μ₀) / (s/√n) with df = n − 1. If p ≤ α, reject the null hypothesis. This calculator does each step and shows the working.

Can I run a t-test with only the mean and standard deviation?

Yes. Every t-test needs only the mean, standard deviation and sample size of each group (or the mean and SD of the differences for a paired test). Choose Summary statistics in the calculator and enter those values; raw data give the same result.

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

Use Welch’s t-test unless you have a good reason to believe the two population variances are equal. Welch’s test works whether or not the variances match, while the pooled test can give misleading p-values when variances and sample sizes both differ. When variances are equal, the two tests agree closely.

What does the t value mean?

The t value is the observed difference expressed in standard errors. A t of 2 means the difference is about twice its standard error. The larger |t| is, the less plausible H₀ becomes; the p-value turns t into a probability using the t distribution with the test’s degrees of freedom.

What is a significant t-test result?

A t-test is significant when its p-value is less than or equal to the chosen significance level α, usually 0.05. Equivalently, |t| is at least the critical value. Significance means the data are unlikely under H₀; it does not by itself mean the difference is large or important.

How large a sample do I need for a t-test?

There is no fixed minimum, but small samples only detect large effects and depend more on normality. Around 30 per group makes the test robust to moderate skew; the size needed to detect a specific effect comes from a power analysis based on the expected difference and SD.

Cite this page

Statculator. (2026, November 14). T-Test Calculator. Retrieved November 14, 2026, from https://statculator.com/hypothesis-tests/t-test-calculator/