What Is a Confidence Interval for a Mean?
When you collect a sample and compute its mean, that number is your point estimate of the population mean μ. The problem with stopping there is that a different random sample from the same population would almost certainly give a different number. Sampling variability is unavoidable. A confidence interval acknowledges this reality by constructing a range around the sample mean rather than reporting a single value.
The width of the interval reflects uncertainty: a wide interval means you know less precisely where μ sits; a narrow interval means the data are informative and the estimate is tight. Three factors control that width — the confidence level you choose, the variability in your data, and the size of your sample.
- Formula (Z): x̄ ± z(α/2) · (σ/√n) — use when population σ is known
- Formula (T): x̄ ± t(α/2) · (s/√n) — use when σ is unknown (the common case)
- Margin of Error: Critical value × Standard Error
- Standard Error: σ/√n (or s/√n) — measures how much x̄ varies across samples
- Common levels: 90% (z=1.645), 95% (z=1.960), 99% (z=2.576)
- Width rule: Larger n → narrower interval. Higher confidence → wider interval.
Why a Point Estimate Is Not Enough
Suppose a quality engineer measures 30 circuit boards and finds a mean resistance of 47.3 ohms. Reporting "the mean is 47.3 ohms" is technically accurate for that sample, but it says nothing about how reliable that number is as a description of all circuit boards coming off the line. Two things are missing: the precision of the estimate, and the uncertainty around it.
A 95% confidence interval of (46.8, 47.8) communicates far more. It tells the engineer that the data are consistent with a true population mean anywhere in that half-ohm band. If the specification requires resistance between 45 and 50 ohms, the interval fits comfortably. If the requirement is 47 ± 0.2 ohms, the interval suggests the process may be off target — and further investigation is warranted.
Beginner's Guide to Confidence Intervals
What Is Statistical Uncertainty?
Whenever you study a sample rather than the entire population, you are working with incomplete information. The sample mean gives you the best available single-number summary of the population mean, but it is unlikely to be exactly right. Statistical uncertainty refers to this gap between what your sample tells you and what the full population would tell you if you could measure it completely.
Confidence intervals are the field's standard tool for quantifying that gap. They do not eliminate uncertainty — nothing can — but they make it visible and measurable. A 95% confidence interval of (62.4, 68.8) tells a researcher that the data are consistent with a population mean anywhere in that range, and that at the chosen confidence level, this range is considered trustworthy.
Understanding 95% Confidence — What It Actually Means
The phrase "95% confidence" has a precise, counterintuitive meaning that even experienced analysts sometimes get wrong. It does not mean: "There is a 95% chance the true mean is in this interval." The true mean is a fixed number — it does not have a probability of being anywhere. The interval is what varies.
The correct interpretation: if you repeated the sampling process many times — taking a new random sample each time and computing a new confidence interval each time — approximately 95% of all those intervals would contain the true population mean. Any single interval either does or does not contain μ. The confidence refers to the procedure's long-run success rate, not to any single result.
Confidence Interval Structure
A Real-Life Analogy
Think of estimating how long your commute will take. Some days it is 28 minutes, some days 35 minutes — there is variability. Based on two weeks of data, you might say: "I expect the commute to take about 31 minutes, give or take 4 minutes." That "give or take 4 minutes" is your margin of error. The interval 27–35 minutes is your confidence interval. You are not certain of any single value; you are reasonably confident the true expected commute falls somewhere in that range.
Confidence Interval Formula for Mean
Z-Interval Formula (Known Population σ)
Use the Z-interval when the population standard deviation σ is known. In practice this is rare, but it applies when historical data or process knowledge gives you σ with certainty. The formula is:
x̄ = sample meanzα/2 = critical z-valueσ = population standard deviationn = sample sizeT-Interval Formula (Unknown Population σ)
When σ is unknown — the situation in nearly every real-world study — replace σ with the sample standard deviation s and replace the z critical value with a t critical value from the t-distribution. The t-distribution is wider than the normal distribution, which honestly accounts for the extra uncertainty introduced by estimating σ from data.
x̄ = sample meantα/2 = critical t-valuedf = n − 1 = degrees of freedoms = sample standard deviationn = sample sizeFormula Components Explained
Standard Error (SE)
The standard error measures how much the sample mean x̄ varies from sample to sample. Larger samples produce smaller standard errors, leading to narrower intervals. SE is the single most controllable quantity in the formula: double n, and SE drops by √2 ≈ 1.414.
Critical Value
The critical value translates a chosen confidence level into a multiplier. For 95% confidence with the normal distribution, z0.025 = 1.960. For a t-distribution with 14 degrees of freedom and 95% confidence, t0.025,14 = 2.145 — wider, reflecting smaller-sample uncertainty.
Margin of Error (ME)
The margin of error is the half-width of the confidence interval. It defines how far the bounds extend on either side of the sample mean. A polling margin of error of ±3 points means the interval runs from (x̄ − 3) to (x̄ + 3).
Degrees of Freedom
Degrees of freedom determine which t-distribution to use. As df increases (larger n), the t-distribution approaches the normal distribution. At df = 120 or more, the difference is negligible and many textbooks simply use the z critical value.
Common Critical Values at a Glance
| Confidence Level | α | α/2 | Z Critical Value | T (df=10) | T (df=29) |
|---|---|---|---|---|---|
| 90% | 0.10 | 0.05 | 1.645 | 1.812 | 1.699 |
| 95% | 0.05 | 0.025 | 1.960 | 2.228 | 2.045 |
| 99% | 0.01 | 0.005 | 2.576 | 3.169 | 2.756 |
The t-distribution has heavier tails than the standard normal. When you estimate σ from a small sample, there is more uncertainty about the true spread of the population. The wider tails of the t-distribution capture this by requiring a larger critical value to achieve the same confidence level. As n grows, the t critical value converges on the z value.
The Estimate → Uncertainty → Interval Framework™
Every confidence interval problem follows the same logical sequence. Here it is as a six-step method you can apply to any dataset:
Estimate the Mean. Compute the sample mean x̄ = Σx / n. This is your point estimate — your best single-number guess for μ.
Quantify Variability. Determine whether you have the population standard deviation σ (rare) or the sample standard deviation s (typical). If s, compute it: s = √[Σ(x − x̄)² / (n−1)].
Calculate Standard Error. SE = σ/√n (Z-interval) or SE = s/√n (T-interval). The standard error converts raw variability into a measure of how variable the sample mean itself is.
Select the Critical Value. Choose your confidence level (90%, 95%, or 99%). If using Z, look up zα/2. If using T, find tα/2 from a t-distribution table with df = n − 1.
Compute the Margin of Error. ME = Critical Value × SE. This is the half-width of your interval.
Construct and Interpret the Interval. Lower bound = x̄ − ME. Upper bound = x̄ + ME. State your conclusion: "We are [C]% confident the true population mean lies between [L] and [U]."
Before calculating, answer three questions: (1) Do I know σ? → Z or T. (2) What confidence level? → Critical value. (3) How large is n? → Degrees of freedom if using T. Answer these first and the arithmetic is mechanical.
Interactive Confidence Interval Calculator
Confidence Interval for Mean — Z and T Calculator
Step-by-Step Worked Examples
Example 1: Z-Interval with 95% Confidence (Known σ)
Exam Scores: μ unknown, σ = 10, n = 36, 95% CI
A school district draws a random sample of 36 students from a standardized exam. Their mean score is x̄ = 75. The population standard deviation of exam scores is known from years of historical data to be σ = 10. Construct a 95% confidence interval for the mean score of all students.
Point estimate: x̄ = 75
Standard error: SE = σ/√n = 10/√36 = 10/6 ≈ 1.667
Critical value: 95% confidence → zα/2 = z0.025 = 1.960
Margin of error: ME = 1.960 × 1.667 = 3.267
Interval: Lower = 75 − 3.267 = 71.73 | Upper = 75 + 3.267 = 78.27
95% CI: (71.73, 78.27). We are 95% confident the true mean exam score for all students falls between 71.73 and 78.27 points.
Example 2: T-Interval with 95% Confidence (Unknown σ)
Customer Wait Times: n = 20, s = 4.2 min, x̄ = 18.5 min, 95% CI
A service manager records wait times (in minutes) for a random sample of 20 customers. The sample mean is 18.5 minutes and the sample standard deviation is 4.2 minutes. Construct a 95% confidence interval for the mean wait time of all customers. σ is not known.
Point estimate: x̄ = 18.5 min
Degrees of freedom: df = n − 1 = 20 − 1 = 19
Standard error: SE = s/√n = 4.2/√20 = 4.2/4.472 ≈ 0.939
Critical value: t0.025,19 = 2.093 (from t-table)
Margin of error: ME = 2.093 × 0.939 = 1.965 min
Interval: Lower = 18.5 − 1.965 = 16.535 | Upper = 18.5 + 1.965 = 20.465
95% CI: (16.54, 20.47) minutes. We are 95% confident the true mean wait time for all customers lies between 16.54 and 20.47 minutes.
Example 3: 99% Confidence Interval
Product Weights: n = 50, s = 2.8 g, x̄ = 100.3 g, 99% CI
A food manufacturer samples 50 packages and finds a mean weight of 100.3 g with s = 2.8 g. Construct a 99% confidence interval for the true mean package weight.
df = 49; SE = 2.8/√50 = 2.8/7.071 ≈ 0.396 g
Critical value: t0.005,49 ≈ 2.680
ME = 2.680 × 0.396 ≈ 1.061 g
Interval: (100.3 − 1.061, 100.3 + 1.061) = (99.24, 101.36)
99% CI: (99.24, 101.36) g. Notice this interval is wider than a 95% CI would be for the same data — higher confidence demands a wider net.
Example 4: Small Sample (n = 12)
Blood Pressure Readings: n = 12, s = 8.5 mmHg, x̄ = 127 mmHg, 90% CI
A clinical researcher records systolic blood pressure from 12 patients. Mean = 127 mmHg, s = 8.5 mmHg. Compute a 90% CI for the population mean systolic pressure.
df = 11; SE = 8.5/√12 ≈ 8.5/3.464 ≈ 2.454 mmHg
Critical value: t0.05,11 = 1.796
ME = 1.796 × 2.454 ≈ 4.407 mmHg
Interval: (127 − 4.407, 127 + 4.407) = (122.59, 131.41)
90% CI: (122.59, 131.41) mmHg. With only 12 observations, the t critical value (1.796) is noticeably larger than z0.05 = 1.645, producing a wider interval to account for the small-sample uncertainty.
Example 5: Large Sample (n = 500)
Website Load Time: n = 500, s = 0.45 sec, x̄ = 2.13 sec, 95% CI
A web developer logs load times for 500 page visits. Mean = 2.13 sec, s = 0.45 sec. Construct a 95% CI for the population mean load time.
df = 499; SE = 0.45/√500 = 0.45/22.361 ≈ 0.0201 sec
With df = 499, t0.025,499 ≈ 1.965 ≈ z (the distributions are nearly identical at this scale)
ME = 1.965 × 0.0201 ≈ 0.0395 sec
Interval: (2.13 − 0.040, 2.13 + 0.040) = (2.090, 2.170)
95% CI: (2.090, 2.170) seconds. The large sample produces a very narrow interval — only 0.08 seconds wide — giving a precise picture of true mean load time. Compare this with Example 4: same confidence level, but a 41× larger sample cuts the interval width dramatically.
Z-Interval vs T-Interval: When to Use Which
Use z critical values
Formula: x̄ ± z · (σ/√n)
Use t critical values
Formula: x̄ ± t · (s/√n)
df = n − 1
Proceed with T-interval — the Central Limit Theorem supports normality of x̄
Check data shape. Consider non-parametric alternatives or consult a statistician.
| Feature | Z-Interval | T-Interval |
|---|---|---|
| Population σ | Known | Unknown (estimated by s) |
| Distribution used | Standard normal (Z) | Student's t-distribution |
| Sample size | Usually large, but any n works if σ known | Any n ≥ 2 (ideally ≥ 30 or normal population) |
| Critical value (95%) | 1.960 (constant) | Depends on df (≥ 1.960) |
| Interval width | Narrower (when n is large) | Wider for small n, converges to Z for large n |
| Real-world frequency | Rare (σ almost never known) | Very common |
| Degrees of freedom | Not applicable | df = n − 1 |
Confidence Levels Explained: 90%, 95%, and 99%
The choice of confidence level is a deliberate tradeoff between precision and reliability. A higher confidence level requires a larger critical value, which increases the margin of error and widens the interval. A narrower interval is more useful for decision-making but provides weaker long-run guarantees.
z = 1.645
Narrowest interval among the three common levels. Acceptable when the cost of being wrong is low and precision matters more than caution. Common in exploratory business analysis.
z = 1.960
The most widely used level in science and industry. Balances precision and confidence acceptably for most published research and regulatory reporting. Standard in polling and A/B testing.
z = 2.576
Widest interval. Used when the cost of a wrong conclusion is high — medical device approval, pharmaceutical trials, structural safety testing. Precision is sacrificed for near-certainty.
Widening a confidence interval by raising the confidence level does not make the estimate more accurate. It simply means you are casting a wider net. An interval of (50, 200) at 99% confidence tells you far less than (82, 95) at 95% confidence. Precision and confidence are separate dimensions.
How Sample Size Affects the Confidence Interval
The relationship between sample size and interval width is direct and predictable. Because n appears under the square root in the standard error formula, the interval does not narrow linearly with sample size — it narrows proportionally to the square root of n.
| Sample Size (n) | √n | SE (σ=10) | ME (95%, Z) | Interval Width |
|---|---|---|---|---|
| n = 10 | 3.162 | 3.162 | 6.198 | 12.40 |
| n = 25 | 5.000 | 2.000 | 3.920 | 7.84 |
| n = 50 | 7.071 | 1.414 | 2.771 | 5.54 |
| n = 100 | 10.000 | 1.000 | 1.960 | 3.92 |
| n = 400 | 20.000 | 0.500 | 0.980 | 1.96 |
The pattern in this table makes the square-root relationship concrete. Going from n = 25 to n = 100 (a fourfold increase in sample size) halves the margin of error from 3.920 to 1.960. Going from n = 100 to n = 400 halves it again to 0.980. Each successive halving of ME requires quadrupling the sample size — a law of diminishing returns that shapes study design in every empirical field.
Real-World Case Studies
Case Study 1 — Election Polling
REAL-WORLD APPLICATION
Presidential Approval Poll: n = 1,200, p̂ = 0.47
A polling organization surveys 1,200 adults about presidential approval. The sample mean support is 47 percentage points. Assuming the standard deviation of individual responses is approximately 0.5 (treating each yes/no as 0 or 1), compute a 95% CI for the true approval rating.
SE = 0.5/√1200 ≈ 0.01443. ME = 1.960 × 0.01443 ≈ 0.0283 ≈ 2.83 percentage points. CI = (44.2%, 49.8%).
Decision: The headline figure "47% ± 3 points" is exactly this confidence interval, rounded. When a poll says "margin of error ±3 points at 95% confidence," it is describing a confidence interval constructed precisely this way. The interval crossing 50% means the race is too close to call.
Case Study 2 — Clinical Trial Analysis
REAL-WORLD APPLICATION
Drug Efficacy: Reduction in Systolic Blood Pressure
A trial of 60 hypertensive patients receiving a new medication finds a mean blood pressure reduction of 12.4 mmHg with s = 6.8 mmHg. The regulatory threshold for clinical significance is a reduction ≥ 10 mmHg. Compute a 95% CI.
df = 59; SE = 6.8/√60 ≈ 0.878. t0.025,59 ≈ 2.001. ME = 2.001 × 0.878 ≈ 1.757 mmHg. CI = (10.64, 14.16) mmHg.
Decision: The entire 95% CI sits above the 10 mmHg clinical threshold. The drug shows statistically and clinically meaningful blood pressure reduction. If the lower bound had fallen below 10, the case for approval would have been weaker.
Case Study 3 — Manufacturing Quality Control
REAL-WORLD APPLICATION
Circuit Board Resistance: n = 40, Spec = 100 ± 2 Ω
A production line specification requires mean board resistance of 100 Ω ± 2 Ω. Quality control samples 40 boards: x̄ = 101.3 Ω, s = 1.9 Ω. Construct a 99% CI.
df = 39; SE = 1.9/√40 ≈ 0.300 Ω. t0.005,39 ≈ 2.708. ME = 2.708 × 0.300 ≈ 0.812 Ω. CI = (100.49, 102.11) Ω.
Decision: The lower confidence bound (100.49) is within spec, but the upper bound (102.11) exceeds the tolerance. This signals potential process drift. A production engineer should investigate whether the process mean has shifted upward, even though the sample mean alone (101.3) might seem acceptable.
Common Mistakes and Misconceptions
Four misinterpretations of confidence intervals appear repeatedly in research, journalism, and student work. Each one leads to incorrect conclusions and is worth addressing directly.
| Misconception | ❌ Wrong Interpretation | ✅ Correct Interpretation |
|---|---|---|
| The 95% probability statement | There is a 95% chance the true mean is in this interval. | If repeated many times, 95% of intervals constructed by this procedure will contain the true mean. |
| Coverage of individual observations | 95% of individual data values fall inside the interval. | The interval estimates where the population mean falls, not individual values. Individual values follow a much wider spread. |
| Wider = better | A wider interval at 99% confidence is always more informative. | A narrow interval at 95% can be far more useful than a wide interval at 99%. Width and confidence serve different purposes. |
| Large sample = no uncertainty | With n = 1000, the sample mean must equal the population mean. | Large samples reduce uncertainty substantially but never eliminate it. Even with n = 1000, the confidence interval has nonzero width. |
Saying "we are 95% confident the population mean is in (a, b)" means: the estimation procedure works correctly 95% of the time over many repetitions. The single interval you computed either does or does not contain μ — there is no probability attached to that specific interval. Only the long-run method has a 95% success rate.
Assumptions Required for Confidence Intervals
Confidence intervals for a mean rest on several conditions. Violating them does not automatically invalidate the analysis, but it does require care.
- Random sampling: Data should come from a random sample so that the sample mean is an unbiased estimator of the population mean. Convenience samples create unknown bias that no formula corrects.
- Independence: Individual observations should be independent of one another. In practice, this means the sample should not exceed about 10% of the population (the 10% condition).
- Normality or large sample: For the t-interval to behave correctly, either the population is approximately normally distributed, or the sample size is large enough (typically n ≥ 30) for the Central Limit Theorem to ensure the sampling distribution of x̄ is approximately normal. See the sampling distributions guide for a full treatment of the CLT.
The Central Limit Theorem (CLT) states that the sampling distribution of x̄ approaches normality as n increases, regardless of the shape of the original population. This is why confidence intervals work even when the underlying data are not perfectly normal — for n ≥ 30, the CLT provides sufficient justification in most cases.
Glossary of Key Terms
| Term | Formula | Definition |
|---|---|---|
| Confidence Interval | x̄ ± ME | A range of values constructed from sample data to estimate the population mean with a specified confidence level. |
| Sample Mean | x̄ = Σx / n | The arithmetic average of observations in a sample. Serves as the point estimate of the population mean. |
| Population Mean | μ | The true but unknown average of the entire population. The target of the confidence interval estimation. |
| Standard Error | SE = s/√n | Measures the variability of the sample mean across repeated samples. Decreases as n increases. |
| Margin of Error | ME = z·SE or t·SE | Half the width of the confidence interval. Determines how far bounds extend from the point estimate. |
| Critical Value | zα/2 or tα/2,df | A multiplier from the normal or t-distribution that sets the confidence level of the interval. |
| Confidence Level | 1 − α | The long-run proportion of confidence intervals, built the same way, that would contain the true parameter. |
| Degrees of Freedom | df = n − 1 | A parameter of the t-distribution. Larger df pushes the t-distribution closer to the standard normal. |
| Significance Level | α = 1 − C | The complement of the confidence level. A 95% CI has α = 0.05; a 99% CI has α = 0.01. |
| Point Estimate | x̄ | A single number used to estimate an unknown population parameter. Lacks information about uncertainty. |
Practice Problems
Problem 1 — Z-Interval Basics
A sample of n = 64 students has x̄ = 82 and σ = 16. Compute a 95% confidence interval for the population mean.
Problem 2 — T-Interval Basics
n = 25, x̄ = 150, s = 20. Construct a 95% confidence interval. (σ unknown)
Problem 3 — 99% CI
n = 40, x̄ = 5.7 kg, s = 0.9 kg. Find a 99% confidence interval for the population mean weight.
Problem 4 — Width Comparison
Using the same data (n = 50, x̄ = 200, s = 30), calculate 90%, 95%, and 99% CIs. Compare the widths.
Problem 5 — Sample Size Planning
A researcher wants a 95% CI for μ with ME ≤ 2 units. Historical data suggests σ ≈ 15. What minimum sample size is needed?
Problem 6 — Interpretation
A study reports: "The 95% CI for mean recovery time is (5.2, 8.8) days." What does this interval tell you — and what does it NOT tell you?
Frequently Asked Questions
Related Topics on Statistics Fundamentals
Confidence intervals connect to the broader landscape of inferential statistics. The following pages on Statistics Fundamentals develop the surrounding concepts in depth:
Sampling Distributions
Understand why the sample mean has its own distribution, and how the Central Limit Theorem guarantees approximate normality — the engine behind every confidence interval.
Hypothesis Testing
See how confidence intervals and hypothesis tests are two sides of the same inferential coin, and when each is the better tool for a given research question.
Normal Distribution
The standard normal curve underlies every Z critical value. Solid fluency with the normal distribution makes confidence interval logic much easier to follow.
Standard Deviation
Standard deviation measures spread in your sample data. It is the numerator of the standard error formula — getting comfortable with it is prerequisite knowledge for CI calculations.
Additional tools and tables that support confidence interval calculations on this site:
- Confidence Interval Calculator — compute CIs for proportions, means, and differences
- T-Distribution Table — look up critical values by degrees of freedom and confidence level
- Z-Table — standard normal cumulative probabilities for Z critical values
- Standard Deviation Calculator — compute s from raw data before plugging into the CI formula
- Z-Score Guide — the foundation for understanding z critical values
- One-Sample T-Test — the hypothesis-testing counterpart to the T-interval
For deeper reading, the American Statistical Association's guidelines on statistical inference, the National Institute of Standards and Technology (NIST) Engineering Statistics Handbook, and OpenStax Statistics provide peer-reviewed and authoritative treatments of confidence interval theory and application.