One-Sample t-Test Calculator

Quick answer

The one-sample t-test calculator tests whether a sample mean differs from a hypothesised value. It gives the t statistic, degrees of freedom and two-tailed p-value.

t statistic
—
Degrees of freedom
—
Two-tailed p-value
—

The t-test is the standard way to compare a mean with a target when the population standard deviation is unknown.

How to use the One-Sample t-Test Calculator

  1. Sample mean
  2. Hypothesised mean (μ₀)
  3. Sample standard deviation
  4. Sample size

Results update as you type, and every field accepts the units shown in its menu.

How it works

Divide the difference between the sample mean and the hypothesised mean by the standard error, then use the t distribution.

Inputs explained

Field What to enter
Sample mean A number
Hypothesised mean (μ₀) A number
Sample standard deviation A number
Sample size A number

What each result means

  • t statistic = ([Sample mean] – [Hypothesised mean (μ₀)])÷([Sample standard deviation]÷sqrt([Sample size]))
  • Degrees of freedom = [Sample size] – 1
  • Two-tailed p-value = 2×(1 – tcdf(abs([t statistic]), [Degrees of freedom]))

Example values

How the main result changes when Sample mean changes and everything else stays at the example values above:

Sample mean Two-tailed p-value
26.15 0
39.22 1.3893e-10
52.3 0.0479
65.38 2.7978e-14
78.45 0
104.6 0

Formula

t = (x̄ − μ₀) ÷ (s ÷ √n)df = n − 1

Worked example

Inputs — Sample mean: 52.3; Hypothesised mean (μ₀): 50; Sample standard deviation: 6.1; Sample size: 30.
Results — t statistic = 2.0652; Degrees of freedom = 29; Two-tailed p-value = 0.04795.

Frequently asked questions

Does a small p-value prove my hypothesis?

No; it means the data would be unlikely if the null hypothesis were true.

What are the assumptions?

Independent observations and roughly normal data, especially for small samples.

What formula does the One-Sample t-Test Calculator use?

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

Sources

  1. NIST/SEMATECH e-Handbook of Statistical Methods

Cite this calculator

Speedy Calculator. (2026). One-Sample t-Test Calculator. Speedy Calculator. https://speedycalculator.com/calculators/statistics/t-test/