What Is a Confidence Interval?
The confidence interval was developed by Jerzy Neyman in 1937 as a way to quantify estimation uncertainty from sample data. Rather than reporting a single number — the point estimate — and pretending it equals the true population value, a confidence interval acknowledges sampling variability by building a range around the estimate.
The interval has two components: a point estimate (the center) and a margin of error (the half-width). The margin of error equals the critical value multiplied by the standard error. Understanding both parts is essential before working through examples. The full theory is covered in the confidence intervals guide on Statistics Fundamentals.
The shaded bar is the confidence interval. The dot is the sample mean. ME = margin of error = z* × SE.
A 95% CI does not mean "there is a 95% probability the true mean lies in this interval." The true mean is a fixed (unknown) number — it either falls in the interval or it doesn't. The correct statement is: the procedure produces intervals that capture the true mean 95% of the time across repeated samples. Any single interval is either right or wrong.
- Point estimate: The sample statistic at the center of the interval (x̄ or p̂)
- Margin of error (ME): Half the interval width. ME = critical value × standard error
- Standard error (SE): Measures sampling variability. For means: SE = s/√n. For proportions: SE = √[p̂(1−p̂)/n]
- Critical value: z* for known σ or large n; t* for unknown σ or small n
- Confidence level: C = 95% means z* = 1.96; C = 99% means z* = 2.576; C = 90% means z* = 1.645
- Interpretation: "We are C% confident the true [parameter] falls between [lower] and [upper]"
Confidence Interval Formulas
There are two main formula families depending on what you are estimating: a population mean (μ) or a population proportion (p). Within the mean formula, the critical value changes based on whether the population standard deviation σ is known.
Formula 1 — Z-Interval for a Mean (σ Known)
x̄ = sample mean
z* = critical z-value for confidence level C
σ = known population standard deviation
n = sample size
Use the z-interval when σ is known — rare in practice — or when n is large enough (typically n > 30) that the sample standard deviation s is a reliable stand-in for σ and the Central Limit Theorem guarantees approximate normality. See the Central Limit Theorem guide for the underlying theory.
Formula 2 — T-Interval for a Mean (σ Unknown)
s = sample standard deviation
t* = critical t-value with df = n − 1
n = sample size
This is the formula you will use most often. When σ is unknown, replace it with the sample standard deviation s and use the t-distribution rather than the z-distribution. Find t* in the t-distribution table using df = n − 1.
Formula 3 — Z-Interval for a Proportion
p̂ = sample proportion (x/n)
z* = critical z-value
n = sample size
For proportions, the standard error depends on p̂ itself, not on a separate standard deviation. This formula requires that np̂ ≥ 10 and n(1−p̂) ≥ 10 — called the success-failure condition — to ensure the normal approximation is valid.
Critical Values (z*) by Confidence Level
| Confidence Level (C) | α = 1 − C | α/2 (each tail) | Critical Value z* |
|---|---|---|---|
| 90% | 0.10 | 0.05 | 1.645 |
| 95% | 0.05 | 0.025 | 1.960 |
| 98% | 0.02 | 0.010 | 2.326 |
| 99% | 0.01 | 0.005 | 2.576 |
These critical values come from the standard z-table. The z* value cuts off the corresponding area in each tail of the standard normal distribution. For t-intervals, use the t-distribution table with the appropriate degrees of freedom.
5-Step Procedure for Any Confidence Interval
Step 1: Identify the parameter and confidence level. Step 2: Calculate the point estimate (x̄ or p̂). Step 3: Compute the standard error. Step 4: Find the critical value (z* or t*). Step 5: Compute the interval and write a plain-English interpretation.
Identify the Parameter and Confidence Level
Decide what you are estimating (a population mean μ, a proportion p, or a difference). Choose the confidence level C — usually 95%. Check assumptions: data should be a random sample, n should be adequate, and the sampling distribution should be approximately normal (either by assumption, the Central Limit Theorem, or the success-failure condition for proportions).
Calculate the Point Estimate
Compute the sample mean x̄ = Σxᵢ/n or the sample proportion p̂ = x/n (where x is the count of successes). This value sits at the center of the confidence interval. If given data, calculate the sample standard deviation s as well.
Compute the Standard Error
For a mean (σ known): SE = σ/√n. For a mean (σ unknown): SE = s/√n. For a proportion: SE = √[p̂(1−p̂)/n]. The standard error measures how much your sample statistic would vary across different samples of the same size — smaller n means larger SE and a wider interval. See the sampling distributions guide for more.
Find the Critical Value
Use z* when σ is known or n > 30: for 95% CI, z* = 1.96; for 99% CI, z* = 2.576. Use t* when σ is unknown: look up t* in the t-table with df = n − 1 at the C% confidence level. For example, with n = 15 (df = 14) and C = 95%, t* = 2.145. The difference between z* and t* shrinks as n increases — at df = ∞, t* = z*.
Compute the Interval and Interpret
Margin of error ME = critical value × SE. Interval: (point estimate − ME, point estimate + ME). Interpretation: "We are C% confident that the true [parameter name] lies between [lower bound] and [upper bound]." Always include units. Never say "there is a C% chance the true mean is in this interval."
Confidence Interval Examples — 8 Fully Solved
Each example follows the same 5-step structure. All arithmetic is shown in full. Datasets are original, and all critical values come from standard statistical tables as referenced by the NIST Engineering Statistics Handbook.
Example 1 — Z-Interval for a Mean (σ Known)
Problem: A standardized exam is known to have a population standard deviation of σ = 12 points. A random sample of 40 students produces a mean score of x̄ = 78.5. Construct a 95% confidence interval for the true population mean score.
x̄ = 78.5
σ = 12
n = 40
z* = 1.960 (95%)
Parameter and confidence level: Estimating the population mean μ (exam score). C = 95%, so α = 0.05 and z* = 1.960. Assume the sample is random and n = 40 ≥ 30 (CLT applies).
Point estimate: x̄ = 78.5 points (given directly).
Standard error: SE = σ/√n = 12/√40 = 12/6.325 = 1.897
Critical value: z* = 1.960 for a 95% confidence interval (from the z-table).
Interval:
ME = 1.960 × 1.897 = 3.718
Lower: 78.5 − 3.718 = 74.78
Upper: 78.5 + 3.718 = 82.22
✅ 95% CI: (74.78, 82.22) points. We are 95% confident that the true population mean exam score lies between 74.78 and 82.22 points.
Example 2 — T-Interval for a Mean (σ Unknown)
Problem: A nutritionist measures daily calorie intake for a random sample of 16 adults: x̄ = 2,080 kcal and s = 340 kcal. The population standard deviation is unknown. Construct a 95% confidence interval for the true mean daily intake.
x̄ = 2,080
s = 340
n = 16
df = 15
t* = 2.131
Parameter and level: Estimating μ (mean calorie intake). C = 95%. σ is unknown and n = 16 ≤ 30 → use the t-distribution with df = 16 − 1 = 15. From the t-table: t*(15, 95%) = 2.131.
Point estimate: x̄ = 2,080 kcal.
Standard error: SE = s/√n = 340/√16 = 340/4 = 85.0 kcal
Critical value: t*(df=15, 95%) = 2.131
Interval:
ME = 2.131 × 85.0 = 181.1 kcal
Lower: 2,080 − 181.1 = 1,898.9
Upper: 2,080 + 181.1 = 2,261.1
✅ 95% CI: (1,898.9, 2,261.1) kcal. We are 95% confident the true mean daily calorie intake of adults in this population falls between 1,899 and 2,261 kcal/day.
Example 3 — 95% Confidence Interval for a Proportion (Election Poll)
Problem: A polling organization surveys 850 registered voters and finds that 476 support Candidate A. Construct a 95% confidence interval for the true proportion of voters who support Candidate A.
p̂ = 476/850 = 0.560
z* = 1.960
n = 850
Parameter and level: Estimating population proportion p (voter support). C = 95%, z* = 1.960. Check success-failure: np̂ = 850 × 0.560 = 476 ≥ 10 ✓ and n(1−p̂) = 850 × 0.440 = 374 ≥ 10 ✓.
Point estimate: p̂ = 476/850 = 0.560 (56.0%)
Standard error: SE = √[0.560 × 0.440 / 850] = √[0.2464/850] = √0.0002899 = 0.01703
Critical value: z* = 1.960 (95% CI)
Interval:
ME = 1.960 × 0.01703 = 0.0334 (3.34 percentage points)
Lower: 0.560 − 0.0334 = 0.527
Upper: 0.560 + 0.0334 = 0.593
✅ 95% CI: (52.7%, 59.3%). We are 95% confident the true proportion of voters supporting Candidate A is between 52.7% and 59.3%. Since the entire interval exceeds 50%, the data provides evidence that Candidate A has majority support.
Example 4 — 99% Confidence Interval for a Mean
Problem: A pharmaceutical company tests a new blood pressure drug on 25 patients. The sample shows a mean reduction of x̄ = 8.4 mmHg with s = 3.2 mmHg. Construct a 99% confidence interval for the mean reduction in blood pressure.
Parameter: μ = mean blood pressure reduction. C = 99%, σ unknown, n = 25 → t-interval with df = 24. From the t-table: t*(24, 99%) = 2.797. See hypothesis testing examples for comparison.
Point estimate: x̄ = 8.4 mmHg
Standard error: SE = 3.2/√25 = 3.2/5 = 0.64 mmHg
Critical value: t*(24, 99%) = 2.797
Interval:
ME = 2.797 × 0.64 = 1.790 mmHg
Lower: 8.4 − 1.790 = 6.61
Upper: 8.4 + 1.790 = 10.19
✅ 99% CI: (6.61, 10.19) mmHg. We are 99% confident the drug reduces blood pressure by between 6.61 and 10.19 mmHg on average. The entire interval is positive, which confirms a statistically significant reduction at the 1% level.
Example 5 — Manufacturing Quality Control
Problem: A precision machining plant produces steel bolts. A quality inspector samples 64 bolts and measures their diameters: x̄ = 10.002 mm, s = 0.018 mm. The target diameter is 10.000 mm. Construct a 99% confidence interval for the true mean diameter.
Parameter and level: μ = mean bolt diameter. C = 99%, σ unknown, n = 64. Since n = 64 > 30, either z* or t* may be used; the t-approach with df = 63 is conservative. t*(63, 99%) ≈ 2.656. With z*, we would use z* = 2.576; results are nearly identical at this sample size.
Point estimate: x̄ = 10.002 mm
Standard error: SE = 0.018/√64 = 0.018/8 = 0.00225 mm
Critical value: Using z* = 2.576 for 99% (large n approximation).
Interval:
ME = 2.576 × 0.00225 = 0.00580 mm
Lower: 10.002 − 0.00580 = 9.9962 mm
Upper: 10.002 + 0.00580 = 10.0078 mm
✅ 99% CI: (9.9962, 10.0078) mm. We are 99% confident the true mean bolt diameter falls between 9.9962 mm and 10.0078 mm. Since the target value of 10.000 mm falls within this interval, the manufacturing process is within specification — no adjustment is needed.
Example 6 — Small Sample T-Interval (n = 9)
Problem: An environmental researcher measures nitrate levels (mg/L) in 9 water samples from a river: 3.1, 4.2, 2.8, 3.9, 4.5, 3.3, 4.1, 3.7, 3.5. Construct a 95% confidence interval for the true mean nitrate level. Assume normality.
Parameter: μ = mean river nitrate level. C = 95%. σ unknown, n = 9 (small sample) → t-interval with df = 8. t*(8, 95%) = 2.306.
Point estimate:
Sum = 3.1+4.2+2.8+3.9+4.5+3.3+4.1+3.7+3.5 = 33.1
x̄ = 33.1/9 = 3.678 mg/L
Standard deviation and SE:
Deviations from 3.678: (−0.578, 0.522, −0.878, 0.222, 0.822, −0.378, 0.422, 0.022, −0.178)
Σ(xᵢ−x̄)² ≈ 0.334+0.272+0.771+0.049+0.676+0.143+0.178+0.000+0.032 = 2.455
s = √(2.455/8) = √0.3069 = 0.554 mg/L
SE = 0.554/√9 = 0.554/3 = 0.185 mg/L
Critical value: t*(8, 95%) = 2.306
Interval:
ME = 2.306 × 0.185 = 0.427 mg/L
Lower: 3.678 − 0.427 = 3.251
Upper: 3.678 + 0.427 = 4.105
✅ 95% CI: (3.25, 4.11) mg/L. We are 95% confident the true mean nitrate concentration in the river is between 3.25 and 4.11 mg/L. If the regulatory limit is 4.0 mg/L and the upper bound exceeds it, further testing or remediation should be considered.
Example 7 — Confidence Interval for a Difference in Means
Problem: A researcher compares the effectiveness of two study methods. Group A (traditional): n₁ = 30, x̄₁ = 72.4, s₁ = 9.8. Group B (active learning): n₂ = 30, x̄₂ = 78.1, s₂ = 10.3. Construct a 95% CI for the mean difference μ₂ − μ₁ (assuming equal variances are not assumed).
Parameter: μ₂ − μ₁ = difference in mean scores. C = 95%. Using the Welch approximation; df is approximated (Satterthwaite formula gives df ≈ 57). t*(57, 95%) ≈ 2.003. For comparison, see the two-sample t-test guide.
Point estimate: x̄₂ − x̄₁ = 78.1 − 72.4 = 5.7 points
Standard error: SE = √(9.8²/30 + 10.3²/30) = √(3.201 + 3.536) = √6.737 = 2.596
Critical value: t*(57, 95%) ≈ 2.003
Interval:
ME = 2.003 × 2.596 = 5.200
Lower: 5.7 − 5.200 = 0.50
Upper: 5.7 + 5.200 = 10.90
✅ 95% CI: (0.50, 10.90) points. We are 95% confident that active learning students score between 0.50 and 10.90 points higher than traditional students on average. Because the interval does not include zero, the difference is statistically significant at the 5% level.
Example 8 — 99% Confidence Interval for a Proportion (Customer Satisfaction)
Problem: A retail company surveys 600 customers and finds that 426 are satisfied with their service. Construct a 99% confidence interval for the true proportion of satisfied customers.
Parameter: p = proportion of satisfied customers. C = 99%, z* = 2.576. Check: np̂ = 600 × 0.710 = 426 ≥ 10 ✓; n(1−p̂) = 600 × 0.290 = 174 ≥ 10 ✓.
Point estimate: p̂ = 426/600 = 0.710 (71.0%)
Standard error: SE = √[0.710 × 0.290 / 600] = √[0.2059/600] = √0.000343 = 0.01853
Critical value: z* = 2.576 (99% CI)
Interval:
ME = 2.576 × 0.01853 = 0.04772 (4.77 percentage points)
Lower: 0.710 − 0.04772 = 0.662
Upper: 0.710 + 0.04772 = 0.758
✅ 99% CI: (66.2%, 75.8%). We are 99% confident that between 66.2% and 75.8% of all customers are satisfied with the service. The wider interval compared to a 95% CI reflects the additional certainty demanded by the 99% confidence level.
Which Confidence Interval Formula to Use
Choosing the wrong formula is the most frequent source of errors in CI problems. This decision guide covers every standard case you will encounter in introductory and intermediate statistics.
CI Formula Decision Guide
Comparison Tables
Z-Interval vs. T-Interval
| Z-Interval | T-Interval | |
|---|---|---|
| When to use | σ known, or n > 30 | σ unknown, any n (with normality) |
| Critical value source | Standard normal table (z-table) | t-distribution table (t-table) |
| Critical value at 95% | z* = 1.960 (fixed) | t* varies with df (e.g., 2.262 at df=9) |
| Interval width | Narrower (less uncertainty) | Wider (accounts for estimating σ) |
| As n → ∞ | — | t* → z* = 1.960 |
| Distribution shape | Standard normal | Heavier tails than normal |
CI for Mean vs. CI for Proportion
| Mean CI | Proportion CI | |
|---|---|---|
| Parameter estimated | Population mean μ | Population proportion p |
| Point estimate | Sample mean x̄ | Sample proportion p̂ = x/n |
| Standard error | s/√n (or σ/√n) | √[p̂(1−p̂)/n] |
| Critical value | z* or t* | Always z* |
| Key assumption | Approx. normal sampling dist. | np̂ ≥ 10 and n(1−p̂) ≥ 10 |
| 95% ME formula | 1.96 × s/√n | 1.96 × √[p̂(1−p̂)/n] |
Confidence Level vs. Interval Width
| Confidence Level | z* | ME (Example: SE = 2.0) | Interval Width |
|---|---|---|---|
| 90% | 1.645 | 3.29 | 6.58 |
| 95% | 1.960 | 3.92 | 7.84 |
| 98% | 2.326 | 4.65 | 9.30 |
| 99% | 2.576 | 5.15 | 10.30 |
Higher confidence demands a wider interval. This is not a flaw in the method — it reflects the fundamental trade-off between certainty and precision. Researchers choose 95% as the standard balance between the two. For comparisons, see confidence interval vs. margin of error.
What Affects Confidence Interval Width?
Three factors determine how wide or narrow a confidence interval is, and each one has a practical interpretation.
This has direct consequences for study design. If you need a CI no wider than ±3 units with 95% confidence and σ ≈ 15, you can solve for the required sample size: ME = z* × σ/√n → 3 = 1.96 × 15/√n → √n = 9.8 → n ≥ 97. This calculation is covered in the sample size calculator.
Real-Life Applications of Confidence Intervals
Confidence intervals appear across every field that draws conclusions from sample data. The examples below show how the same procedure applies to different contexts. More domain-specific applications are covered in the clinical trials guide and the A/B testing guide.
Election Polling
When a news outlet reports "54% ± 3%," the ±3 is the margin of error from a CI for a proportion. The full interval is (51%, 57%).
Clinical Trials
Drug approvals require reporting CI for treatment effect size. A 95% CI for mean reduction that excludes zero confirms efficacy. See clinical trial statistics.
Quality Control
Manufacturers use CIs to confirm product dimensions stay within tolerance. If the CI for mean diameter falls inside spec limits, the batch passes.
A/B Testing
Tech companies build CIs for conversion rate differences between variants. If the CI for (B − A) excludes zero, variant B is declared a winner. See the A/B test calculator.
Finance
Portfolio managers report CIs for expected returns. A 95% CI for annual return of (7.2%, 12.4%) quantifies the range of plausible outcomes. See portfolio statistics.
Biostatistics
Epidemiologists report 95% CIs for incidence rates and risk ratios. An RR of 2.1 (95% CI: 1.4, 3.2) means the risk is about double, with the true ratio likely between 1.4× and 3.2×. See incidence vs. prevalence.
Confidence Interval Calculator
Confidence Interval Calculator — Mean & Proportion
Confidence Interval Formula Cheat Sheet
| Interval Type | Formula | Critical Value | Key Condition |
|---|---|---|---|
| Mean (σ known) | x̄ ± z*(σ/√n) | z* from z-table | σ known; n large or data normal |
| Mean (σ unknown) | x̄ ± t*(s/√n) | t* from t-table, df = n−1 | σ unknown; data approx. normal |
| Proportion | p̂ ± z*√[p̂(1−p̂)/n] | z* from z-table | np̂ ≥ 10 and n(1−p̂) ≥ 10 |
| Difference of means | (x̄₁−x̄₂) ± t*·√(s₁²/n₁+s₂²/n₂) | t* (Welch df) | Independent random samples |
| Paired means | d̄ ± t*(s_d/√n) | t*, df = n−1 | Paired differences are normal |
| Difference of props | (p̂₁−p̂₂) ± z*·√[p̂₁(1−p̂₁)/n₁ + p̂₂(1−p̂₂)/n₂] | z* = 1.960 (95%) | Success-failure for both groups |
Entity & Formula Glossary
| Symbol | Name | Definition |
|---|---|---|
| CI | Confidence Interval | A range of values constructed from sample data that captures the true parameter a specified proportion of the time across repeated samples. |
| μ | Population Mean | The true average of the entire population — what the CI is trying to estimate. |
| x̄ | Sample Mean | The average of the sample values; the point estimate of μ. |
| p | Population Proportion | The true fraction of the population with a given characteristic. |
| p̂ | Sample Proportion | x/n — the fraction of successes in the sample; the point estimate of p. |
| σ | Population SD | Known standard deviation of the population (rarely known in practice). |
| s | Sample SD | Estimate of σ calculated from the sample: s = √[Σ(xᵢ−x̄)²/(n−1)]. |
| SE | Standard Error | The standard deviation of the sampling distribution of the point estimate. Decreases as n increases. |
| ME | Margin of Error | Half the interval width. ME = critical value × SE. |
| z* | Critical Z-value | The z-score that cuts off (1−C)/2 in each tail of the standard normal. At 95%: z* = 1.960. |
| t* | Critical T-value | The t-score from the t-distribution with df = n−1 that cuts off (1−C)/2 in each tail. Larger than z* for small df. |
| df | Degrees of Freedom | n−1 for one-sample t-intervals. Controls the shape of the t-distribution. See degrees of freedom guide. |
| C | Confidence Level | The long-run proportion of intervals that contain the true parameter (e.g., 95%). |
| α | Significance Level | α = 1 − C. The probability the procedure produces an interval that misses the true parameter. |
| n | Sample Size | Number of observations in the sample. Larger n → smaller SE → narrower interval. |
Common Mistakes & Misconceptions
| Mistake | Incorrect Statement | Correct Statement |
|---|---|---|
| Probability misinterpretation | "There is a 95% probability the mean is between 74 and 83." | "We are 95% confident the true mean lies between 74 and 83." (The mean is fixed; probability applies to the procedure.) |
| Using z* when σ is unknown (small n) | CI = x̄ ± 1.96 × (s/√n) with n = 10 | CI = x̄ ± t*(df=9) × (s/√n) with t* = 2.262 for 95% CI |
| Forgetting the success-failure condition | Computing a proportion CI with p̂ = 0.02 and n = 30 (np̂ = 0.6 < 10) | The normal approximation is invalid; use an exact method (e.g., Clopper-Pearson interval) instead. |
| Confusing CI width with accuracy | "A wider CI is more accurate." | A wider CI is more certain but less precise. Accuracy and width are different concepts. |
| Interpreting a non-significant CI incorrectly | "Since the CI includes zero, the true effect is zero." | "Since the CI includes zero, zero is a plausible value — we cannot rule it out, but we cannot confirm it either." |
| Conflating 95% CI with prediction interval | "95% of individual data points fall in the CI." | The CI captures the population mean, not individual observations. A prediction interval is wider and covers individual future values. |
Frequently Asked Questions
Point Estimate ± Margin of Error, where the margin of error equals the critical value multiplied by the standard error.
x̄) and sample standard deviation (s). Next, compute the standard error using SE = s / √n. Then find the appropriate critical value from the t-distribution (or use 1.96 for a z-interval when the population standard deviation is known). Multiply the critical value by the standard error to obtain the margin of error, and finally calculate the confidence interval as (x̄ − ME, x̄ + ME).
Confidence Interval = Point Estimate ± Margin of Error.
1/√n, reducing the width of a confidence interval by half requires approximately four times as many observations. Larger samples therefore produce more precise estimates.
Sources & Further Reading
All formulas and critical values in this guide follow the standards established by:
- NIST Engineering Statistics Handbook — Confidence Intervals
- OpenStax Introductory Statistics, Chapter 8: Confidence Intervals
- Pew Research Center — Understanding the Margin of Error in Election Polls
- BMJ Statistics at Square One — Confidence Intervals
- Neyman, J. (1937). "Outline of a Theory of Statistical Estimation Based on the Classical Theory of Probability." Philosophical Transactions of the Royal Society A, 236, 333–380.
- Penn State STAT 415: Introduction to Mathematical Statistics
For related statistical inference topics on Statistics Fundamentals, see the hypothesis testing guide, sampling distributions, and the statistical interpretation guide.