Formula & Calculator

One-Sample t-Statistic

The one-sample t-statistic tests whether a sample mean is significantly different from a hypothesised population mean. It equals the difference between the sample mean and the hypothesised mean, divided by the standard error. For example, if a company claims its batteries last 10 hours and a sample of 30 batteries averages 9.5 hours, the t-statistic tells you whether that difference is statistically significant or just due to chance. It is widely used in quality control, science, and business.

Statistics Probability Hypothesis Testing
Here is a complete, runnable HTML document for a One-Sample t-Statistic Calculator. It solves t = (x̄ − μ₀)/(s/√n) for any of its five variables, with
VORZEP · HYPOTHESIS TESTING & INFERENCE TOOLS

One-Sample t-Statistic Calculator

Solve the classic one-sample t relation t = ( x̄ − μ₀ ) / ( s / √n ) for any of its five unknowns — t-statistic, sample mean, hypothesised mean, sample standard deviation, or sample size — with step-by-step math, a live t-distribution curve with the p-value shaded, and a full dataset analyzer that runs the complete one-sample t-test on pasted data.

t = ( x̄ − μ₀ ) / ( s / √n )
Solve for
t-Statistic (t) The number of standard errors by which the sample mean x̄ lies away from the hypothesised population mean μ₀. Under the null hypothesis H₀: μ = μ₀, the statistic t follows Student's t-distribution with df = n − 1 degrees of freedom. Because s is estimated from the sample, the t-distribution has heavier tails than the standard normal — this is Student's correction. Typical |t| values: around 1 for non-significant differences, 2 for marginal significance, 3+ for strong evidence against H₀.
SE units
t must be a finite number.
= t = 2.530 · df = 9 · 2-tailed p = 0.0324
Sample Mean (x̄) The arithmetic mean of the sample, x̄ = Σxᵢ / n. Can be any real number in the units of the measurements. In a one-sample t-test, x̄ is the observed value being compared against a hypothesised population mean μ₀. Use the raw units of your data — points, mmHg, dollars, seconds, etc.
units
Sample mean must be a finite number.
= x̄ = 78.000 · deviation x̄ − μ₀ = —
Hypothesised Mean (μ₀) The value of the population mean under the null hypothesis H₀: μ = μ₀. This is the reference value you are testing against — a population norm, a historical baseline, a regulatory limit, or a theoretical prediction. Typical choices: 100 for an IQ test, 70 for a claimed pass rate, 120 mmHg for a target systolic BP, or 0 for a "no effect" null.
units
Hypothesised mean must be a finite number.
= μ₀ = 70.000 · signed: +70.000
Sample Standard Deviation (s) The sample standard deviation, s = √(Σ(xᵢ − x̄)² / (n − 1)), with Bessel's correction. Must be strictly positive. This is the key quantity that distinguishes the t-test from the z-test: when s is estimated from the data (rather than being a known σ), the test statistic follows the t-distribution. Typical: 10 points for exam scores, 15 mmHg for systolic BP, 0.08 m for adult height.
units
Sample SD must be strictly greater than zero.
= s = 10.000 · variance s² = 100.000 units²
Sample Size (n) The number of observations in the sample. Must be an integer ≥ 2. Degrees of freedom for the t-test are df = n − 1. As n grows, the t-distribution approaches the standard normal; for n ≥ 30 the two are practically indistinguishable, which is why large-sample z-tests are common. Typical: 5–20 for pilot studies, 20–100 for controlled experiments, 100+ for clinical trials and surveys.
obs.
Sample size must be an integer ≥ 2.
= n = 10 · df = n − 1 = 9 · √n = 3.162
t-STATISTIC (t)
2.530 SE
df = 9 · 2-tailed p = 0.0324 · significant at α = 0.05
SIGNIFICANT — p < 0.05 (TWO-TAILED)
t = ( x̄ − μ₀ ) / ( s / √n )
Step-by-step solution
t-distribution with the observed t & shaded p-value
Middle area (1 − p) Two-tailed p-value Observed t
|t| vs. critical values at α = 0.10, 0.05, 0.01
|t| observed Critical values Significance threshold
Sensitivity
Companion inference metrics
Sampling distribution of x̄ — live schematic
SAMPLING DISTRIBUTION OF x̄ · t = ( x̄ − μ₀ ) / ( s / √n ) μ₀ = 70 x̄ = 78 value of x̄ → x̄ = 78 μ₀ = 70 s = 10 n = 10 t = (78 − 70) / (10 / √10) = 2.530
Hypothesised mean μ₀ — centre of the null distribution ±1 standard error band around μ₀ Observed sample mean x̄
Under H₀ the sample mean x̄ would be distributed around μ₀ with standard error s/√n. The t-statistic counts how many of those standard errors separate the observed x̄ from μ₀.
What the one-sample t-statistic really measures
tt-statistic
=
x̄ − μ₀raw deviation
÷
s / √nstandard error

