Two-Sample T-Test Calculator - Welch, Student and Paired

    Compare two means with Welch's, Student's or the paired t-test. Every result shows the test you did not pick next to yours, plus the interval, Cohen's d, Hedges' g and the group size for 80% power.

    Parameters

    Enter data for calculations

    Only the boxes for your choice appear

    Decide it before you see the data

    Also sets the confidence level

    Form progress0 / 3 fields

    💡 Fill in all required fields to unlock the calculate button

    Two-sample t-test: Welch, Student or paired, with the other two shown alongside

    The same twenty numbers can give p = 0.0794 or p = 0.0028. The difference is not in the data but in the design: two unrelated groups, or the same ten people measured twice. This calculator runs Welch's test, Student's pooled test or the paired test, prints the result of the test you did not choose next to it, and adds the confidence interval for the difference, Cohen's d, Hedges' g and the group size needed for 80% power.

    One classic data set, three verdicts

    Student's own sleep data: extra hours of sleep for ten patients on two drugs. Group A: 0.7 -1.6 -0.2 -1.2 -0.1 3.4 3.7 0.8 0.0 2.0. Group B: 1.9 0.8 1.1 0.1 -0.1 4.4 5.5 1.6 4.6 3.4. The values match R's t.test to four decimals.

    0.0794
    Welch: t = -1.861, 17.78 degrees of freedom
    0.0792
    Student: t = -1.861, 18 degrees of freedom
    0.0028
    Paired: t = -4.062, 9 degrees of freedom
    0.795
    correlation between the two drugs

    The patients who slept longer on one drug slept longer on the other. Pairing removes that person-to-person spread: the standard error drops from 0.8491 to 0.389, and the 95% interval for the difference narrows from -3.3655 to 0.2055 into -2.4599 to -0.7001. The data were paired, so the paired verdict is the right one.

    From design to verdict in five choices

    1. Design - two independent groups of raw values, paired measurements (the same people or objects in both lists, in the same order), or the mean, SD and n of each group from a report.
    2. The values - separated by spaces, commas or new lines, a dot for decimals, no thousands separators. For paired data both lists must have the same length.
    3. Version of the test - Welch or Student, for independent groups only. Welch is the safer default; the result prints both anyway.
    4. Alternative hypothesis - two-sided, or one-sided with A greater or A less than B, decided before looking at the data.
    5. Significance level - 0.05, 0.01 or 0.10. Then read t, p, the interval, the effect sizes and the comparison row.

    Welch against Student, side by side

    Welch Student (pooled)
    Assumes equal variancesNoYes
    Standard error√(sA²/nA + sB²/nB)sp √(1/nA + 1/nB)
    Degrees of freedomWelch-Satterthwaite, often a fractionnA + nB - 2
    Equal groups, equal spreadPractically the same answerPractically the same answer
    Small group with the larger spreadKeeps the false-alarm rate near alphaToo many false alarms
    Where you meet itR t.test default, Excel T.TEST type 3Excel T.TEST type 2, many textbooks

    When the two disagree, the equal-variance assumption decides the verdict. Take 40 values with SD 1 against 8 values with SD 4 and means 10 and 11.6. Student says p = 0.0273, significant; Welch says p = 0.2971 on 7.18 degrees of freedom. The variances differ 16-fold, and the pooled SD is dominated by the large, quiet group, so Student understates the uncertainty of the small, noisy one. The calculator flags both the ratio and the split decision.

    A report with only means and SDs

    Two teaching methods: 32 students average 78.4 (SD 9.2), 29 average 72.9 (SD 11.8). Welch gives t = 2.016, p = 0.0489, 95% interval 0.0264 to 10.9736 points, d = 0.52. Significant, but only just: the interval nearly touches zero, and a replication with the same effect would need about 59 students per group for an 80% chance of significance.

    Group sizes for 80% power

    Independent groups need far more observations than pairs for the same d, because pairing cancels the spread between subjects. Per group, alpha 0.05, from the noncentral t distribution:

    Effect size d Two groups, two-sided Two groups, one-sided Pairs, two-sided
    0.2394310199
    0.5645134
    0.8262115
    1.0171410

    For pairs, d means dz: the mean difference divided by the SD of the differences. It is not the same number as d between groups, so compare the columns only through the design, not through the label.

    Two-sample t-test questions

    Should I test for equal variances first?
    Many methodologists advise against it. A preliminary F or Levene test has little power in small groups, and choosing the t-test based on it distorts the error rate. Use Welch from the start: with equal variances and equal groups it gives almost the same p as Student, as the sleep data show (0.0794 against 0.0792).
    Why are the Welch degrees of freedom not a whole number?
    The Welch-Satterthwaite formula estimates how many degrees of freedom a t distribution needs to match the uncertainty of two separate variances. The answer lies between the smaller group size minus one and nA + nB - 2, and is rarely an integer: 17.78 for the sleep data, 7.18 in the 40 against 8 example.
    What does Excel T.TEST return?
    Only the p-value. Type 1 is paired, type 2 is Student, type 3 is Welch, and tails 2 means two-sided. You get no t, no degrees of freedom, no interval and no effect size, which is what the table and tiles here add.
    When is a rank test the better choice?
    With small groups and a clear outlier or strong skew. The sleep differences have a skewness of -1.75, and the calculator suggests a signed-rank test on them. For independent groups the equivalent is the Wilcoxon rank-sum (Mann-Whitney) test.

    Related tools

    P-Value Calculator

    The exact p for a t with fractional Welch degrees of freedom, and critical values for z, t, chi-square and F - See calculator

    One-Sample T-Test Calculator

    One sample against a fixed number: a label, a target or a norm - See calculator

    Wilcoxon Test Calculator

    Rank-sum and signed-rank tests when the data are skewed or small - See calculator

    Fisher Exact Test Calculator

    Two groups compared on a yes-or-no outcome instead of a measurement - See calculator

    Z-Score Calculator

    Screen each group for outliers before comparing the means - See calculator

    Standard Deviation Calculator

    The SD of each group, for the summary mode - See calculator

    Coefficient of Variation Calculator

    Compare the relative spread of the two groups - See calculator

    Similar calculators from this section