One-Sample T-Test Calculator

Test if mean differs from a value.

Enter at least 2 data values

Examples:

Enter sample data and hypothesized mean

What Is a One-Sample T-Test?

The one-sample t-test determines whether a sample mean differs significantly from a hypothesized population mean.

Question answered: "Is the true mean different from this specific value?"

Example: "Is the average test score different from the passing threshold of 70?"

The Hypotheses

Null hypothesis (H0H_0): μ=μ0\mu = \mu_0 (population mean equals hypothesized value)

Alternative hypothesis (H1H_1):

  • Two-tailed: μ≠μ0\mu \neq \mu_0 (mean is different)
  • Right-tailed: μ>μ0\mu > \mu_0 (mean is greater)
  • Left-tailed: μ<μ0\mu < \mu_0 (mean is less)

The Test Statistic

t=xˉ−μ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}

Where:

  • xˉ\bar{x} = sample mean
  • μ0\mu_0 = hypothesized population mean
  • ss = sample standard deviation
  • nn = sample size

The t-statistic follows a t-distribution with df=n−1df = n - 1.

Example Calculation

Scenario: Testing whether average daily steps differs from the recommended 10,000.

Data: 25 participants, mean = 8,450 steps, SD = 2,100 steps

Calculation:

t=8450−100002100/25=−1550420=−3.69t = \frac{8450 - 10000}{2100 / \sqrt{25}} = \frac{-1550}{420} = -3.69

P-value: For df=24df = 24 (two-tailed), p≈0.001p \approx 0.001

Conclusion: The sample mean is significantly below 10,000 steps (p<0.01p < 0.01).

Applications

Quality Control

"Does the production process hit the target weight?"

H0:μ=500gH_0: \mu = 500g

Sample: 30 products, mean = 497g, SD = 8g

Test whether mean differs from target.

Educational Assessment

"Do students perform differently from the national average?"

H0:μ=75H_0: \mu = 75 (national average)

Sample: Class mean = 81, SD = 12, n = 28

Health Research

"Is the average blood pressure in this population different from normal?"

H0:μ=120H_0: \mu = 120 mmHg

Sample: Mean = 128, SD = 15, n = 45

Process Monitoring

"Has the mean shifted from the established baseline?"

Compare current sample to historical standard.

Interpreting Results

P-Value Interpretation

P-ValueInterpretation
p < 0.01Strong evidence against Hâ‚€
p < 0.05Moderate evidence against Hâ‚€
p < 0.10Weak evidence against Hâ‚€
p ≥ 0.10Insufficient evidence against H₀

Confidence Interval Connection

A 95% CI that excludes μ0\mu_0 corresponds to p<0.05p < 0.05.

CI=xˉ±t∗×SECI = \bar{x} \pm t^* \times SE

If μ0\mu_0 is outside this interval, reject H0H_0.

One-Tailed vs. Two-Tailed

Two-tailed (default): Tests for difference in either direction. Use when either increase or decrease is interesting.

One-tailed: Tests for difference in a specific direction. Has more power but requires prior justification.

Two-tailed p-value = 2 × one-tailed p-value

Assumptions

Normality

The population should be approximately normally distributed, OR the sample should be large enough (n>30n > 30) for the Central Limit Theorem to apply.

Check with:

  • Histogram or QQ-plot
  • Skewness and kurtosis
  • Formal normality tests (Shapiro-Wilk)

Independence

Observations should be independent—one measurement shouldn't influence another.

Random Sampling

Sample should be randomly selected from the population of interest.

When to Use One-Sample T-Test

Appropriate:

  • Comparing sample mean to a known standard
  • Testing against theoretical value
  • Comparing to published norm
  • Process control against target

Not appropriate:

Effect Size: Cohen's d

Beyond significance, report effect size:

d=xˉ−μ0sd = \frac{\bar{x} - \mu_0}{s}

dInterpretation
0.2Small effect
0.5Medium effect
0.8Large effect

In the steps example: d=8450−100002100=−0.74d = \frac{8450 - 10000}{2100} = -0.74 (medium-large effect)

Historical Context

William Gosset (Student) developed the t-test in 1908 at Guinness Brewery.

The one-sample case was his original focus: testing whether batch quality met standards when sample sizes were small.

His work enabled rigorous inference with limited data—previously, large samples were required for valid conclusions.

Reporting Results

APA format:

"A one-sample t-test revealed that mean daily steps (M = 8,450, SD = 2,100) was significantly lower than the recommended 10,000 steps, t(24) = -3.69, p = .001, d = -0.74."

Always include:

  • Sample statistics (M, SD, n)
  • Test statistic and df
  • P-value
  • Effect size

Related Calculations

Summary

The one-sample t-test determines whether a sample mean significantly differs from a hypothesized value. The test statistic divides the difference (sample mean minus hypothesized mean) by the standard error, producing a t-value compared against the t-distribution. Assumptions include normality (or large n), independence, and random sampling. Always report effect sizes alongside p-values to communicate practical significance, and use confidence intervals to show the range of plausible population means.