Confidence Interval Calculator
Enter the sample mean, standard deviation, sample size, and confidence level to calculate the confidence interval. Shows the margin of error and the upper and lower bounds.
A confidence interval (CI) is a range of plausible values for an unknown population parameter, computed from a sample. Unlike a single point estimate (sample mean), a CI captures the uncertainty inherent in estimating from a sample. The 95% confidence interval is the most common — it's the range that would contain the true population value 95% of the time across repeated sampling.
This calculator returns the confidence interval for a population mean given the sample mean, standard deviation, sample size, and desired confidence level. Margin of error = z × (SD / √n). Lower bound = mean − margin; upper bound = mean + margin. A 95% CI uses z = 1.96 for the multiplier.
Common confusion: the 95% does NOT mean "95% probability the true value is in this interval" (that's a Bayesian statement). It means: if we repeated the sampling process many times, 95% of computed intervals would contain the true value. The interval itself either does or doesn't contain the true value — we just don't know which.
Confidence intervals are the practical alternative to p-values: they show both the magnitude of the effect and the precision of the estimate. A narrow CI = precise estimate; wide CI = uncertain estimate. Both convey more information than significance tests alone.
Inputs
Results
Lower Bound
46.4215
Upper Bound
53.5785
Margin of Error
± 3.5785
Standard Error
1.8257
Z-Value
1.960
Formula
How to use this calculator
- Enter your sample mean.
- Enter sample standard deviation.
- Enter sample size (n).
- Select desired confidence level (90%, 95%, or 99%).
- Calculator returns confidence interval and margin of error.
- For n < 30, this gives approximation; use t-distribution for precise.
Worked examples
Survey response analysis
**Scenario:** Survey of 100 customers shows mean satisfaction 7.5/10. SD: 1.5. Calculate 95% CI. **Calculation:** ME = 1.96 × 1.5 / √100 = 1.96 × 0.15 = 0.29. CI: (7.5 - 0.29, 7.5 + 0.29) = (7.21, 7.79). **Result:** 95% CI: 7.21 to 7.79. We are 95% confident the true mean customer satisfaction in the population is between 7.21 and 7.79. Narrow CI indicates precise estimate with this sample size.
Clinical drug trial
**Scenario:** New drug tested on 60 patients. Mean reduction in symptoms: 25%, SD: 12%. 99% confidence interval needed for FDA submission. **Calculation:** ME = 2.576 × 12 / √60 = 2.576 × 1.549 = 3.99. CI: (25 - 3.99, 25 + 3.99) = (21.01, 28.99). **Result:** 99% CI: 21.0% to 29.0%. We are 99% confident the true symptom reduction is between 21% and 29%. FDA submission notes both the effect (25% reduction) and the precision (4% margin at 99% confidence).
Manufacturing process check
**Scenario:** Sample of 36 parts measures average weight 100.2 g with SD 1.5 g. Calculate 95% CI. **Calculation:** ME = 1.96 × 1.5 / √36 = 1.96 × 0.25 = 0.49. CI: (100.2 - 0.49, 100.2 + 0.49) = (99.71, 100.69). **Result:** 95% CI: 99.71 to 100.69. Manufacturing average is precisely measured (narrow CI of 0.98g). If spec is 100 ± 2, process is well-centered and consistent.
When to use this calculator
**Use confidence intervals for:**
- **Estimating population parameters**: mean, proportion, difference between groups. - **Reporting research findings**: alongside (or instead of) p-values. - **Polling and surveys**: margin of error in poll results. - **Quality control**: process capability estimates. - **Drug trials**: efficacy and safety estimates. - **A/B testing**: comparing conversion rates.
**CI interpretation rules:**
1. **CI captures uncertainty**: wider = more uncertain. 2. **95% means**: across many samples, 95% would contain true value. 3. **Either it does or doesn't**: this specific interval may or may not contain the truth. 4. **Doesn't mean "95% chance"**: the parameter is fixed; only intervals vary.
**Relation to hypothesis testing:**
- **CI excludes 0**: corresponds to p < 0.05 for difference test. - **CI excludes null value**: significant at chosen α level. - **CI overlaps**: not necessarily means no difference (but suggestive).
**Reporting:**
Always include: - Sample mean (point estimate). - Confidence level used. - Confidence interval bounds. - Sample size.
Example: "Mean revenue per customer was $50.20 (95% CI: $46.42–$53.58, n = 100)."
**Sample size considerations:**
- **n = 30**: minimum for normal approximation; t-distribution otherwise. - **n = 100**: typical for surveys. - **n = 1000**: high precision for national polls. - Larger n → narrower CI (precision).
**Margin of error common levels:**
| ME (%) | Required n (for proportion) | |---|---| | 10% | ~100 | | 5% | ~400 | | 3% | ~1067 | | 2% | ~2401 | | 1% | ~9604 |
(For 95% confidence, p = 0.5; this is conservative.)
**Special cases:**
- **Population proportion**: use p (proportion) and √(p(1-p)/n). - **Difference of two means**: combine variances appropriately. - **Regression coefficients**: software calculates automatically. - **Categorical data**: chi-square distribution intervals.
**Common misinterpretations:**
❌ "There's a 95% probability the true mean is between 46.4 and 53.6." ✓ "The true mean is fixed; if we sampled many times, 95% of computed CIs would contain it."
❌ "The CI tells me how confident I am in my data." ✓ "The CI quantifies uncertainty in the estimate of the population parameter."
❌ "Wider CI means worse data." ✓ "Wider CI means less precise estimate; could be due to small sample, more variability, or higher confidence level."
**CI vs prediction interval:**
- **CI**: range for population parameter (mean, proportion). - **Prediction interval**: range for individual future observation. - Prediction interval is wider than CI (more uncertainty for individual values).
**Bootstrapping:**
For non-normal data or complex statistics: - **Bootstrap**: repeated resampling with replacement. - Calculate statistic from each resample. - 2.5th and 97.5th percentiles give 95% CI. - No distribution assumption required.
**Bayesian credible intervals:**
Bayesian framework gives: - **Credible interval**: range where true parameter lies with X% probability. - This IS a probability statement about the parameter. - Different interpretation but similar numerical results often.
**One-sample vs two-sample:**
- **One-sample CI**: estimate single population mean. - **Two-sample CI**: estimate difference between two means. - **Paired sample CI**: estimate difference for matched pairs.
Common mistakes to avoid
- Stating "95% probability true value is in interval." Incorrect frequentist interpretation.
- Using z for small samples. Use t-distribution for n < 30.
- Forgetting to convert CI bounds to original units. Standard CIs are computed in z-units.
- Comparing CIs from different sample sizes directly. Width varies with √n.
- Treating non-overlap as significance test. Use proper t-test for comparison.
- Reporting only point estimate. Always include CI for transparency.
- Confusing CI with prediction interval. CI is for parameter; prediction is for new observation.