Why the t-distribution, not the normal?

The z-test uses the true population standard deviation σ, giving a statistic that follows the standard normal. In almost all real studies, σ is unknown — we only have the sample standard deviation s, which is itself random and underestimates σ on average. When the denominator contains a random quantity, the ratio is more variable than the normal, with heavier tails. This is exactly the t-distribution, discovered by William Sealy Gosset in 1908 while working at Guinness. As n grows, s becomes a more reliable estimate of σ and the t-distribution converges to the normal — for n ≥ 30 the difference is negligible.

The denominator is the standard error

s / √n is the standard error of the sample mean — a direct measure of how precisely x̄ estimates the population mean μ. It decreases with the square root of sample size: quadrupling n halves the standard error. The t-statistic is therefore a signal-to-noise ratio: the numerator is the observed deviation x̄ − μ₀ (the signal), and the denominator is how much that deviation could fluctuate by chance alone (the noise). A large t means the signal is unlikely to have arisen by chance under H₀.

Assumptions & when to use it

The one-sample t-test assumes the observations are independent, and the population is approximately normal — or n is large enough for the central limit theorem to make x̄ approximately normal. It is robust to moderate departures from normality, especially for larger n, but for heavily skewed data or small samples consider non-parametric alternatives such as the Wilcoxon signed-rank test or the sign test. The observations must all be in the same units and drawn from a single population; paired or grouped data require a paired or two-sample test respectively.

P-values, significance, and effect size

The two-tailed p-value is the probability of obtaining a t-statistic at least as extreme as the one observed, assuming H₀ is true. It is computed from the t-distribution with df = n − 1. Reject H₀ at level α if p < α (equivalently, if |t| exceeds the critical value t₁₋α/₂,ₙ₋₁). But statistical significance is not the same as practical importance: with a large enough sample, a trivial difference becomes significant. Always report the effect size — Cohen's d = (x̄ − μ₀)/s — alongside the p-value, since it quantifies the magnitude of the effect independent of sample size.

How to Use This Calculator

The one-sample t relation links five quantities: t, x̄, μ₀, s and n. Pick which one you want the tool to solve, then fill in the other four.

1. Choose what to solve for

Pick t, x̄, μ₀, s or n from the toggle. Every rearrangement is direct algebra from t = (x̄ − μ₀)/(s/√n). Solving for n uses n = t²·s²/(x̄ − μ₀)² and requires x̄ ≠ μ₀ and t ≠ 0.

2. Use realistic presets

t presets cover the common thresholds (−3 to +4); x̄ and μ₀ presets span typical exam scores, blood pressures, and test scales; s presets run from 0.1 to 100; n presets cover 2 to 500 observations.

3. Match units carefully

x̄, μ₀ and s must share the same units (points, mmHg, dollars, seconds). t is dimensionless — the units cancel in the ratio. n is an integer ≥ 2. All sliders use linear ranges for t, x̄ and μ₀; log scales for s and n.

4. Read the result and verdict

The result card shows the solved value plus df, the two-tailed p-value, and a colour-coded verdict classifying the outcome as not significant, significant at 0.05, at 0.01, or at 0.001.

5. Check the curve and schematic

The t-distribution chart plots the density with df = n − 1, marks the observed t, and shades the two-tailed p-value region. The schematic shows the sampling distribution of x̄ with μ₀ in the centre, the ±1 SE band, and x̄ marked.

6. Analyse a dataset

Scroll to the dataset analyzer, paste any comma- or space-separated numbers, enter the hypothesised mean μ₀, and the tool computes n, x̄, s, the standard error, t, df, the p-value, Cohen's d, and the 95 % confidence interval in one step.

What This Tool Offers

Built around the classic one-sample t-statistic, the workhorse of statistical inference when σ is unknown.

Five-way solving

Solve for t, x̄, μ₀, s or n. Every rearrangement is exact algebra; the n-solve uses a squared form and rounds to the nearest integer.

Live t-distribution curve

A dynamically drawn Student's t density with df = n − 1, the observed t marked, and the two-tailed p-value shaded in red — computed from the exact incomplete-beta CDF.

Significance verdict

Each result is classified from not significant through marginal, significant at 0.05, 0.01, 0.001, up to extreme, with a coloured badge.

