Confidence Interval Calculator
Compute the margin of error around a sample mean for a 90%, 95%, or 99% confidence interval using the z-distribution. The half-width of the CI tells you how precisely your sample estimates the population mean — essential for survey reporting, scientific publication, and any inference.
Last updated: May 2026
Compare with similar
About this calculator
The margin of error (MoE) for a confidence interval on the mean is MoE = z* × (s / √n), where z* is the critical value from the standard normal distribution for the chosen confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%), s is the sample standard deviation, and n is the sample size. The full confidence interval is x̄ ± MoE, where x̄ is the sample mean. The MoE depends on three things: the confidence level (higher levels give wider intervals because more ‘unusual’ values from the sampling distribution must be included), the sample standard deviation (more variable data → larger MoE), and the sample size (larger n → smaller MoE via the standard error s/√n). Doubling n shrinks MoE by √2 ≈ 1.41; quadrupling n halves it. The interpretation of a 95% CI: if you repeated the sampling procedure many times under identical conditions, 95% of resulting confidence intervals would contain the true population mean. It is NOT a 95% probability that the specific computed interval contains the true mean (that would be a Bayesian credible interval, requiring a prior). Variables: x̄ = sample mean; n = sample size; s = sample standard deviation; confidenceLevel selects z*. Edge cases: this calculator uses the z-distribution, which is the right reference for large samples (n ≥ 30) or known σ. For small samples with unknown σ, use the t-distribution with df = n − 1; the t critical value is larger than z* and the resulting MoE is wider. Very small n (< 10) makes both the SD estimate and the CI itself highly uncertain — wider intervals reflect this honestly. For proportions, use a binomial-based or Wilson-score CI instead, not this mean-CI formula.
How to use
Example 1 — 95% CI on a survey of 100 respondents. You measure customer satisfaction in n = 100 people: x̄ = 7.2 (out of 10), s = 1.5. For 95% CI: z* = 1.96. MoE = 1.96 × (1.5 / √100) = 1.96 × 0.15 = 0.294. ✓ 95% CI is x̄ ± MoE = 7.2 ± 0.294, or [6.91, 7.49]. Interpretation: if you repeated this survey many times, 95% of resulting intervals would contain the true population satisfaction. Example 2 — 99% CI with smaller sample. Now you have n = 25 measurements with x̄ = 50.4 and s = 8.0. For 99% CI: z* = 2.576. MoE = 2.576 × (8.0 / √25) = 2.576 × 1.6 = 4.12. ✓ 99% CI is 50.4 ± 4.12, or [46.28, 54.52]. Compare with 95% CI: MoE_95 = 1.96 × 1.6 = 3.14, giving [47.26, 53.54] — a tighter interval at the cost of weaker confidence. The 99% interval is about 31% wider than the 95% interval, reflecting the trade-off between coverage probability and precision.
Frequently asked questions
What does a 95% confidence interval actually mean?
It is a statement about the procedure, not the specific interval: if you repeated the entire sampling-and-CI-computation process many times under identical conditions, 95% of resulting intervals would contain the true population parameter. The specific CI you have either contains the true mean or it doesn’t — there is no probability statement about that one interval in frequentist statistics. This is one of the most commonly misunderstood concepts in statistics; the natural reading ‘the true mean has a 95% chance of being in this interval’ is a Bayesian credible interval, which requires a prior distribution this calculation never sees. Practically, CIs serve as honest uncertainty estimates around point estimates: a wide CI says ‘we don’t know the population mean very precisely’; a narrow CI says ‘we know it fairly well’. Always pair point estimates with CIs in reporting — the CI is what reviewers and readers need to assess the reliability of any conclusion.
When should I use a t-distribution instead of z?
Use the t-distribution when the population standard deviation σ is unknown and the sample size is small (n < 30 as a rule of thumb). The t-distribution has heavier tails than the normal, producing wider CIs to account for the extra uncertainty from estimating σ from a small sample. At n = 10 (df = 9), the 95% t critical value is 2.262 versus z = 1.96 for the normal — about 15% wider CI. As n grows the t-distribution converges to the normal: at n = 30 (df = 29), t_0.025 = 2.045, only 4% higher than z = 1.96. At n = 100, the difference is negligible. This calculator uses z critical values for simplicity; for rigorous small-sample work, switch to a t-distribution CI calculator. For very small samples (n < 10) the CI is so wide that any reported point estimate carries weak weight regardless of method.
Why does the confidence interval get wider as confidence level increases?
A higher confidence level demands that more of the sampling distribution’s mass be included in the interval. A 95% CI excludes the most extreme 2.5% on each tail; a 99% CI excludes only 0.5% on each tail, requiring the interval to extend further to cover the additional 4% of values. This is a fundamental trade-off: you can have a precise CI (narrow) or a high-confidence CI (wide), but not both at the same n. To get both, you need a larger sample. Quantitatively, the 99% CI is about 31% wider than the 95% CI at the same n. To have a 99% CI as narrow as a 95% CI requires roughly 1.31² ≈ 1.72× the sample size. This is why 95% became the standard convention: a reasonable balance between precision and confidence for most scientific applications.
What are the most common mistakes people make with confidence intervals?
The first is interpreting CIs probabilistically: ‘95% chance the true mean is in [a, b]’ is wrong — frequentist CIs are statements about the procedure, not the specific interval. The second is using a z-CI on a small sample where a t-CI is required; the z-CI understates uncertainty and produces falsely narrow intervals. The third is comparing two CIs visually to test significance: overlapping 95% CIs do NOT mean groups are not significantly different — the proper test requires a CI on the difference. The fourth is using mean-CI formulas on proportions, which need binomial or Wilson-score CIs instead. The fifth is reporting only the point estimate without the CI — this hides uncertainty and is increasingly discouraged in scientific publication. The sixth is computing CIs on non-random or biased samples, where the assumed sampling-distribution structure doesn’t hold. And the seventh is mistaking ‘this CI overlaps zero’ for ‘the effect is exactly zero’ — a CI is an uncertainty range, not a binary verdict.
When should I not use this calculator?
Skip it for confidence intervals on proportions — those require binomial-based formulas (Wald, Wilson score, or exact Clopper-Pearson), not the mean-CI formula. Avoid it for very small samples (n < 30) with unknown σ; use a t-distribution CI calculator instead of the z-based critical values here. It is the wrong tool for CIs on regression coefficients, correlations, odds ratios, hazard ratios, or other non-mean statistics — each has its own SE formula. Do not use it for non-random or clustered samples without applying a design effect; the simple n in the denominator assumes simple random sampling. Skip it for heavily skewed data with small samples, where bootstrap CIs are more accurate than parametric formulas. And do not use a single CI as a stand-alone gate without considering effect size, sample size, and the substantive importance of the estimated quantity — uncertainty is one piece of the picture, not the whole story.