Statistics & probability

One-sample t test

Compare a numeric sample mean with a supplied reference value.

One-sample t test
Esc to restore

Your inputs

Up to 50,000 values. No thousands separators. Absolute values up to 1 trillion; non-zero values must be at least 1e-100 in magnitude.

Results update as you type. Larger files run when you press Update result.

Your result

LOCAL & PRIVATE

Your result will appear here.

Your inputs stay in this browser. Nothing is uploaded or saved.

A clear answer. Here’s how.

t=(sample mean−reference)/(s/√n), with n−1 degrees of freedom and your chosen alternative. Requires at least two values and positive sample variability. Assumes independent observations and a suitable normal/large-sample model. Reports a numerical p-value; it does not measure effect importance or prove the null hypothesis.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Values, separated by commas or new lines
2, 4, 4, 4, 5, 5, 7, 9
Null-hypothesis mean
5
Alternative hypothesis
Different (two-sided)

Example result

Sample mean
5
Observations / pairs
8
t statistic
0
Degrees of freedom
7
p-value
1

A p-value is conditional on the stated null model and sampling assumptions; it is not the probability that the null hypothesis is true.