Confidence Interval Calculator

Calculate confidence intervals for means and proportions.

What is a Confidence Interval?

A confidence interval provides a range of plausible values for an unknown population parameter based on sample data. Instead of giving a single estimate, it quantifies the uncertainty in your estimate.

The interval has the form: point estimate ± margin of error

Confidence Level

The confidence level (commonly 90%, 95%, or 99%) represents how often the interval would contain the true parameter if we repeated the sampling process many times.

A 95% confidence interval does NOT mean there’s a 95% probability the parameter is in the interval. It means 95% of similarly constructed intervals would contain the parameter.

Types of Confidence Intervals

Z-Interval (\( \sigma \) known)

When the population standard deviation is known:

$$ \bar{x} \pm z^* \cdot \frac{\sigma}{\sqrt{n}} $$

T-Interval (\( \sigma \) unknown)

When using the sample standard deviation:

$$\bar{x} \pm t^* \cdot \frac{s}{\sqrt{n}}$$

The t-distribution has heavier tails, giving wider intervals to account for the extra uncertainty.

Proportion Interval

For estimating population proportions:

$$\hat{p} \pm z^* \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}$$

Critical Values

Confidence\( z^* \)\( t^* \) \(df=29\)
90%1.6451.699
95%1.9602.045
99%2.5762.756

Factors Affecting Interval Width

Sample Size

Larger samples give narrower intervals (\( \sqrt{n} \) in the denominator).

Confidence Level

Higher confidence requires wider intervals.

Variability

More variable data gives wider intervals.

Interpreting the Interval

  • Correct: “We are 95% confident that the true population mean is between 45 and 55.”
  • Incorrect: “There is a 95% probability that the population mean is between 45 and 55.”

The parameter is fixed (not random). The interval either contains it or doesn’t.

Sample Size Determination

To achieve a desired margin of error ( E ):

$$n = \left( \frac{z^* \cdot \sigma}{E} \right)^2$$

Double the precision requires four times the sample size.

Assumptions

For Mean Intervals

  • Random sample
  • Normal population OR large sample (\( n \geq 30 \))
  • For t-interval: no extreme outliers

For Proportion Intervals

  • Random sample
  • \( np \geq 10 \) and \( n(1-p) \geq 10 \) (success/failure condition)

Frequently Asked Questions

What is a confidence interval?

A confidence interval is a range of values that’s likely to contain the true population parameter. A 95% confidence interval means that if you repeated the sampling 100 times, about 95 of the resulting intervals would contain the true value.

What’s the formula for a confidence interval for the mean?

CI = x̄ ± z_(α/2) · (σ / √n) when the population standard deviation σ is known, or x̄ ± t_(α/2, n-1) · (s / √n) when only the sample standard deviation s is available.

When do I use z vs t distribution?

Use z when σ is known or n ≥ 30. Use t when σ is unknown and n < 30. The t-distribution has heavier tails to account for extra uncertainty from estimating σ from a small sample.

What does a 95% confidence level actually mean?

It refers to the long-run frequency of intervals containing the true parameter, not the probability that any single interval contains it. Once you’ve computed the interval, the parameter is either in it or not — it’s not random.

How does sample size affect the interval width?

Width shrinks as 1/√n. Quadrupling your sample size halves the margin of error. This is why doubling sample size has diminishing returns past a point.

Can I compute a confidence interval for a proportion?

Yes. The formula is p̂ ± z_(α/2) · √(p̂(1−p̂)/n). The calculator switches between mean and proportion modes — pick the one that matches your data.

What’s the relationship between CI and hypothesis testing?

If a 95% CI excludes the null value, the corresponding two-tailed test rejects at α = 0.05. CIs convey effect size and uncertainty in one shot — they’re more informative than a bare p-value.

Why do common confidence levels stop at 99%?

Higher levels (99.9%, 99.99%) require dramatically wider intervals for marginal gains in coverage probability. 90/95/99 covers most practical decisions; beyond that, the interval becomes too wide to be useful.