Confidence Interval Calculator

Calculate confidence intervals for population parameters.

For Mean

For Proportion

Confidence Interval
—
Enter sample data and confidence level
Lower Bound
—
Upper Bound
—
Margin of Error
—
Critical Value
—

Quick Examples

Confidence Intervals

A confidence interval provides a range of values that likely contains the true population parameter with a specified level of confidence.

CI = point estimate ± margin of error

For Population Mean

CI = x̄ ± Z*(σ/√n) or x̄ ± t*(s/√n)

Use Z when σ is known and n is large; use t-distribution otherwise.

For Population Proportion

CI = p̂ ± Z*√(p̂(1-p̂)/n)

Critical Values

Confidence LevelZ-Critical Value
90%1.645
95%1.96
99%2.576
99.9%3.291

What a Confidence Level Really Means

A 95% confidence interval does not mean there is a 95% chance the true parameter lies inside this particular interval. It means the procedure is reliable: if you repeated the sampling 100 times and built an interval each time, about 95 of those intervals would capture the true value. The one interval in front of you either contains it or does not — the 95% describes the method, not the interval. This is the most misunderstood idea in the topic.

Margin of Error and Standard Error

Every confidence interval is a point estimate plus or minus a margin of error:

Margin of error = critical value × standard error

The standard error measures how much the estimate itself wobbles from sample to sample. For a mean it is σ/√n (or s/√n); for a proportion it is √(p̂(1−p̂)/n). Larger samples shrink the standard error — quadrupling n halves the interval's width.

Worked Examples

Example 1: Mean, 95% confidence

A sample of 64 packages averages 50 g with a standard deviation of 8 g. Standard error = 8/√64 = 1. Margin of error = 1.96 × 1 = 1.96. The 95% confidence interval is 50 ± 1.96, or (48.04, 51.96) grams.

Example 2: Proportion, 95% confidence

In a survey of 400 voters, 240 support a proposal, so p̂ = 0.60. Standard error = √(0.60×0.40/400) ≈ 0.0245. Margin of error = 1.96 × 0.0245 ≈ 0.048. The 95% interval is 0.60 ± 0.048, or (0.552, 0.648) — support lies between about 55.2% and 64.8%.

Z or t?

Use the z critical value when the population standard deviation σ is known, or when the sample is large (n > 30) so s ≈ σ. Use the t critical value with n−1 degrees of freedom when σ is unknown and the sample is small — the t interval is wider, honestly reflecting the extra uncertainty. With large samples the two converge.

Interpreting Intervals in Plain Language

  • Narrow interval: a precise estimate (large sample, small spread, or lower confidence level).
  • Wide interval: an imprecise estimate — collect more data to tighten it.
  • Higher confidence = wider interval: a 99% interval is always wider than a 95% interval from the same data; certainty costs width.
  • Zero outside the interval: for a difference of means, an interval that excludes zero suggests a real difference.

Common Mistakes

  • The 95%-probability fallacy: a computed interval either contains the parameter or it does not; 95% describes the long-run behavior of the method.
  • Choosing the level after seeing the data: pick 90%, 95%, or 99% before computing.
  • Using z with a small sample and unknown σ: use the t distribution instead, or the interval will be misleadingly narrow.
  • Reading barely-overlapping intervals as "no difference": two 95% intervals that slightly overlap can still differ significantly — test the difference directly.

Quick Answers

Why 95%? Convention, mostly — a balance between precision and reliability. Polling and medicine default to it; physics often demands far more.

Can a confidence interval include negative values? For a mean of positive quantities it can, if the sample is small and noisy — a sign the estimate is too imprecise to be useful, not that negative values are real.

What shrinks a confidence interval? Larger samples, less spread in the data, or a lower confidence level.

What Makes an Interval Wider or Narrower

ChangeEffect on widthWhy
Larger sample (n up)NarrowerStandard error shrinks as 1/√n
Higher confidence (95% → 99%)WiderLarger critical value
More spread in the dataWiderLarger standard error

To halve an interval's width, you must quadruple the sample size — precision gets expensive.

One-Sided vs Two-Sided Intervals

Two-sided intervals (the default) bound the parameter on both sides. A one-sided interval bounds it on one side only, for questions like "is the failure rate at most 5%?" or "is the average at least the target?" A one-sided 95% bound uses the same critical value as a two-sided 90% interval, because all 5% of the tail sits on one side.

Intervals Beyond Means and Proportions

The estimate ± margin-of-error pattern extends far beyond this page's calculator: differences between two means, regression slopes, correlation coefficients (via Fisher's z-transform), and odds ratios all get confidence intervals built the same way — a point estimate, a standard error, and a critical value. Learning the pattern once pays off across all of statistics.

How to Report a Confidence Interval

In a report, give the estimate first, then the interval: "The mean package weight was 50 g (95% CI: 48.0 to 51.9 g)." Always name the confidence level — an interval without one is incomplete — and keep the units on every number.

More Quick Answers

Does a wider interval mean less confidence? No — width and confidence level are separate. A wide interval at 95% confidence is an honest reflection of limited data.

Can I compare two groups by eye-balling their intervals? Roughly: clearly separated intervals suggest a real difference, but slightly overlapping intervals can still differ significantly — test the difference directly.

Why not always use 99%? Because the interval gets wider and less useful. 95% is the conventional trade-off between reliability and precision.

Frequently Asked Questions

What does 95% confidence mean?
It means if we repeated the sampling process many times, about 95% of the resulting intervals would contain the true population parameter. It does NOT mean there's a 95% chance the parameter is in this interval.
When should I use t-distribution vs Z?
Use t-distribution when the population standard deviation is unknown (using sample SD) or when the sample size is small (n < 30). Use Z when σ is known and n is large.