Skip to content
ENExplore Calculators

T-Test Calculator

Perform a one-sample or two-sample t-test with t statistic, degrees of freedom and p-value.

About T-Test Calculator

The t-test determines whether a sample mean (or the difference between two sample means) is statistically significantly different from a hypothesised value. This calculator uses Welch's t-test for two samples, which does not assume equal variances.

Formulas

One-sample t

t = (x̄ − μ₀) / (s / √n)

x̄
Sample mean
μ₀
Hypothesised mean
s
Sample SD
n
Sample size

Two-sample t (Welch)

t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)

x̄₁,x̄₂
Sample means
s₁²,s₂²
Sample variances
n₁,n₂
Sample sizes

Worked example

With the default values below, T-Test Calculator returns t Statistic of 3.0000. Change any input above and every figure here is recalculated in your browser.

Inputs used

Test typeone of One-sample (test mean vs μ₀), Two-sample (compare two means)
Two-sample (compare two means)
Sample 1 (comma separated)
5, 7, 9, 6, 8
Sample 2 (comma separated)
3, 5, 4, 6, 2
Hypothesised mean μ₀
5

Results

t Statistic
3.0000
P-value (two-tailed)
0.017072
Degrees of Freedom
8.00

Step by step

  1. 1Values used
  2. 2One-sample t
  3. 3Two-sample t (Welch)
  4. 4t Statistic= 3.0000
  5. 5P-value (two-tailed)= 0.017072
  6. 6Degrees of Freedom= 8.00

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

When should I use a one-sample vs two-sample t-test?

Use one-sample when testing if a single group's mean equals a known value. Use two-sample when comparing the means of two independent groups.

What is Welch's t-test?

Welch's t-test is a modification of the two-sample t-test that does not assume equal variances between the two groups, making it more generally applicable.

T-Test Calculator | Calcrivo