In this article
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?
- 1Standard error12 ÷ √36 = 12 ÷ 6 = **2 minutes**.
- 2Margin of error1.96 × 2 = **3.92 minutes**.
- 3Interval72 − 3.92 to 72 + 3.92 = **68.08 to 75.92 minutes**.
- 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.
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.
| Method | Critical value | Margin | Interval |
|---|---|---|---|
| z (1.96) | 1.960 | 3.92 | 68.08 to 75.92 |
| t, 35 df (2.030) | 2.030 | 4.06 | 67.94 to 76.06 |
The difference is small at n = 36 and tiny by n = 100. For n under about 30 it matters more.
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.
Going from 9 to 36 values (four times as many) cuts the margin in half. From 100 to 400 does the same again.
| Confidence level | Critical value (z) | Margin at n = 36 | Interval around 72 |
|---|---|---|---|
| 90% | 1.645 | 3.29 | 68.71 to 75.29 |
| 95% | 1.960 | 3.92 | 68.08 to 75.92 |
| 99% | 2.576 | 5.15 | 66.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 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.
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
- 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
- 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.
- 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.
- Decide the margin you can live with.
- Pick a confidence level, usually 95%.
- Estimate the spread, from a pilot study or by using the worst case for proportions.
- Calculate n, then add a margin for non-responses.
- 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.

