CalculatorForEver
MATH / CALCULATOR

T Test Calculator

Calculate t test with explicit statistical conventions, probability limits and worked results.

The one-sample statistic is t = (sample mean − null mean)/(sample SD/√n), with n − 1 degrees of freedom. Welch’s statistic divides the difference of two independent sample means by √(s₁²/n₁ + s₂²/n₂) and uses estimated Welch–Satterthwaite degrees of freedom.

Your numbers

BROWSER-LOCAL INPUTS

Your inputs stay in this browser. No account needed.

RESULT

Your result

Enter your values and select Calculate.

Check the units and assumptions before using this result.

METHOD

How the t test calculator works

How to use this calculator

Enter observations or distribution parameters in the stated units. Calculate, then read the method and assumptions before drawing a statistical conclusion.

What the result means

A t-test compares an observed mean with a null value while estimating variability from sample data. Calculator ForEver supports a one-sample test and a two-sample Welch test for independent groups. It reports the t statistic, degrees of freedom and two-sided p-value. These calculations need numerical observations and an appropriate sampling design; they cannot determine whether groups are independent or whether an analysis was selected after examining the results.

The formula

One sample: t = (mean−μ₀)/(s/√n); Welch uses separate sample variances

A worked example

For 1,2,3,4,5 tested against mean 3, t=0 and two-sided p=1.

Assumptions & methodology

A numerical summary does not establish sampling validity, practical importance or causation. Check the model and input assumptions before interpreting a probability. Results are rounded for display; intermediate calculations retain precision. This tool is informational and does not replace institutional or professional guidance.

References

NIST: two-sample t-test and Welch degrees of freedom · NIST: confidence limits and one-sample mean tests

WORK THROUGH THE DETAILS

Using your t test result

Check a one-sample example by hand

For observations 8, 9, 10, 11 and 12, the sample mean is 10. The squared deviations sum to 10, giving sample variance 10/4 = 2.5 and sample SD approximately 1.58114. Comparing with a null mean of 9 gives standard error √(2.5/5) approximately 0.707107. The statistic is t approximately 1.414214 with four degrees of freedom. The two-sided p-value is approximately 0.2302. Using a population SD denominator n instead of n − 1 would change the sample-variance estimate and the test.

Understand Welch’s noninteger degrees of freedom

Welch’s method estimates uncertainty using each group’s sample variance and sample size separately. Its degrees of freedom can be fractional; rounding that value to an integer before evaluating the reference distribution changes the calculation. Unequal sample sizes do not require an equal-variance assumption. Both groups still need an appropriate independent-sample interpretation. Severe skew, influential observations or a small sample can make the usual mean-based inference unsuitable and deserve examination outside this calculator.

Inspect zero variability and sampling limits

A constant sample has zero sample SD. If the null difference is also zero, the standard formula becomes 0/0 rather than an ordinary t statistic. If a nonzero difference has zero standard error, treating it as routine evidence conceals a degenerate input. Review the observations and model instead of inserting an artificial tiny variance. The tool also does not adjust for clustering, survey weights, repeated measures, missing-data mechanisms or multiple comparisons. Preserve the raw values and the chosen null comparison when documenting the result.

Check a symmetric Welch comparison

Consider independent groups 1, 2, 3 and 2, 3, 4. Their means are two and three, and both sample variances are one. The Welch standard error is √(1/3 + 1/3), approximately 0.816497. Subtracting the second mean from the first gives t approximately −1.224745, with four estimated degrees of freedom. The two-sided p-value is approximately 0.2879. Reversing the group lists gives the positive statistic with the same p-value. This example has equal observed variances, but Welch’s calculation still uses the group-specific terms instead of assuming population variances are equal.

INTERPRETATION

Understanding t test results

Choose one sample or independent Welch samples

Use one sample when comparing one population mean with a stated reference. Use Welch mode for two independent groups without imposing a common population variance. A before-and-after measurement on the same people creates paired observations and requires a paired analysis, which is outside this form. Entering those pairs as independent groups discards their pairing and can produce an unsuitable standard error even when the numerical calculation completes.

Separate the direction and size of the mean difference

A positive one-sample t statistic means the sample mean exceeds the entered null mean. In Welch mode, the sign follows the first mean minus the second. A two-sided p-value measures departures in either direction, so reversing the two group labels reverses t but leaves that p-value unchanged. Report the mean difference in its original units alongside the standardized statistic; the p-value alone does not describe the practical size of the difference.

RELATED GUIDES

Related questions and worked examples

Read a worked explanation before trying another calculation.

QUESTIONS

T Test questions

Does Welch’s test require equal sample sizes?+

No. It uses each group’s own sample count and variance. The groups still need an independent-sample design appropriate for the stated comparison.

Is a paired t-test included?+

No. This form supports one-sample and independent two-sample Welch calculations. Before-and-after pairs require their paired differences to be analyzed with the correct design.