Sampling-distribution schematic

A curve centred on μ₀ with the ±1 SE band shaded, the observed x̄ marked in amber, and the deviation visualised on the x̄ axis.

Full dataset analyzer

Paste raw data and a hypothesised mean; the tool computes n, x̄, s, SE, t, df, two-tailed and one-tailed p-values, Cohen's d, and the 95 % and 99 % confidence intervals.

Reference tables

Critical t values across df = 1 to ∞ for α = 0.10, 0.05, 0.01, 0.001 (two-tailed), a dynamic lookup grid, and a variable reference with formula notes.

Dataset Analyzer & Reference Tables

Paste raw data plus a hypothesised mean to run the complete one-sample t-test, or look up critical t values in the reference table.

Quick dataset analyzer — full one-sample t-test

Enter any comma-, space-, or newline-separated numbers, then the hypothesised mean μ₀. The tool returns n, x̄, s, the standard error, t, df, the two-tailed and one-tailed p-values, Cohen's d, and the 95 % and 99 % confidence intervals for μ.

units
Paste numbers above, enter μ₀, and click Analyze to run the one-sample t-test.

Critical Values of the t-Distribution

Two-tailed critical values tα/2, df for common significance levels. Reject H₀ if |tobs| exceeds the critical value.

dfα = 0.10α = 0.05α = 0.01α = 0.001Notes

t vs. z — When to Use Which

The t-test and z-test have the same form; the difference is whether σ is known or estimated.

ConditionTest statisticReference distributionNotes
σ known, any nz = (x̄ − μ₀)/(σ/√n)Standard normal N(0,1)Rare in practice
σ unknown, small nt = (x̄ − μ₀)/(s/√n)Student's t with df = n − 1Heavier tails than normal
σ unknown, large n (n ≥ 30)t or zt ≈ N(0,1)Difference negligible
Non-normal, small n—Wilcoxon / sign testNon-parametric alternative

Variable Reference

SymbolMeaningTypical rangeUnits
tt-statistic−10 to +10dimensionless (SE units)
x̄Sample meanany realsame as data
μ₀Hypothesised population meanany realsame as data
sSample standard deviation> 0same as data
nSample size2 – 10⁶integer
dfDegrees of freedomn − 1integer
SEStandard error = s/√n> 0same as data
dCohen's d = (x̄ − μ₀)/sany realdimensionless
pp-value0 – 1probability

What Does t = ( x̄ − μ₀ ) / ( s / √n ) Measure?

The one-sample t-statistic measures how many standard errors the observed sample mean lies away from the hypothesised population mean. It is the test statistic at the heart of the most widely used statistical procedure in science — the one-sample t-test — and it is the foundation of the confidence interval for a population mean, the paired t-test, and the two-sample t-test. Its discovery by William Sealy Gosset (writing as "Student") in 1908 solved the problem of testing means when the population standard deviation is unknown, which is virtually always the case in practice.

One-Sample t-Statistic Formula

The defining relationship is:

t = ( x̄ − μ₀ ) / ( s / √n )

Rearranged to solve for the other four unknowns:

x̄ = μ₀ + t · s / √n
μ₀ = x̄ − t · s / √n
s = ( x̄ − μ₀ ) · √n / t   (requires t ≠ 0)
n = t² · s² / ( x̄ − μ₀ )²   (requires x̄ ≠ μ₀ and t ≠ 0)

The test statistic follows Student's t-distribution with df = n − 1 degrees of freedom under the null hypothesis H₀: μ = μ₀. The two-tailed p-value is:

p = 2 · ( 1 − Ft,n−1( |t| ) )

where Ft,ν is the CDF of the t-distribution with ν degrees of freedom. Reject H₀ at significance level α if p < α, or equivalently if |t| > t1−α/2, n−1. A confidence interval for μ can also be derived from the same t-statistic:

CI1−α for μ = x̄ ± t1−α/2, n−1 · s / √n

One-Sample t Variables

SymbolMeaningNotes
tt-statisticSignal-to-noise ratio of the deviation x̄ − μ₀
x̄Sample meanArithmetic average of the observations
μ₀Hypothesised meanReference value under the null hypothesis H₀
sSample standard deviationEstimated from the sample with Bessel's correction
nSample sizeNumber of independent observations
dfDegrees of freedomdf = n − 1; shapes the t-distribution
SEStandard errorSE = s/√n; precision of x̄ as an estimate of μ
dCohen's dStandardised effect size; d = (x̄ − μ₀)/s

