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.
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 μ.
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.001 | Notes |
|---|
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.
| Condition | Test statistic | Reference distribution | Notes |
|---|---|---|---|
| σ known, any n | z = (x̄ − μ₀)/(σ/√n) | Standard normal N(0,1) | Rare in practice |
| σ unknown, small n | t = (x̄ − μ₀)/(s/√n) | Student's t with df = n − 1 | Heavier tails than normal |
| σ unknown, large n (n ≥ 30) | t or z | t ≈ N(0,1) | Difference negligible |
| Non-normal, small n | — | Wilcoxon / sign test | Non-parametric alternative |
Variable Reference
| Symbol | Meaning | Typical range | Units |
|---|---|---|---|
| t | t-statistic | −10 to +10 | dimensionless (SE units) |
| x̄ | Sample mean | any real | same as data |
| μ₀ | Hypothesised population mean | any real | same as data |
| s | Sample standard deviation | > 0 | same as data |
| n | Sample size | 2 – 10⁶ | integer |
| df | Degrees of freedom | n − 1 | integer |
| SE | Standard error = s/√n | > 0 | same as data |
| d | Cohen's d = (x̄ − μ₀)/s | any real | dimensionless |
| p | p-value | 0 – 1 | probability |
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:
Rearranged to solve for the other four unknowns:
μ₀ = 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:
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:
One-Sample t Variables
| Symbol | Meaning | Notes |
|---|---|---|
| t | t-statistic | Signal-to-noise ratio of the deviation x̄ − μ₀ |
| x̄ | Sample mean | Arithmetic average of the observations |
| μ₀ | Hypothesised mean | Reference value under the null hypothesis H₀ |
| s | Sample standard deviation | Estimated from the sample with Bessel's correction |
| n | Sample size | Number of independent observations |
| df | Degrees of freedom | df = n − 1; shapes the t-distribution |
| SE | Standard error | SE = s/√n; precision of x̄ as an estimate of μ |
| d | Cohen's d | Standardised 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
SE = 10 / √10 = 3.1623
t = (78 − 70) / 3.1623 = 2.530 · df = 9 · 2-tailed p = 0.0324
x̄ = 70 + 2.530 × 3.1623 = 78.00
μ₀ = 78 − 2.530 × 3.1623 = 70.00
s = (78 − 70) × √10 / 2.530 = 8 × 3.1623 / 2.530 = 10.00
n = 2.530² × 10² / (78 − 70)² = 6.401 × 100 / 64 = 10.00
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.
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| Parameter | Value |
|---|---|
| x̄ | 105 |
| μ₀ | 100 |
| s | 15 |
| n | 30 |
| Parameter | Value |
|---|---|
| x̄ | 48 |
| μ₀ | 50 |
| s | 8 |
| n | 25 |
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
Related calculators · Probability Distributions
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.