Confidence Interval Calculator — Mean, Proportion & Margin of Error
Calculate confidence intervals for means and proportions. Choose 90%, 95%, or 99% confidence levels with margin of error, z-score, and interpretation guide.
When you hear "a poll found 52% support, ±3%" — that "±3%" is a confidence interval. It's an honest acknowledgment that sample data gives you an estimate, not a certainty, and here's how wide the uncertainty is. The CalcHub Confidence Interval Calculator computes intervals for both means and proportions, for any confidence level you choose.
Two Types of Confidence Intervals
1. Interval for a population mean — when your data is continuous measurements (heights, weights, response times). 2. Interval for a proportion — when your data is a percentage or count (approval ratings, defect rates, survey responses).For a Population Mean
Formula:CI = x̄ ± z* × (σ / √n) [known population SD]
CI = x̄ ± t* × (s / √n) [estimated from sample SD]
Where:
- x̄ = sample mean
- σ or s = standard deviation
- n = sample size
- z or t = critical value for your confidence level
Example: 50 patients, mean recovery time = 14.2 days, SD = 3.1 days, 95% CI:
z* = 1.96 (for 95%)
Margin of error = 1.96 × (3.1 / √50) = 1.96 × 0.438 = 0.86
CI: 13.34 to 15.06 days
For a Proportion
Formula:Example: 400 voters surveyed, 52% favor a candidate, 95% CI:CI = p̂ ± z* × √(p̂(1 − p̂) / n)
p̂ = 0.52, n = 400
SE = √(0.52 × 0.48 / 400) = √(0.000624) ≈ 0.02498
Margin of error = 1.96 × 0.025 = 0.049
CI: 47.1% to 57.1% (roughly ±5%)
Critical Values by Confidence Level
| Confidence Level | z* Value | What It Means |
|---|---|---|
| 90% | 1.645 | You'd be wrong 1 in 10 times |
| 95% | 1.960 | You'd be wrong 1 in 20 times |
| 99% | 2.576 | You'd be wrong 1 in 100 times |
How to Use the Calculator
- Select Mean or Proportion.
- Enter: sample mean (or proportion), standard deviation (or leave blank for proportion), sample size.
- Choose confidence level (90%, 95%, 99%, or custom).
- Click Calculate — the interval, margin of error, and critical value all appear.
What a 95% Confidence Interval Actually Means
This is the most misunderstood part. A 95% CI does NOT mean "there's a 95% chance the true value falls in this interval." The true value either is in the interval or it isn't — probability doesn't apply to a fixed (if unknown) parameter.
What it actually means: if you repeated your study many times and calculated a 95% CI each time, about 95% of those intervals would contain the true value.
In practice, people treat it as "we're 95% confident the true value is somewhere in here," which is a workable interpretation even if statistically imprecise.
Effect of Sample Size
| Sample Size | Margin of Error (95%, p=0.5) |
|---|---|
| 50 | ±13.9% |
| 100 | ±9.8% |
| 400 | ±4.9% |
| 1,000 | ±3.1% |
| 2,500 | ±2.0% |
What's the difference between a confidence interval and a prediction interval?
A confidence interval estimates where the population mean falls. A prediction interval estimates where a single new observation will fall. Prediction intervals are always wider because they account for individual variation, not just uncertainty about the mean.
When should I use t instead of z?
Use t* when sample size is small (typically n < 30) and/or you're estimating the population SD from your sample. The t-distribution has heavier tails than the normal, which gives you a wider (more conservative) interval to compensate for the extra uncertainty.
My 95% CI includes zero — what does that mean?
If you're calculating a CI for a difference or an effect, including zero means the data are consistent with "no effect." This is essentially the same conclusion you'd reach with a hypothesis test at the 5% significance level — the result is "not statistically significant."
Related calculators: Z-Score Calculator · Sample Size Calculator · Standard Deviation Calculator