Skip to content
K Knidox Search…
Statistics · Inference

Confidence Interval Calculator

Build a confidence interval for a mean from your sample mean, standard deviation, and size.

95% confidence interval
94.632 – 105.368

Margin of error: ±5.368 (z = 1.96)

A confidence interval for a mean is x̄ ± z × (σ ÷ √n). For a mean of 100, σ = 15, n = 36, at 95% confidence (z = 1.96), the standard error is 15 ÷ 6 = 2.5 and the margin is 1.96 × 2.5 = 4.9, giving [95.1, 104.9].

What a confidence interval tells you

A confidence interval turns a single sample mean into a plausible range for the true population mean. A 95% interval means that if you repeated the sampling many times, about 95% of the intervals you built would contain the true mean. It is a statement about the long-run procedure, not a probability claim about any one interval you happen to have.

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

sample mean, plus or minus the margin of error

Worked example

Sample mean 100, standard deviation 15, sample size 36, at 95% confidence.

  1. 1
    Compute the standard error. SE = σ ÷ √n = 15 ÷ √36 = 15 ÷ 6 = 2.5.
  2. 2
    Multiply by the critical z. Margin of error = 1.96 × 2.5 = 4.9.
  3. 3
    Add and subtract from the mean. 100 ± 4.9 = [95.1, 104.9].

Critical z-values by confidence level

The two-tailed normal critical value used in the margin of error.

ConfidenceCritical zTail area (each)
90%1.6450.05
95%1.9600.025
99%2.5760.005

Choosing inputs and reading the result

z-interval vs t-interval. Use the z critical values when the population SD is known or the sample is large (n ≥ 30). For small samples with an estimated SD, use the t-distribution instead, which gives slightly wider, more honest intervals.

Higher confidence widens the interval. To be more sure of capturing the true mean you must cast a wider net, so 99% intervals are wider than 95% ones from the same data.

Bigger samples tighten it. The margin of error shrinks with √n, so quadrupling the sample size roughly halves the width — the main lever you control. To find the n that hits a target margin before collecting data, use the sample size calculator.

What it does not mean. A 95% interval does not mean there’s a 95% chance the true mean lies in your specific interval; the true mean is fixed, and your one interval either contains it or it doesn’t.

When should I use a z-interval?
For a known population SD or a large sample (n ≥ 30). For small samples with an unknown SD, a t-interval is more appropriate and a little wider.
What is the margin of error?
The critical z value times the standard error (σ ÷ √n). It is the ± half-width of the interval.
Why does a higher confidence widen the interval?
To be more certain of capturing the true mean, you need a wider range — so 99% intervals are wider than 95% ones built from the same data.
How do I shrink the interval?
Collect a larger sample. Because the width scales with √n, increasing n is the most reliable way to tighten the estimate.
Does a 95% interval mean a 95% chance the mean is inside?
No. The true mean is fixed; your interval either contains it or not. The 95% refers to the long-run success rate of the method, not any single interval.
Which z-value goes with each confidence level?
The two-tailed normal critical value: 1.645 for 90%, 1.960 for 95%, and 2.576 for 99%. A higher level uses a larger z, which widens the interval.