Confidence Interval Calculator

A confidence interval (CI) is a range of values computed from sample data that likely contains the true population parameter. Enter your sample mean, standard deviation, and sample size — or your proportion data — to instantly calculate 90%, 95%, or 99% confidence intervals with margin of error and standard error.

CI = x̄ ± z × (σ / √n)

Frequently Asked Questions

What is a confidence interval?

A confidence interval (CI) is a range of values that is likely to contain the true population parameter with a specified probability. For example, a 95% confidence interval of [48, 52] means that if you repeated the study many times, 95% of such intervals would contain the true population mean. It is not a statement that there is a 95% chance the true value is in this specific interval.

How do you calculate a 95% confidence interval for a mean?

To calculate a 95% CI for a mean: (1) Compute the standard error: SE = σ / √n. (2) Multiply by the z-score: MOE = 1.960 × SE. (3) Add and subtract from the sample mean: CI = [x̄ − MOE, x̄ + MOE]. For example, with x̄ = 50, σ = 10, n = 100: SE = 1, MOE = 1.96, CI = [48.04, 51.96].

What is the difference between 90%, 95%, and 99% confidence intervals?

Higher confidence levels produce wider intervals. A 90% CI uses z* = 1.645, a 95% CI uses z* = 1.960, and a 99% CI uses z* = 2.576. The 95% level is the industry standard for most research. Use 90% when speed matters more than certainty, and 99% for high-stakes decisions where false positives are very costly.

What is the margin of error?

The margin of error (MOE) is half the width of the confidence interval. It represents the maximum expected difference between the sample estimate and the true population value at the given confidence level. MOE = z* × SE = z* × (σ / √n). For polls, a typical 1,000-person survey has a MOE of ±3% at 95% confidence.

How does sample size affect the confidence interval?

Larger sample sizes produce narrower (more precise) confidence intervals. The standard error is σ/√n, so the CI width decreases proportionally to 1/√n. Doubling the sample size reduces the CI width by about 29%. To halve the margin of error, you need to quadruple the sample size.

How do you calculate a confidence interval for a proportion?

For a proportion (Wald method): (1) Compute p̂ = successes / n. (2) Compute SE = √(p̂(1 − p̂) / n). (3) Apply MOE = z* × SE. (4) CI = [p̂ − MOE, p̂ + MOE], clamped to [0, 1]. For example, 60 successes out of 200 gives p̂ = 30%, and the 95% CI is approximately [23.65%, 36.35%].

What is standard error and how is it different from standard deviation?

Standard deviation (σ) measures the spread of individual data points around the mean. Standard error (SE) measures the precision of the sample mean as an estimate of the population mean. SE = σ / √n. As sample size increases, the standard error decreases even if the standard deviation stays the same, because larger samples give more precise estimates.

When should I use a confidence interval vs. a hypothesis test?

Confidence intervals and hypothesis tests are closely related and often convey the same information. Use a confidence interval when you want to estimate a parameter's plausible range. Use a hypothesis test when you want a binary decision (reject/fail to reject). If a 95% CI for a difference excludes zero, the corresponding hypothesis test at α = 0.05 would reject the null hypothesis. CIs are generally preferred in research because they convey effect size and uncertainty simultaneously.

What is a Confidence Interval?

A confidence interval (CI) is a range of values that likely contains the true population parameter with a specified probability. Instead of reporting a single point estimate (like a sample mean), a confidence interval acknowledges the inherent uncertainty in statistical estimation by providing a plausible range.

For example, a 95% confidence interval of [48, 52] means that if you repeated the study many times and computed a confidence interval each time, approximately 95% of those intervals would contain the true population mean. It does not mean there is a 95% probability the true mean lies in this specific interval — once calculated, the interval either contains the true value or it does not.

Confidence intervals are widely used in scientific research, clinical trials, survey statistics, quality control, and data analysis to communicate the precision of estimates.

Confidence Interval Formula

For the Mean (Known Population SD)

When you know the population standard deviation (σ) or have a large sample (n ≥ 30), use the z-distribution:

Step 1: Calculate Standard Error

SE = σ / √n

where σ = standard deviation, n = sample size

