T-Test Calculator

The one-sample t-test calculator compares a sample mean to a hypothesized population mean. Enter your sample data (comma-separated values), the hypothesized mean, and significance level. The calculator computes the sample mean, sample standard deviation, t-statistic, degrees of freedom, p-value, and conclusion (reject or fail to reject the null hypothesis). The formula for the t-statistic is t = (x_bar - mu_0) / (s / sqrt(n)), where x_bar is the sample mean, mu_0 is the hypothesized mean, s is the sample standard deviation, and n is the sample size.

e.g., 50,52,49,51,50
Value to test against
Usually 0.05
50.60
1.43
1.33
9
0.2154
Fail to reject

Formula

t = (x_bar - μ⊂0) / (s / √n)
df = n - 1
x_bar = Sum(x_i) / n
s = √(Sum((x_i - x_bar)²) / (n - 1))

T-test calculator: frequently asked questions

What is a one-sample t-test?

A one-sample t-test compares a sample mean to a hypothesized population mean. The test statistic is t = (x_bar - mu_0) / (s / sqrt(n)), where x_bar is the sample mean, mu_0 is the hypothesized mean, s is the sample standard deviation, and n is the sample size.

What are degrees of freedom?

Degrees of freedom (df) is n - 1, where n is the sample size. It represents the number of independent pieces of information available for estimation after accounting for constraints.

What does the p-value tell me?

The p-value is the probability of observing a sample mean this far from the hypothesized mean (or farther) if the null hypothesis is true. Small p-values (usually less than 0.05) suggest the sample mean differs significantly from the hypothesized value.

When should I use a t-test instead of a z-test?

Use a t-test when the population standard deviation is unknown and the sample size is small (less than 30). For large samples or when population standard deviation is known, a z-test is appropriate.

What does it mean to fail to reject the null hypothesis?

It means the data does not provide sufficient evidence against the null hypothesis. This does not prove the null hypothesis is true, only that the evidence is insufficient to reject it.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 14 June 2026. See our methodology.