Confidence Interval Calculator

Calculate confidence intervals at 90%, 95%, or 99% confidence level from sample mean, standard deviation, and size.

95% Confidence Interval

(48.0400, 51.9600)

50.0000 ± 1.9600

Standard Error (SE = σ/√n)10 / √100 = 1.000000
Z-value1.960
Margin of Error (z × SE)1.96 × 1.0000 = 1.960000
Lower Bound48.040000
Upper Bound51.960000

How to Use the Confidence Interval Calculator

This confidence interval calculator returns the lower and upper bounds around your sample mean for a chosen confidence level. It is the same math used in polling, clinical research, A/B testing dashboards, and manufacturing QC. Enter four numbers and the calculator returns the margin of error, the standard error, and the full interval in one step.

  1. Enter the sample mean (x̄). This is the average of the values in your sample. If your data is 70, 72, 75, 68, 74, the mean is 71.8. Enter that number.
  2. Enter the standard deviation. Use the population standard deviation σ if you know it. If you only have the sample standard deviation s, the 95% confidence interval calculator still gives an accurate answer when n ≥ 30.
  3. Enter the sample size (n). This is the number of observations. Larger n gives a narrower interval, because the standard error σ/√n shrinks as n grows.
  4. Pick a confidence level. 95% is the most common choice in research and polling. 99% produces a wider interval with more certainty. 90% produces a narrower interval with less certainty.

Read the interval as a pair of numbers: the lower bound and the upper bound. For a sample mean of 50 with a 95% interval of (48.04, 51.96), you report that you are 95% confident the true population mean lies between 48.04 and 51.96. The correct interpretation is about the method, not this specific interval: 95% of intervals built this way from repeated samples will contain the true mean. See the insights section below for why that distinction matters.

Confidence Interval Formula and Worked Examples

There is no single confidence interval formula. The right one depends on whether the population standard deviation is known, whether you are estimating a mean or a proportion, and how large your sample is. All three formulas below follow the same pattern: point estimate plus or minus a critical value times a standard error.

Z-Interval for a Mean (known σ, or n ≥ 30)

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

Where:
  x̄  = sample mean
  σ  = population standard deviation
  n  = sample size
  z* = critical value from the standard normal

Common z* values:
  90% CI → z* = 1.645
  95% CI → z* = 1.960
  99% CI → z* = 2.576

Standard Error:  SE = σ / √n
Margin of Error: ME = z* × SE

Worked example: x̄ = 50, σ = 10, n = 100, 95% CI
  SE = 10 / √100 = 10 / 10 = 1
  ME = 1.960 × 1 = 1.960
  CI = 50 ± 1.960 = (48.04, 51.96)

Interpretation: 95% of intervals built this way will
contain the true population mean.

T-Interval for a Mean (unknown σ, small n)

CI = x̄ ± t* × (s / √n)

Where:
  s   = sample standard deviation
  t*  = critical value from the t-distribution
  df  = n − 1 (degrees of freedom)

Worked example: x̄ = 72, s = 8, n = 25, 95% CI
  df = 25 − 1 = 24
  t* = 2.064 (from a t-table at 95%, df = 24)
  SE = 8 / √25 = 8 / 5 = 1.6
  ME = 2.064 × 1.6 = 3.30
  CI = 72 ± 3.30 = (68.70, 75.30)

The t-distribution has heavier tails than the normal, so t* is larger than z* for the same confidence level. That makes the t-interval wider, which accounts for the extra uncertainty from estimating σ with s. As n grows past 30, t* converges on z* and the two methods give almost identical results.

CI for a Proportion

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

Where:
  p̂ = sample proportion (successes ÷ n)
  z* = critical value from the standard normal

Worked example: 612 yes out of 1,000 surveyed, 95% CI
  p̂ = 0.612
  SE = √(0.612 × 0.388 / 1000) = √0.000237 = 0.0154
  ME = 1.96 × 0.0154 = 0.0302
  CI = 0.612 ± 0.0302 = (0.582, 0.642)

So 58.2% to 64.2%, or roughly ±3 points.

This is the formula behind every ±3% margin of error you see next to a political poll. It assumes np̂ and n(1 − p̂) are both at least 10 so the normal approximation holds.

Quick Reference: z* and Margin of Error by Sample Size

The table below shows the z critical value and the margin of error for a sample with σ = 10 across four confidence levels and four sample sizes. Use it to see how doubling the sample size or changing the confidence level changes your interval width.

Confidencez*ME at n = 30ME at n = 100ME at n = 500ME at n = 1000
80%1.2822.341.280.5730.405
90%1.6453.001.650.7360.520
95%1.9603.581.960.8770.620
99%2.5764.702.581.1520.815

