One-Sample t Test

A one-sample t test compares a sample mean to a hypothesized population mean when the population standard deviation is unknown.

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

Solve a problem with One-Sample t Test

Type the problem. The solver will use One-Sample t Test where One-Sample t Test is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What One-Sample t Test takes
tt
xˉ\bar{x}
μ0\mu_0
ss
nn
One-Sample t Test
SymbolMeaning
ttThe test statistic that you calculate; compare its absolute value to a critical value from a t-table to decide whether to reject the null hypothesis.
xˉ\bar{x}The sample mean, calculated as the sum of all observations divided by n, measured in the same units as the original data.
μ0\mu_0The hypothesized population mean you are testing against, specified in the null hypothesis and written in the same units as the data.
ssThe sample standard deviation measuring the spread of observations around the sample mean; using it instead of population σ\sigma is why the t-distribution is needed.
nnThe sample size, or number of observations; larger samples yield smaller standard errors and more stable estimates of the population mean.

When to use it

Use this when you have a single sample and want to test whether its mean differs from a claimed or hypothesized population value.

Level

Usually taught in: Statistics · Appears on: AP Statistics

Worked examples

1. Testing resting heart rate against a claimed value

Problem

An athlete's coach claims the athlete's resting heart rate is 60 bpm. Over 5 days, measurements are 58, 62, 61, 59, and 65 bpm. Calculate the t-statistic to test whether the true mean rate is 60.
  1. xˉ=58+62+61+59+655=3055=61\bar{x} = \frac{58 + 62 + 61 + 59 + 65}{5} = \frac{305}{5} = 61

    Sum all five measurements and divide by n=5n = 5 to find the sample mean.

  2. s=(3)2+12+02+(2)2+4251=3042.738s = \sqrt{\frac{(-3)^2 + 1^2 + 0^2 + (-2)^2 + 4^2}{5-1}} = \sqrt{\frac{30}{4}} \approx 2.738

    Find each value's deviation from the mean (-3, 1, 0, -2, 4), square them, sum to 30, divide by n1=4n - 1 = 4, then take the square root.

  3. sn=2.73851.225\frac{s}{\sqrt{n}} = \frac{2.738}{\sqrt{5}} \approx 1.225

    Divide the sample standard deviation by n\sqrt{n} to get the standard error, which scales variability by sample size.

  4. t=61601.2250.816t = \frac{61 - 60}{1.225} \approx 0.816

    Subtract the hypothesized mean μ0=60\mu_0 = 60 from the sample mean and divide by the standard error to get the test statistic.

Answer: t0.816t \approx 0.816

We use a t-test here because we have a small sample (n=5) and know only the sample standard deviation, not the population value. The positive t-value shows the sample mean is slightly above the hypothesized 60 bpm, scaled by the variability in our measurements.

2. Testing mean session time on a website

Problem

A website claims users spend an average of 5 minutes per session. Seven randomly selected sessions are timed: 4.2, 5.8, 4.9, 6.1, 4.5, 5.3, and 4.8 minutes. Calculate t.
  1. xˉ=4.2+5.8+4.9+6.1+4.5+5.3+4.87=35.675.086\bar{x} = \frac{4.2 + 5.8 + 4.9 + 6.1 + 4.5 + 5.3 + 4.8}{7} = \frac{35.6}{7} \approx 5.086

    Add all seven measurements and divide by n=7n = 7; decimal precision matters here.

  2. s=0.785+0.510+0.035+1.028+0.343+0.046+0.08260.4720.687s = \sqrt{\frac{0.785 + 0.510 + 0.035 + 1.028 + 0.343 + 0.046 + 0.082}{6}} \approx \sqrt{0.472} \approx 0.687

    The squared deviations (from 5.086) sum to approximately 2.829; divide by n1=6n - 1 = 6 and take the square root for the standard deviation.

  3. sn=0.68770.6872.6460.260\frac{s}{\sqrt{n}} = \frac{0.687}{\sqrt{7}} \approx \frac{0.687}{2.646} \approx 0.260

    Standard error accounts for the fact that a sample of 7 gives us a more precise estimate of the population mean than a single observation would.

  4. t=5.08650.2600.331t = \frac{5.086 - 5}{0.260} \approx 0.331

    The sample mean is only slightly above the hypothesized value and well within the observed variability, giving a small t-statistic.

Answer: t0.331t \approx 0.331

With decimal data and a medium sample size, we see that even though the sample mean (5.086) exceeds the claimed 5 minutes, the t-statistic is small because this difference is small relative to the variability seen in the sample.

3. Testing mean homework hours against a benchmark

Problem

