What a confidence interval for a mean actually tells you
A confidence interval is a range of plausible values for a population mean, built from a single sample. You measured 25 parts, or surveyed 400 customers, or ran 12 assays, and you got one number. That number is almost certainly not the population mean. The interval quantifies how far off it could reasonably be.
The precise meaning is about the procedure, not about your one interval. If you repeated the whole exercise many times — draw a fresh sample, compute a fresh mean and standard deviation, build a fresh interval — then 95% of the intervals produced by a 95% procedure would contain the true population mean. Your particular interval either contains it or it does not, and you never find out which. This is why careful writers say “a 95% confidence interval” rather than “there is a 95% probability the mean lies in this range”.
Three things drive the width. Spread widens it: a noisy process gives a bigger s. Sample size narrows it, but only as √n, so quadrupling your sample halves the interval. Confidence widens it: demanding 99% coverage instead of 95% buys certainty with precision. Those three levers are the whole story, and the calculator above shows each of them separately.
The formula, one piece at a time
Start with the standard error, SE = s / √n. This is the standard deviation of the sampling distribution of the mean — how much your sample mean would bounce around if you kept re-sampling. It is not the spread of your data; it is the spread of averages. Because averaging cancels noise, it shrinks with the square root of the sample size. You can compute it on its own with the standard error of the mean calculator, and get s itself from the standard deviation calculator.
Now multiply by a critical value. If you knew the population standard deviation σ, the sample mean would be normally distributed and you would use z — 1.959964 for 95%, which is why polls quote “about two standard errors”. You almost never know σ. You estimate it with s, and that estimate is itself uncertain, so the correct reference distribution is Student's t with n − 1 degrees of freedom. The t distribution has heavier tails than the normal, so its critical values are larger, and the penalty is severe at small n: at df = 1 the 95% multiplier is 12.706 rather than 1.960.
Why n − 1 degrees of freedom? Because you spent one piece of information estimating the mean before you could estimate the spread around it. Once n − 1 of the deviations from x̄ are known, the last one is forced, so only n − 1 of them are free to vary. As n grows, t converges on z: at df = 120 the 95% multiplier is 1.980 against z's 1.960, a gap of one percent. That is why large-sample work often ignores the distinction. You can look up the multiplier on its own with the t critical value calculator.
Worked example: 25 parts with a mean of 520 and s = 50
A supplier ships a component with a nominal tensile strength of 500 MPa. You test 25 units, get a sample mean of 520 MPa and a sample standard deviation of 50 MPa, and you want a 95% confidence interval for the true mean strength of the lot.
- Standard error. SE = 50 / √25 = 50 / 5 = 10.000 MPa.
- Degrees of freedom. df = 25 − 1 = 24.
- Critical value. For 95% confidence, α = 0.05 and each tail holds 0.025. From the t table, t(0.025, 24) = 2.0639.
- Margin of error. E = 2.0639 × 10.000 = 20.639 MPa.
- Limits. 520 − 20.639 = 499.36 MPa and 520 + 20.639 = 540.64 MPa.
So the 95% interval is 499.4 to 540.6 MPa. Read it against the 500 MPa nominal: the interval contains 500, with 0.64 MPa to spare at the bottom. You therefore have no evidence at the 5% level that the lot mean exceeds nominal, and the equivalent one-sample t-test against μ₀ = 500 gives t = 20/10 = 2.000, which falls short of the same 2.0639 cutoff. That correspondence is exact and always holds: a two-tailed test at α rejects μ₀ precisely when the (1 − α) interval excludes μ₀.
Suppose you want the interval half as wide. Since E is proportional to 1/√n, you need four times the data: 100 parts instead of 25, giving SE = 50/√100 = 5.000 and, with t(0.025, 99) = 1.9842, a margin of error of 9.92 MPa.
How to read the result
Read the interval, not the point estimate. The single most useful habit in applied statistics is to quote “520 MPa, 95% CI 499 to 541” instead of “520 MPa”, because the second version silently claims a precision you do not have.
Check whether a decision-relevant value falls inside. If a specification limit, a contractual minimum, a historical benchmark or a hypothesised value lies inside the interval, your data are compatible with it. If it lies outside, your data are not, at that confidence level. That is the whole inferential content of the interval.
Judge the width against the size of the thing you are measuring. A margin of error of ±20.639 on a mean of 520 is 20.639/520 = 4.0% — fine for a materials survey, hopeless for a calibration laboratory. The calculator flags a margin of error exceeding 20% of the mean, because past that point the estimate rarely supports a decision.
Do not read the interval as covering individual observations. It is an interval for the mean. Roughly 95% of individual parts fall within about x̄ ± 2s, which here is 520 ± 100 — five times wider than the interval for the mean. Confusing the two is the most common misreading of a published interval; if you want a range that covers individual units, you need a prediction interval or a tolerance interval, not this one.
Critical t values by degrees of freedom
| df = n − 1 | 90% | 95% | 99% |
|---|---|---|---|
| 1 | 6.314 | 12.706 | 63.657 |
| 5 | 2.015 | 2.571 | 4.032 |
| 10 | 1.812 | 2.228 | 3.169 |
| 15 | 1.753 | 2.131 | 2.947 |
| 20 | 1.725 | 2.086 | 2.845 |
| 24 | 1.711 | 2.064 | 2.797 |
| 30 | 1.697 | 2.042 | 2.750 |
| 60 | 1.671 | 2.000 | 2.660 |
| 120 | 1.658 | 1.980 | 2.617 |
| ∞ (z) | 1.645 | 1.960 | 2.576 |
Values are the standard published two-tailed t table. Read the row for your df and the column for your confidence level.
Mistakes that make a confidence interval wrong
- Entering the standard error instead of the standard deviation. The field wants s. If you paste an already-divided figure, the calculator divides by √n a second time and the interval comes out far too narrow.
- Using z because the sample is “large”. The choice depends on whether σ is known, not on sample size. With a sample-estimated s, use t at every n; it converges to z on its own.
- Applying it to badly skewed data at small n. The t interval relies on the sample mean being approximately normal. With n under about 15 and a strongly skewed or heavy-tailed distribution, actual coverage falls short of the stated level. Plot the data, or use a bootstrap interval instead.
- Assuming independent observations when they are not. Repeated measures on the same subject, cluster samples and time series all carry correlation that this formula ignores, and ignoring it makes the interval too narrow.
- Reading the interval as a range for individual values. It bounds the mean; individual observations spread about √n times wider.
- Sampling a large fraction of a finite population without correcting. If you measured 300 items out of a population of 1,000, this interval is conservative. The margin of error calculator applies the finite population correction.
When to use a different interval
For a percentage rather than an average — the share of customers who renewed, the fraction of parts out of spec — the sampling distribution is binomial and you want the confidence interval for a proportion, which uses p(1−p) in place of s².
For the gap between two group means, use the confidence interval for a difference of means or read the interval reported by the two-sample t-test calculator. Comparing two separate intervals by eye is a poor substitute: non-overlapping intervals do imply a significant difference, but overlapping ones frequently still differ significantly.
If you are planning a study rather than analysing one, invert the formula. Fix the margin of error you can live with and solve for n; the sample size for a mean estimate calculator and the survey sample size calculator do exactly that.
The t procedure traces to W. S. Gosset, who published it in 1908 under the pen name “Student” while working at the Guinness brewery, precisely because brewing experiments were small-sample problems where the normal approximation failed. That origin is worth remembering: the point of the t distribution is that it stays honest at small n.
Key terms
- Margin of error
- Half the width of the interval, equal to the critical value times the standard error. Quoted as “±E”.
- Standard error
- The standard deviation of the sampling distribution of a statistic. For a mean it is s/√n.
- Degrees of freedom
- The number of independent deviations left after estimating the mean, equal to n − 1 for a one-sample interval.
- Coverage
- The long-run proportion of intervals built by a procedure that contain the true parameter. A well-behaved 95% procedure has coverage near 0.95.