How Each Variable Affects the t-Statistic

The t-statistic is a ratio of two quantities. The numerator (x̄ − μ₀) is a raw deviation in the units of the data — bigger deviations give bigger t. The denominator s/√n is the standard error, which shrinks as n grows and as s shrinks. So t increases when: the sample mean moves away from μ₀ (larger numerator); the sample standard deviation decreases (smaller denominator); or the sample size increases (smaller denominator through √n). The n-dependence is the reason large samples can detect tiny effects: every quadrupling of n halves the standard error, doubling the t-statistic for the same raw deviation.

Interpretation thresholds depend on df, but for moderate to large samples the familiar guidelines apply. |t| near 0 — the sample mean is essentially at μ₀, no evidence against H₀. |t| ≈ 1 — nothing unusual; about a third of samples would produce this by chance. |t| ≈ 2 — borderline; conventionally significant at α = 0.05 for samples of moderate size. |t| ≈ 3 — strong evidence against H₀, significant at α ≈ 0.01 for typical df. |t| ≥ 4 — very strong evidence, significant at α ≈ 0.001. For very small samples the thresholds are higher (heavier tails), and for very large samples they converge to the standard normal critical values 1.645, 1.96, 2.576.

One-Sample t Calculation Examples

Given: x̄ = 78, μ₀ = 70, s = 10, n = 10
SE = 10 / √10 = 3.1623
t = (78 − 70) / 3.1623 = 2.530 · df = 9 · 2-tailed p = 0.0324
Given: t = 2.530, μ₀ = 70, s = 10, n = 10 — solve for x̄
x̄ = 70 + 2.530 × 3.1623 = 78.00
Given: t = 2.530, x̄ = 78, s = 10, n = 10 — solve for μ₀
μ₀ = 78 − 2.530 × 3.1623 = 70.00
Given: t = 2.530, x̄ = 78, μ₀ = 70, n = 10 — solve for s
s = (78 − 70) × √10 / 2.530 = 8 × 3.1623 / 2.530 = 10.00
Given: t = 2.530, x̄ = 78, μ₀ = 70, s = 10 — solve for n
n = 2.530² × 10² / (78 − 70)² = 6.401 × 100 / 64 = 10.00
Blood pressure example: x̄ = 128 mmHg, μ₀ = 120 mmHg, s = 15, n = 25
SE = 15/5 = 3, t = 8/3 = 2.667 · df = 24 · p ≈ 0.013

Frequently Asked Questions

Use the t-test almost always — the z-test applies only when the true population standard deviation σ is known, which is essentially never the case in real studies. When you estimate σ from the sample (using s), the test statistic follows the t-distribution, which has heavier tails than the normal to account for the extra uncertainty in s. The heavier tails mean the critical values are larger: for a two-tailed test at α = 0.05, the normal critical value is 1.96, but the t critical value for df = 9 is 2.262 and for df = 4 it is 2.776. As n grows the t-distribution converges to the normal, and for n ≥ 30 the two are practically identical. Some authors use the z-test as a large-sample approximation, but a t-test is always valid.

Three assumptions: (1) the observations are independent of one another — no clustering, no repeated measures without accounting for them; (2) the data are drawn from a population that is approximately normally distributed, or n is large enough (typically ≥ 30) for the central limit theorem to make the sample mean x̄ approximately normal regardless of the underlying shape; (3) the observations are measured on at least an interval scale, so that meaningful means and standard deviations can be computed. The test is reasonably robust to mild departures from normality, especially with moderate to large n. For heavily skewed data or small n, use the Wilcoxon signed-rank test instead.

A two-tailed test asks whether μ differs from μ₀ in either direction (μ ≠ μ₀), and the p-value is the probability of |t| being as large as observed. A one-tailed test asks whether μ is specifically greater than μ₀ (or specifically less than μ₀), and the p-value is the probability of t exceeding the observed value (or falling below it). The two-tailed p is always exactly twice the one-tailed p for the same |t|. One-tailed tests are appropriate only when the direction of the effect is specified in advance and a result in the opposite direction would be scientifically uninformative — for example, testing whether a new drug lowers blood pressure more than a placebo. Choosing the tail after seeing the data is a form of p-hacking and inflates the false-positive rate.

The p-value is the probability, under the null hypothesis H₀: μ = μ₀, of observing a t-statistic at least as extreme as the one calculated. For a two-tailed test it is p = 2 · (1 − Ft,n−1(|t|)), where Ft,ν is the cumulative distribution function of the t-distribution with ν = n − 1 degrees of freedom. This calculator computes Ft,ν using the regularised incomplete beta function, which gives the exact value to about 1 part in 10⁹. In practice, printed t-tables give critical values for a few common α levels, but software and this calculator give precise p-values for any t and df.

