One-Sample t-Test
Test a sample mean against a hypothesised value: t, degrees of freedom, a two-tailed p and a confidence interval.
What this page computes
Paste one number per line and type the mean you are testing against. The statistic is t = (x̄ − μ0)/(s/√n) with s from the n − 1 divisor, on n − 1 degrees of freedom. The page prints t, df and a two-tailed p from the incomplete beta function, states that the p is for the two-sided alternative, and adds the confidence interval at the alpha you chose plus a reject or do-not-reject line. Six significant figures throughout.
The t test assumes the values are independent and roughly normal; the page cannot check that and does not claim it. It refuses a constant column, where s is zero and t is undefined, and refuses a significance level outside 0 to 1.
The test runs in this tab: no data is uploaded, and the same column always prints the same t and p.
The page tests a column against a hypothesised mean μ: t = (x̄ − μ)/(s/√n) with s using the n − 1 divisor, n − 1 degrees of freedom and a two-tailed p. The eight values 2, 4, 4, 4, 5, 5, 7, 9 against μ = 4 give t = 1.32288, df = 7 and p = 0.227453, so at α = 0.05 the page does not reject the null. The confidence interval and the decision line are printed with the test, so the p-value is never the only number on the screen.
Test a column against a hypothesised mean. The p-value is two-tailed and the degrees of freedom are printed.
How to use it
Paste the sample with one value per line, then type the hypothesised mean and the significance level. A comma inside a line is refused, because this page reads a column. The significance level must be strictly between 0 and 1, and a column where every value is identical is refused because s is zero and t would divide by zero.
The tail, the degrees of freedom and the decision
The p-value is the two-sided tail of t with n − 1 degrees of freedom, testing H₁: μ ≠ the value you typed, and both the hypothesis and the tail are printed on the result line. The interval beside it is the same x̄ ± t*·s/√n the confidence interval page builds, so the test and the interval agree by construction. The decision line restates the comparison at your α instead of leaving you to compare p by eye.
What to Expect
Best for
- Testing one sample against a known or claimed mean
What this tool keeps
- Nothing leaves this tab: the arithmetic runs in the page you are reading, and a reload discards both the input and the result.
Sample output
t = 1.32288, df = 7, p = 0.227453 (two-tailed, H₁: μ ≠ 4) mean = 5, s = 2.13809, SE = 0.755929, n = 8 95% CI of the mean = 3.21251 … 6.78749 at α = 0.05: do not reject H₀ (p ≥ 0.05)
Frequently asked questions
Is the p-value one-tailed or two-tailed?
Two-tailed, testing H₁: μ ≠ the value you typed, with n − 1 degrees of freedom. Both the statistic and the degrees of freedom are printed on the result line.
How do I enter the sample?
One value per line. A line containing a comma is refused, and a column of identical values is refused because its standard deviation is zero.
Is my sample uploaded?
No. The test, the interval and the decision are all computed in this page, so nothing leaves the tab and a reload discards the input and the result.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.