Math Tools

Confidence intervals explained: what 95% really means and how sample size shrinks it

A poll says 52% support a plan, give or take 3 points. A confidence interval is that 'give or take', done properly. This guide shows the formula, a worked example, how level and sample size change the width, and the common misreading of '95% confident'.

By the Toolcloak team9 October 20263 min read
In this article
  1. A worked example
  2. Using the t value for small samples
  3. What changes the width
  4. Polls and percentages
  5. What '95% confident' really means
  6. Assumptions behind the formula
  7. Choosing a sample size

You measured a sample and got one number: an average, or a percentage. The true value for the whole population is almost certainly a little different. A confidence interval is a range built around your number that says how far off it could reasonably be. It is the honest way to report an estimate.

A worked example

A company samples 36 delivery times. The average is 72 minutes and the standard deviation is 12 minutes. What range is the true average likely to sit in?

95% interval for the average delivery time
  1. 1Standard error12 ÷ √36 = 12 ÷ 6 = **2 minutes**.
  2. 2Margin of error1.96 × 2 = **3.92 minutes**.
  3. 3Interval72 − 3.92 to 72 + 3.92 = **68.08 to 75.92 minutes**.
  4. 4Say itWe are 95% confident the true average is between about 68 and 76 minutes.

The sample mean sits in the middle. The margin of error is how far the interval reaches on each side.

Enter mean, standard deviation and sample size to get the interval at your chosen level.Open Confidence Interval Calculator (Mean)

Using the t value for small samples

The 1.96 above assumes you know the population standard deviation, or have a big sample. With a sample of 36 and an estimated spread, textbooks use the t distribution, which is a little wider to allow for that extra uncertainty. For 35 degrees of freedom the 95% critical value is about 2.03.

MethodCritical valueMarginInterval
z (1.96)1.9603.9268.08 to 75.92
t, 35 df (2.030)2.0304.0667.94 to 76.06

The difference is small at n = 36 and tiny by n = 100. For n under about 30 it matters more.

95% critical value by sample size
n = 5 (t)
2.776
n = 10 (t)
2.262
n = 30 (t)
2.045
n = 100 (t)
1.984
Large n (z)
1.960

The t value falls toward 1.96 as the sample grows, because a bigger sample estimates the spread better.

What changes the width

Three things control how wide the interval is: how variable the data is, how many values you have, and how sure you want to be.

Margin of error at 95% for different sample sizes (SD = 12, minutes)
7.8n = 93.9n = 362.4n = 1001.2n = 400

Going from 9 to 36 values (four times as many) cuts the margin in half. From 100 to 400 does the same again.

Confidence levelCritical value (z)Margin at n = 36Interval around 72
90%1.6453.2968.71 to 75.29
95%1.9603.9268.08 to 75.92
99%2.5765.1566.85 to 77.15

More confidence means a wider net. You cannot be more certain without being less precise.

Polls and percentages

For a proportion the formula changes slightly. The standard error is √(p × (1 − p) ÷ n). A poll of 1,000 people finds 52% in favour.

The poll of 1,000 people
52%Sample result520 of 1,000
±3.1Margin of error1.96 × √(0.52 × 0.48 ÷ 1000)
48.9%Lower endPlausible low
55.1%Upper endPlausible high

The interval includes 50%, so this poll cannot tell you whether most people are for or against. A 52% 'lead' is within the noise.

Headline margins use the worst case, p = 50%, which gives the widest interval. That is where the familiar 'plus or minus 3 points for 1,000 people' comes from.

Poll margin of error as the sample grows (percentage points)
Margin of error at 95%
02.557.5101004001,0002,50010,000

Surveying ten times as many people shrinks the margin to only about a third of its size, and each extra person helps less. That is why most polls stop around 1,000.

What '95% confident' really means

Two readings of the same interval
The correct readingAbout the method
  • If we repeated the study many times
  • About 95% of the intervals would contain the true value
  • Any single interval either does or does not
The common misreadingA 95% chance for this one
  • Treats the true value as a moving target
  • The true value is fixed, the interval varies
  • A subtle but real difference

In everyday writing, 'we are 95% confident the true value lies between 68 and 76' is fine. Just do not read it as a probability about the true value itself.

100 intervals from 100 repeated samples at 95% confidence
  • Contain the true value95
  • Miss it5

Five in a hundred intervals will miss, and you cannot tell which ones from a single sample.

Assumptions behind the formula

  • Random sampling. If the sample is biased, the interval is centred on the wrong value no matter how narrow it is.
  • Independent values. Ten measurements on the same person are not ten independent people.
  • Roughly bell-shaped means. With a large sample this holds even for skewed data. For tiny, skewed samples, be careful.
  • Spread is estimated. The standard deviation comes from your sample, so it carries its own uncertainty.

Choosing a sample size

You can work backwards. For a proportion, the sample needed for margin E at 95% is about 0.9604 ÷ E² (using p = 50%). For a margin of 3 points, that is 0.9604 ÷ 0.0009 ≈ 1,067 people. For 5 points it is about 385.

  1. Decide the margin you can live with.
  2. Pick a confidence level, usually 95%.
  3. Estimate the spread, from a pilot study or by using the worst case for proportions.
  4. Calculate n, then add a margin for non-responses.
  5. Report the interval, not just the mean.

Questions people ask

What is a confidence interval?

It is a range around a sample estimate, such as an average or percentage, that is likely to contain the true population value. It is calculated from the sample's size and variability.

How do I calculate a 95% confidence interval for a mean?

Compute the standard error as the standard deviation divided by the square root of n, multiply by 1.96 (or the t value for small samples) and add and subtract the result from the mean.

What does 95% confidence mean?

It means that if the study were repeated many times, about 95% of the intervals built this way would contain the true value. It does not mean there is a 95% chance this one does.

How does sample size affect the interval?

A larger sample gives a narrower interval. The width shrinks with the square root of n, so you need four times the sample to halve the margin.

When should I use t instead of z?

Use t when the population standard deviation is unknown and estimated from the sample, especially for samples under about 30. For large samples the two give nearly the same result.

What is margin of error?

It is the amount added to and subtracted from the estimate to form the interval. In a poll of 1,000 people the margin is about 3 percentage points.