Cohen's d is a standardised effect size: d = (x̄ − μ₀)/s. It expresses the mean difference in units of the standard deviation, making it comparable across studies that use different measurement scales. Cohen's conventional benchmarks are 0.2 for a small effect, 0.5 for medium, and 0.8 for large, though these are only rough guidelines and depend on the research domain. Effect size matters because statistical significance depends on both the effect size and the sample size: with n = 10,000 even a d = 0.01 effect will be statistically significant, but it is practically meaningless. Always report d (or an equivalent effect size) alongside the p-value to communicate the magnitude of the finding, not just its statistical detectability.

A 95 % confidence interval for μ is x̄ ± t0.975, n−1 · s/√n. The correct interpretation is frequentist: if we were to repeat the experiment many times, 95 % of the intervals constructed this way would contain the true μ. A more useful practical interpretation: the interval gives the range of plausible values for μ given the data. If the interval contains μ₀, the two-tailed t-test will not be significant at α = 0.05; if it excludes μ₀, the test will be significant. The width of the interval reflects the precision of the estimate — narrower intervals come from larger samples and smaller standard deviations.

The t-test is moderately robust to non-normality, especially for larger samples. If the data are heavily skewed, have extreme outliers, or n is very small, consider these alternatives. (1) Use the Wilcoxon signed-rank test, a non-parametric alternative that ranks the absolute deviations from μ₀ and tests whether the median is different from μ₀ — it does not require normality. (2) Use the sign test, which is even simpler and only checks whether observations fall above or below μ₀. (3) Transform the data — applying a log, square root, or Box-Cox transform can restore approximate normality. (4) Use a bootstrap confidence interval for μ, which does not assume any particular distribution. In practice, if n ≥ 30 and the data are not pathologically skewed, the ordinary t-test is usually fine.

Calculating...

Variables

Symbol Quantity Unit
t t-statistic
x̄ Sample mean
μ0 Hypothesized population mean
s Sample standard deviation
n Sample size

What it means

The one‑sample t‑statistic is used to test whether the mean of a sample is significantly different from a known or hypothesized population mean (μ0) when the population standard deviation is unknown. It is the ratio of the difference between the sample mean and the hypothesized mean to the standard error of the mean (s/√n). The statistic follows a t‑distribution with n−1 degrees of freedom. It is widely used in medical research, psychology, and engineering to compare sample means against standards. Understanding the t‑test is fundamental for inferential statistics and for drawing conclusions from sample data.

Worked example

One‑Sample t‑Statistic – Two Examples

Real‑World
Scenario: A sample of 30 has mean 105, hypothesised population mean 100, sample s=15. Compute t.
ParameterValue
x̄105
μ₀100
s15
n30
1t = (105−100) / (15/√30) = 5 / (15/5.477) = 5 / 2.7386 = 1.826
Result 1.826 ✓ t-statistic
Scenario: Sample of 25, mean=48, μ₀=50, s=8. Compute t.
ParameterValue
x̄48
μ₀50
s8
n25
1t = (48−50) / (8/√25) = −2 / (8/5) = −2/1.6 = −1.25
Result −1.25 ✓ t-statistic
Insight: The t‑test compares the sample mean to a hypothesised value when population σ is unknown. It uses sample standard deviation s and degrees of freedom n−1.

Common mistakes

  • One‑sample t‑statistic: Tests whether the sample mean is significantly different from a hypothesized population mean μ₀.
  • x̄: Sample mean.
  • s: Sample standard deviation – use the sample SD, not population.
  • n: Sample size.
  • Degrees of freedom: df = n−1 – use t‑distribution for p‑value.

Applications

The one‑sample t‑statistic, t = (x̄ − μ₀)/(s/√n), is used to test whether the sample mean differs from a specified population mean μ₀ when the population standard deviation is unknown. This is a fundamental test in inferential statistics, used in many applications. Engineers use it to compare process performance against a target, to validate simulations, and to assess the effect of process changes. In research, it tests hypotheses about the mean. By calculating the t‑statistic, professionals can determine whether observed differences are statistically significant, accounting for sample size and variability. The t‑test is robust and widely used, making it essential for data‑driven decision‑making across all disciplines.

  • Process performance verification against target specifications
  • Comparison of experimental data to known values
  • Assessment of process improvements (before/after)
  • Quality control – checking if product meets standards
  • Research – testing hypotheses about population means