A college claims its students spend an average of 8 hours per week on homework. A sample of 9 students reports: 7, 9, 8, 10, 6, 9, 7, 8, and 11 hours. Calculate the t-statistic to test this claim.
  1. xˉ=7+9+8+10+6+9+7+8+119=7598.333\bar{x} = \frac{7 + 9 + 8 + 10 + 6 + 9 + 7 + 8 + 11}{9} = \frac{75}{9} \approx 8.333

    Sum the nine values and divide by n=9n = 9 to get the sample mean, which is slightly above the claimed 8 hours.

  2. s=1.777+0.445+0.111+2.778+5.443+0.445+1.777+0.111+7.11282.51.581s = \sqrt{\frac{1.777 + 0.445 + 0.111 + 2.778 + 5.443 + 0.445 + 1.777 + 0.111 + 7.112}{8}} \approx \sqrt{2.5} \approx 1.581

    Square each deviation from 8.333, sum to approximately 20, divide by n1=8n - 1 = 8 to get variance 2.5, then take the square root.

  3. sn=1.5819=1.58130.527\frac{s}{\sqrt{n}} = \frac{1.581}{\sqrt{9}} = \frac{1.581}{3} \approx 0.527

    A sample of 9 provides good precision; note that 9=3\sqrt{9} = 3 simplifies this calculation.

  4. t=8.33380.5270.632t = \frac{8.333 - 8}{0.527} \approx 0.632

    The observed difference of 0.333 hours from the hypothesized mean 8 is scaled by the standard error to produce the test statistic.

Answer: t0.632t \approx 0.632

This word problem demonstrates how context shapes interpretation: students study slightly longer on average (8.33 hours), but with the variability seen in this sample, that difference is not strong evidence that all students truly differ from the claimed 8 hours. The t-statistic is small relative to its critical value.

Common mistakes

Where One-Sample t Test usually goes wrong
Answer came out wrong
Writing t=xˉμ0σ/nt = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}} using population standard deviation σ\sigma instead of sample ss.
Always use t=xˉμ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}} with the sample standard deviation computed from your data.
Omitting n\sqrt{n} and writing t=xˉμ0st = \frac{\bar{x} - \mu_0}{s}.
Always include n\sqrt{n} in the denominator: t=xˉμ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}.
Interpreting the test statistic as "the sample mean is far from μ0\mu_0" when in fact it measures standardized distance.
Compare the computed tt to the critical value for your degrees of freedom (n1n-1) and significance level; only then can you decide if the evidence supports rejecting the null hypothesis.
The mistakeWhy it is wrongThe fix
Writing t=xˉμ0σ/nt = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}} using population standard deviation σ\sigma instead of sample ss.The one-sample t-test formula requires the sample standard deviation ss because we do not know the population value σ\sigma; if σ\sigma were known, you would use a z-test instead.Always use t=xˉμ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}} with the sample standard deviation computed from your data.
Omitting n\sqrt{n} and writing t=xˉμ0st = \frac{\bar{x} - \mu_0}{s}.Forgetting to divide by n\sqrt{n} makes the standard error far too large, causing the test statistic to be artificially small and making real differences appear insignificant.Always include n\sqrt{n} in the denominator: t=xˉμ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}.
Interpreting the test statistic as "the sample mean is far from μ0\mu_0" when in fact it measures standardized distance.The sample mean will naturally differ from μ0\mu_0 by random chance; the t-statistic accounts for sample variability, so what matters is whether the difference is large *relative to* that variability.Compare the computed tt to the critical value for your degrees of freedom (n1n-1) and significance level; only then can you decide if the evidence supports rejecting the null hypothesis.

Tips and when to use something else

  • If the population standard deviation σ\sigma is known or n30n \geq 30, use a z-test instead; the t-test is specifically for unknown σ\sigma and smaller samples.
  • Degrees of freedom is always n1n - 1; this is what you use to find critical values or p-values in a t-table.
  • A negative t-value means the sample mean is below the hypothesized value; in a two-tailed test, only the absolute value t|t| matters when comparing to the critical value.
  • Statistical significance (a t-value large enough to reject the null) does not mean the effect is practically important; always consider whether the actual difference matters in context.

Frequently asked questions

What is the difference between a one-sample t-test and a z-test?
Use a z-test when the population standard deviation σ\sigma is known or when n30n \geq 30. Use a one-sample t-test when you have only the sample standard deviation ss and a small sample. The t-distribution has heavier tails than the normal distribution to account for extra uncertainty when estimating the population standard deviation from a sample.
Why does the formula use n1n - 1 instead of nn for calculating sample standard deviation?
The denominator n1n - 1 appears because calculating ss uses the sample mean xˉ\bar{x}, which consumes one "degree of freedom." You have only n1n - 1 independent pieces of information left after computing the mean. This adjustment (called Bessel's correction) makes ss an unbiased estimator of σ\sigma.
What does a negative t-value mean?
A negative t-value simply means the sample mean is below the hypothesized mean μ0\mu_0. A positive t-value means it is above. When deciding significance, use the absolute value t|t|, since what matters is distance from μ0\mu_0 in either direction (unless you are performing a one-tailed test, in which case direction matters).
How do I know if my computed t-value is significant?
Compare your t|t| to the critical value from a t-table using degrees of freedom df=n1df = n - 1 and your chosen significance level (typically α=0.05\alpha = 0.05 for two-tailed tests). If t|t| exceeds the critical value, reject the null hypothesis; otherwise, fail to reject it.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18