Confidence Interval Calculator

Calculate a confidence interval for a sample mean or proportion, with the margin of error and what the confidence level actually means.

How to use this calculator

  1. 1Choose whether you are estimating a mean or a proportion.
  2. 2Enter your sample statistics and size.
  3. 3Pick a confidence level — 95% is the standard default in most fields.

How the calculation works

Mean: CI = x̄ ± z × (s / √n) Proportion: CI = p̂ ± z × √(p̂(1−p̂) / n)
x̄ / p̂
The sample mean or sample proportion — your point estimate
z
Critical value from the standard normal distribution for the chosen confidence level
s / √n
Standard error — how much the sample statistic is expected to vary from the true value

The margin of error is the critical value multiplied by the standard error. A 95% interval uses z = 1.96, the value beyond which only 5% of a normal distribution lies (split between both tails).

Standard error shrinks with the square root of sample size, not size itself — this is why gathering four times the data only halves your margin of error.

For small samples (typically n < 30) with an unknown population standard deviation, the t-distribution gives a more accurate — and wider — interval than the normal approximation used here.

Worked example

A sample mean of 75, standard deviation 12, n = 100, at 95% confidence

  1. 1.Standard error = 12 ÷ √100 = 1.2.
  2. 2.Margin of error = 1.96 × 1.2 = 2.352.
  3. 3.Interval = 75 ± 2.352 = 72.648 to 77.352.

Result: 72.648 to 77.352

What a confidence interval is trying to do

A single number computed from a sample — a poll result, an average test score, a measured defect rate — is almost never exactly right for the whole population it is meant to represent. A confidence interval acknowledges that honestly: instead of reporting one number as if it were the truth, it reports a range likely to contain the true population value, along with a stated confidence level describing how often that method succeeds.

The interval is built around the sample’s own estimate, widened in both directions by a margin of error. That margin depends on how much the data varies and on how large the sample is — more variable data or a smaller sample means a wider, less precise interval.

What the confidence level actually promises

A "95% confidence interval" is one of the most commonly misstated ideas in statistics. It does not mean there is a 95% probability that the true value falls inside this specific interval — once the interval is calculated, the true value either is or is not in it, with no probability left to state about that particular range.

What it actually describes is the reliability of the method used to build it: if the same sampling and calculation process were repeated many times, roughly 95% of the intervals produced that way would contain the true value. It is a guarantee about the long-run process, not a probability statement about this one result.

The trade-off between width and confidence

Confidence intervals sit on a dial with two competing settings. Raising the confidence level — say, from 90% to 99% — widens the interval, since being more certain of capturing the true value requires casting a wider net. Growing the sample size narrows the interval instead, because a larger sample estimates the population more precisely.

That narrowing follows the square root of the sample size, not the sample size itself, so quadrupling the data only halves the margin of error. There is no way to make an interval both narrower and more confident without collecting more data — any claim of high confidence and high precision from a small sample deserves a second look.

Where confidence intervals get used

The same construction shows up anywhere a sample stands in for a larger group.

  • Election and opinion pollingthe margin of error reported alongside a poll result is exactly this calculation.
  • Clinical trialsestimating the true effect of a treatment from a limited group of patients.
  • Manufacturing quality controlestimating the true defect rate of a production run from a sampled batch.
  • Market researchestimating customer preferences or purchase intent from a survey sample.

What this assumes, and where it stops

Assumptions

  • The sample is randomly drawn and representative of the population.
  • For means, the sampling distribution is approximately normal — true by the central limit theorem for reasonably large samples regardless of the population’s own shape.

Limitations

  • Small samples with an estimated standard deviation should use the t-distribution, which produces a wider, more honest interval.
  • A biased or non-random sample invalidates the interval regardless of how the arithmetic is done — no formula can correct for a bad sample.
  • The proportion formula assumes np and n(1−p) are both at least 5; below that, exact binomial methods are more reliable.

Common questions

What does "95% confidence" actually mean?

It describes the reliability of the method, not the probability of this one result. If you repeated the sampling and interval-construction process many times, about 95% of the resulting intervals would contain the true population value. Any single interval either does or does not contain it — there is no probability left to state once it is constructed.

How do I get a narrower interval?

Increase your sample size, or accept a lower confidence level — both shrink the margin of error, at the cost of more data collection or less certainty. Because standard error scales with 1/√n, quadrupling your sample size only halves the margin, which is why survey sample sizes grow slowly for each extra point of precision.

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the confidence interval calculator.

See all statistics calculators →