Confidence Interval Calculator

Margin of error
Next

A confidence interval puts a pair of honest error bars around a sample estimate. This calculator computes 90%, 95%, 98% or 99% confidence intervals for the mean of a continuous variable from the sample mean, the standard deviation and the sample size, using the normal (z) approximation. It also outputs the standard error and the margin of error so you can report them the way most scientific journals require.

How to compute a confidence interval

  1. 1

    Enter the sample mean

    The average of your sample. The interval is built around this point estimate.

  2. 2

    Enter the standard deviation and sample size

    If you only have the sample standard deviation, that is fine: with a large enough sample the normal approximation still holds.

  3. 3

    Choose the confidence level

    90%, 95% (the default in most research), 98% or 99%. Higher confidence = wider interval.

  4. 4

    Read the interval

    Standard error, margin of error, lower bound and upper bound: formatted ready to paste into a report.

What a confidence interval actually means

A 95% CI does not mean “there is a 95% chance the true value is in this interval.” Formally: if you repeated the sampling procedure many times and built a CI each time, 95% of those intervals would contain the true parameter. The interval you have is either one of the 95% that trap it or one of the 5% that miss, you cannot know which.

In practice, most analysts interpret it as a plausible range for the parameter, which is close enough for applied work.

Formula

Mean, normal approximation: CI = x̄ ± z × (s / √n)

where z comes from the standard normal distribution (1.645 for 90%, 1.96 for 95%, 2.326 for 98%, 2.576 for 99%). The approximation is accurate when the population standard deviation is known or the sample is large (n ≥ 30).

z-values used by this calculator

Confidence z-value
90% 1.645
95% 1.960
98% 2.326
99% 2.576

When the normal approximation is not enough

  • With a small sample (n < 30) and a standard deviation estimated from the sample, use the t-distribution instead: the t critical value is larger than z, so the interval widens. This calculator always uses z; for small samples, use a t-based calculator.
  • The interval is symmetric, so it can include values the true parameter cannot take (for example a negative lower bound for a quantity that is never negative). That is a property of the normal approximation, not an error.

Sample size matters more than the level

Halving the margin of error requires quadrupling the sample size (the √n in the denominator). A 95% CI on a poll of 400 people is ±4.9 points; on 1,600 people it is ±2.5 points; on 10,000 people it is ±1.0 point. This is why national polls cluster around n = 1,000-1,200, the precision curve flattens fast.

Frequently Asked Questions

Use the normal (z) approximation when the population standard deviation is known or your sample is large (n ≥ 30). With a small sample and a standard deviation estimated from the sample, the t-distribution gives a wider, more honest interval. The n = 30 cutoff is a rough rule of thumb, not a law.

Yes. The normal approximation is symmetric, so with a small sample or a large standard deviation the lower bound can fall below zero even for quantities that are never negative. That is a signal to check the assumptions, not a reason to clip the interval silently.

For a mean with a known standard deviation, use n = (z × σ / E)². With z = 1.96 and σ = 1, a margin of ±0.1 needs about 385 observations; a margin of ±0.05 needs about 1,537.

No, it is a convention. Medical trials often use 95%; some safety engineering uses 99%. This calculator also offers 90% and 98%. Pick the level before looking at the data to avoid cherry-picking.

Related Tools