All margins assume σ = 10. Scale linearly for other σ values: with σ = 25, multiply every entry by 2.5. Notice that going from n = 100 to n = 1000 (a 10× increase) cuts the margin of error to about 1/√10, roughly 32% of the original.

Confidence Interval Statistics: Interpretation, Sample Size, and Real Uses

A confidence interval calculator is only useful if you read the output correctly. The math is easy; the interpretation trips up graduate students, reporters, and even published researchers. This section covers the statistical meaning, the trade-offs between sample size and interval width, when to pick z versus t, and where these intervals actually show up in real decisions.

What a Confidence Interval Actually Means

The textbook sentence is that a 95% CI means "95% of intervals built this way from repeated sampling will contain the true population mean." That is a statement about the method, not about your specific interval. Once you have computed (48.04, 51.96), either the true mean is in there or it is not. It is NOT correct to say "there is a 95% chance the true mean is between 48.04 and 51.96." The population mean is a fixed number; it does not have a probability distribution in frequentist statistics.

In practice, most people ignore this distinction and report it the intuitive way. That is fine for casual reporting, but it matters when you are interpreting a study: a single 95% CI that fails to contain the hypothesized value is not a 5% event for that interval, it is a 5% long-run false-alarm rate for the procedure. If you want a "there is a 95% probability the parameter is in this range" statement, you need a Bayesian credible interval, which is a different calculation built from a prior distribution.

Sample Size and Interval Width

The margin of error scales with 1/√n, not 1/n. That has a real budgeting consequence. If you want to cut your margin of error in half, you need four times the sample size. To cut it to one third, you need nine times the sample. Here is what that looks like at 95% confidence with σ = 10:

Sample Size nStandard ErrorMargin of Error (95%)Relative Precision
252.000±3.920baseline
1001.000±1.9602× tighter
4000.500±0.9804× tighter
1,6000.250±0.4908× tighter

This is why surveys stop getting dramatically more accurate once you pass about a thousand respondents. Going from n = 1,000 to n = 2,000 only shrinks the margin by about 30%, but doubles the cost. That trade-off is why national political polls usually land between 800 and 1,200 respondents.

When to Use z vs t

The rule of thumb is simple. Use z when the population standard deviation σ is known, or when n is large (typically n ≥ 30) even if you are using the sample standard deviation s. Use t when σ is unknown and n is small. The practical difference only matters for small samples. At n = 10 the 95% t* is 2.262 versus z* = 1.960, so t intervals are about 15% wider. At n = 100 the two are almost identical (t* ≈ 1.984 versus z* = 1.960), a difference of about 1%.

SituationUseWhy
σ known (rare in practice)z-intervalNo extra uncertainty from estimating σ
σ unknown, n < 30t-intervalt accounts for uncertainty in s
σ unknown, n ≥ 30z or t (nearly equal)t converges on z as df grows
Estimating a proportionz-interval for p̂Binomial normal approximation

Where Confidence Intervals Actually Show Up

Outside the classroom, the same formula runs under the hood in several places you interact with regularly:

  • Political polls. The familiar "±3% margin at the 95% confidence level" comes from the proportion formula with p̂ near 0.5 and n ≈ 1,068. That is why pollsters target about 1,000 respondents: it is the cheapest n that hits ±3 points.
  • Clinical trials. A new drug's mean effect is reported with a 95% CI. If the interval includes zero, the effect is not statistically significant at the 5% level. Regulators look at interval width as a signal of whether the trial was adequately powered.
  • A/B testing. When you see "conversion lifted 2.3% ± 0.8%" on a growth dashboard, that ± value is a 95% margin of error for a difference in proportions. If the interval crosses zero, the test has not reached significance yet.
  • Manufacturing QC. Process engineers use confidence intervals on the mean diameter of a produced part to verify that tolerances are being held. A shift in the interval signals tool wear or a calibration drift before any single part goes out of spec.
  • Economic reporting. Monthly jobs numbers, GDP revisions, and unemployment rates all publish confidence intervals in the underlying release, even if the headline quotes the point estimate.

The common thread is that a point estimate alone hides uncertainty. A 95% confidence interval forces you to report both the answer and how much you should trust it.

Frequently Asked Questions

A 95% confidence interval means that if you repeated your sampling process many times and built the interval each time, 95% of those intervals would contain the true population mean. It does NOT mean there is a 95% probability that the population mean is inside this specific interval. The population mean is a fixed value, not a random variable. The probability statement applies to the procedure, not to any single interval you happened to compute.

Related Calculators