Step 2: Calculate Margin of Error

MOE = z × SE

where z = critical value from the standard normal distribution

Step 3: Calculate CI Bounds

CI = x̄ ± MOE
Lower = x̄ − MOE
Upper = x̄ + MOE

Worked Example

Sample mean x̄ = 50, standard deviation σ = 10, sample size n = 100, confidence level = 95%:

SE = 10 / √100 = 10 / 10 = 1.000
z (95%) = 1.960
MOE = 1.960 × 1.000 = 1.960
Lower = 50 − 1.960 = 48.040
Upper = 50 + 1.960 = 51.960
95% CI = [48.040, 51.960]

Z-Score Critical Values Table

The critical z-value (z*) corresponds to the confidence level. It is the number of standard errors from the mean that captures the central area of the normal distribution equal to the confidence level.

Confidence LevelAlpha (α)α/2Z-Score (z*)
80%0.200.101.282
85%0.150.0751.440
90%0.100.051.645
95% ★0.050.0251.960
99%0.010.0052.576
99.9%0.0010.00053.291

★ Industry standard for most research

How to Interpret a Confidence Interval

Interpreting a confidence interval correctly is one of the most important — and most misunderstood — skills in statistics.

Correct Interpretation

A 95% confidence interval means: if you repeated the sampling procedure many times and constructed a confidence interval from each sample, approximately 95% of those intervals would contain the true population parameter.

Common Misconceptions

  • Wrong:“There is a 95% probability the true mean is in [48, 52].” — The true mean is a fixed value; it either is or is not in the interval.
  • Wrong:“95% of the data falls in this range.” — That describes a prediction interval, not a confidence interval.
  • Right:“I used a procedure that produces intervals containing the true parameter 95% of the time.”

Practical Guidance

  • A narrower CI indicates more precision (larger n or smaller σ)
  • A wider CI indicates more uncertainty (smaller n or larger σ)
  • If a CI for a difference excludes zero, the difference is statistically significant
  • Higher confidence levels produce wider intervals

Understanding Margin of Error

The margin of error (MOE) is half the width of the confidence interval. It quantifies the maximum expected difference between the sample estimate and the true population value at the given confidence level.

The margin of error is computed as:

MOE = z* × (σ / √n)

Factors that reduce the margin of error:

  • Larger sample size (n) — MOE decreases proportionally to 1/√n
  • Smaller population variability (σ) — More homogeneous populations yield tighter intervals
  • Lower confidence level — Trading certainty for precision

In polling, a MOE of ±3% at 95% confidence is typical for 1,000-person surveys. To halve the MOE, you need to quadruple the sample size.

How Sample Size Affects the Confidence Interval

Sample size has a powerful effect on the width of confidence intervals. Because the standard error formula is σ/√n, doubling the sample size reduces the standard error by about 29% (a factor of √2 ≈ 1.414).

Sample Size (n)SE (σ=10)MOE @ 95%95% CI Width
252.0003.9207.840
1001.0001.9603.920
4000.5000.9801.960
1,0000.3160.6201.240

Notice that going from n=25 to n=100 (4× larger) halves the CI width. This diminishing return means very large samples are expensive to collect for marginal precision gains.

Confidence Interval for a Proportion

When estimating a population proportion (e.g., the fraction of voters who support a candidate, or the defect rate in manufacturing), the formula changes slightly because the standard error depends on the proportion itself.

Proportion CI Formula (Wald method)

p̂ = successes / n
SE = √(p̂(1 − p̂) / n)
CI = p̂ ± z* × SE

Example

In a survey of 200 people, 60 prefer product A. What is the 95% CI for the true proportion?

p̂ = 60 / 200 = 0.30 (30%)
SE = √(0.30 × 0.70 / 200) = √(0.00105) ≈ 0.03240
MOE = 1.960 × 0.03240 ≈ 0.06350
Lower = 0.30 − 0.0635 = 23.65%
Upper = 0.30 + 0.0635 = 36.35%
95% CI = [23.65%, 36.35%]

Note: The bounds are clamped to [0, 1] since proportions cannot be negative or exceed 100%. For proportions near 0 or 1, consider the Wilson score interval for better coverage.