A confidence interval for a mean is the sample mean plus or minus a margin of error: x̄ ± z·σ/√n, where z is the critical value for your confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%). For a mean of 2 with σ = 1 and n = 100 at 95% confidence, the margin is 1.96 × 1/√100 = 0.196, giving the interval (1.804, 2.196).
Confidence Interval Calculator — for a mean (z-interval)
95% confidence interval for a mean of 2 (σ = 1, n = 100).
- Lower limit
- 1.804
- Upper limit
- 2.196
Quick examples
How it's calculated
- Margin of error = z × σ ÷ √n
- z
- = 1.96
- sigma
- = 1
- n
- = 100
- 0.196
- Interval = mean ± margin of error
- mean
- = 2
- E
- = 0.196
- 1.8
How it works
A confidence interval turns a single sample mean into a range that is likely to contain the true population mean. For a mean when the population standard deviation σ is known (or the sample is large), the interval is:
x̄ ± z × (σ ÷ √n)
The piece added and subtracted, E = z × σ ÷ √n, is the margin of error. It has three ingredients:
- z, the critical value from the standard normal distribution for your confidence level: 1.645 for 90%, 1.960 for 95%, 2.576 for 99%.
- σ, the standard deviation — more spread widens the interval.
- n, the sample size — the √n in the denominator means bigger samples give narrower, more precise intervals.
A 95% confidence level does not mean a 95% probability that this particular interval holds the true mean — the interval either contains it or it does not. It means the method captures the true mean about 95% of the time across many samples.
Worked example
Take a sample mean of 2, a standard deviation σ = 1 and a sample size n = 100, at 95% confidence. The standard error is σ/√n = 1/10 = 0.1, so the margin of error is 1.96 × 0.1 = 0.196 and the interval is 2 ± 0.196 = (1.804, 2.196) — the OpenStax textbook example. Switch to 90% and the margin shrinks to 0.1645; switch to 99% and it grows to 0.2576, because higher confidence demands a wider net.
Frequently asked questions
What is a confidence interval?
- It is a range of values, computed from a sample, that is likely to contain the true population value. A 95% confidence interval for a mean gives a lower and upper limit produced by a method that captures the true mean about 95% of the time.
What is the margin of error?
- The margin of error is the half-width of the interval, E = z·σ/√n — the amount added to and subtracted from the sample mean. A margin of ±0.196 means the interval extends 0.196 on each side of the mean.
Which z-value goes with each confidence level?
- For a two-sided interval the standard critical values are 1.645 for 90%, 1.960 for 95% and 2.576 for 99%. Higher confidence needs a larger z, which widens the interval — the price of being more certain the true mean is inside.
Does a 95% interval mean a 95% chance the mean is inside?
- No. The true mean is a fixed number; a given interval either contains it or it does not. The 95% refers to the long-run success rate of the procedure: if you repeated the sampling many times, about 95% of the intervals you built would contain the true mean.
When should I use a t-interval instead of this z-interval?
- Use the z-interval when the population standard deviation is known or the sample is large. For a small sample with an unknown standard deviation, use the t-interval, which replaces z with a slightly larger t-value that depends on the degrees of freedom (n − 1). The two converge as the sample grows.
How do I make the interval narrower?
- Collect a larger sample. Because n sits under a square root, quadrupling the sample size halves the margin of error. Lowering the confidence level also narrows the interval, but at the cost of being less sure it contains the true mean.
How we know this is right
- Last reviewed
- Aug 5, 2026
- Precision
- Rounded to 4 decimal places.
Sources
- NIST/SEMATECH Sample sizes required — NIST/SEMATECH e-Handbook §7.2.2.2: for a mean with known σ the confidence half-width is δ = (σ/√N)·z_{1−α/2}, and "the critical value from the normal distribution for 1 − α/2 = 0.975 is 1.96" · Reviewed Aug 5, 2026
- OpenStax (Rice University) A Single Population Mean using the Normal Distribution — OpenStax Introductory Statistics 2e §8.1: μ = X̄ ± z(σ/√n); to capture the central 90 % you go out 1.645 SDs; worked 95 % example X̄=2, σ/√n=0.1 → 2 ± 1.96(0.1) = (1.804, 2.196) · Reviewed Aug 5, 2026
- NIST/SEMATECH Cumulative Distribution Function of the Standard Normal Distribution — NIST/SEMATECH e-Handbook §1.3.6.7.1: tabulates Φ(z); the two-sided critical values z ≈ 1.645 (90 %) and z ≈ 2.576 (99 %) follow from Φ(1.645) ≈ 0.95 and Φ(2.576) ≈ 0.995 by interpolation · Reviewed Aug 5, 2026