Skip to main content

Calculate confidence interval for the sample mean.

Sample Size (n)

Counted from the values you entered.

Enter values to see the result.

Guide: Confidence Interval

Confidence interval is a range of values within which the true population value lies with a certain probability. A 95% confidence interval means that if the experiment were repeated many times, the true population mean would fall within the calculated interval 95% of the time.

Margin of error is half the width of the confidence interval, calculated as Z times the standard error. It depends on the confidence level (higher level = wider interval) and sample size (larger sample = narrower interval). Z = 1.96 for 95% confidence is standard.

Confidence level: Typical levels are 90%, 95%, and 99%. The 95% level is most common in scientific research. A higher confidence level gives a wider interval but more certainty. The choice depends on the precision-certainty tradeoff.

Sample size and margin of error: To halve the margin of error, we need to quadruple the sample size. Formula: n = (Z × σ / E)² where E is the desired margin of error. To get margin of 0.5 with standard deviation of 5, we need n = (1.96 × 5 / 0.5)² = 384 observations.

Interpretation: A confidence interval does not mean the true value has a 95% chance of being in that specific interval. It means that 95% of intervals constructed from different samples contain the true value. A single interval either contains it or does not.

Halving the margin of error costs four times the sample, not twice

The margin of error shrinks with the square root of the sample size, not with the sample size. That single square root is why polls stall at about ±3%: going from 1,000 respondents to 2,000 buys you 3.10% down to 2.19%, and getting to ±1.55% means paying for 4,000. Every further halving costs four times as much as the last.

How it works

  • Computes a confidence interval for a mean or a proportion at your chosen confidence level.
  • Shows the margin of error, which is the half-width people actually quote.
  • Works backwards from a target margin to the sample size it requires — usually the more useful direction.
margin = z × σ ÷ √n            for a mean
margin = z × √(p(1−p) ÷ n)     for a proportion

z = 1.96 at 95% confidence, 2.576 at 99%

the √n is the whole story: to halve the margin you must quadruple n

Worked example

A political poll at 50/50, sampled at increasing sizes.

  1. n = 500 → ±4.38%
  2. n = 1,000 → ±3.10%
  3. n = 2,000 → ±2.19%
  4. n = 4,000 → ±1.55%
  5. n = 10,000 → ±0.98%

Quadrupling from 1,000 to 4,000 halves the margin from 3.10% to 1.55%. That is why almost every published poll lands near 1,000 respondents: it is the point where the cost per unit of precision stops being worth paying.

Reading the result

  • A 95% interval does not mean there is a 95% chance the true value sits inside this particular interval. It means the procedure produces intervals that contain the true value 95% of the time. The distinction matters because the true value is fixed and it is the interval that varies.
  • Two polls three points apart with ±3% margins are not in disagreement. Their intervals overlap heavily, and treating the gap as a real change is the single most common misreading of published polling.
  • Population size barely enters. Sampling 1,000 people gives roughly the same margin whether the population is 100,000 or 100 million, which is why national polls are not proportionally larger than regional ones.
  • The margin only covers sampling error. Non-response, bad question wording and a skewed sampling frame produce errors that no sample size fixes, and those are usually larger than the quoted ±3%.

Common questions

Why do almost all polls use about 1,000 people?
Because it is where the square root stops paying. A thousand respondents gives ±3.10%; doubling the cost to 2,000 only improves that to ±2.19%. Beyond roughly that point the money buys more precision than the question usually needs.
Does a bigger population need a bigger sample?
Almost never. The formula contains n, the sample size, and not the population size. A well-drawn sample of 1,000 measures a country of 60 million about as precisely as it measures a town of 60,000.