What this calculator does
A sample mean is an estimate, and a confidence interval expresses how precise that estimate is. Rather than reporting a single number, it gives a range along with a statement about how often such ranges capture the true value.
The interpretation is subtler than it first appears. A 95 per cent confidence interval does not mean there is a 95 per cent chance the true mean lies inside this particular range. It means that if you repeated the sampling many times, 95 per cent of the intervals produced would contain it. The distinction matters, and it is widely misstated.
The formula
The standard error, standard deviation divided by the square root of the sample size, measures how much the sample mean would vary between samples. Multiplying it by the critical value for the chosen confidence level gives the margin of error, which is then applied either side of the mean.
| Term | Meaning |
|---|---|
| Margin of error | Critical value × standard error. |
| Standard error | Standard deviation ÷ √n. |
| Critical value | 1.645 for 90%, 1.96 for 95%, 2.576 for 99%. |
| Confidence level | The proportion of such intervals that would contain the true mean. |
The inputs explained
| Field | What to enter |
|---|---|
| Sample mean | The mean of your sample. |
| Standard deviation | The standard deviation of your sample. |
| Sample size | The number of observations. Larger samples give narrower intervals. |
| Confidence level | The confidence level. Higher levels give wider intervals: more certainty requires more room. |
When to use it
Reporting a survey result
A mean with a margin of error is far more informative than a mean alone, and it is the standard convention in published research.
Deciding whether two groups differ
If the intervals for two groups do not overlap, the difference is likely real. Overlapping intervals do not necessarily mean no difference, though: a formal test is needed for that.
Planning a sample size
The line showing the sample needed to halve the margin makes the trade-off concrete: four times the data for twice the precision.
Choosing a confidence level
Compare 90, 95 and 99 per cent. Higher confidence buys certainty at the cost of a wider, less useful interval.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How sample size narrows the interval
The same sample statistics at increasing sample sizes.
| Sample size | Confidence interval | Margin of error | Relative margin |
|---|---|---|---|
| n = 10 | 47.318 to 57.482 | ± 5.082 | 9.70% |
| n = 30 | 49.466 to 55.334 | ± 2.934 | 5.60% |
| n = 60 | 50.325 to 54.475 | ± 2.075 | 3.96% |
| n = 120 | 50.933 to 53.867 | ± 1.467 | 2.80% |
| n = 500 | 51.681 to 53.119 | ± 0.7188 | 1.37% |
| n = 2000 | 52.041 to 52.759 | ± 0.3594 | 0.686% |
The cost of higher confidence
A fixed sample at each of the three standard confidence levels.
| Confidence level | Confidence interval | Margin of error | Relative margin |
|---|---|---|---|
| 90% | 51.169 to 53.631 | ± 1.231 | 2.35% |
| 95% | 50.933 to 53.867 | ± 1.467 | 2.80% |
| 99% | 50.472 to 54.328 | ± 1.928 | 3.68% |
Questions
What does a 95 per cent confidence interval actually mean?
That if you repeated the sampling process many times and computed an interval each time, about 95 per cent of those intervals would contain the true population mean. It is a statement about the procedure, not about this particular interval.
Why does a higher confidence level give a wider interval?
Because capturing the true value more often requires casting a wider net. A 100 per cent confidence interval would have to span every possible value, which is why it would be useless.
How large a sample do I need?
It depends on the precision you want and the variability in your data. Halving the margin of error requires four times the sample. The sample size calculator works this out directly for proportions.
Should I use z or t?
This calculator uses z critical values, which are appropriate for large samples or a known population standard deviation. For small samples, under about 30, with an estimated standard deviation, the t-distribution gives slightly wider and more honest intervals.
What if my intervals overlap?
Overlapping intervals do not prove that two groups are the same. A direct test of the difference is more powerful than comparing intervals by eye, and can find significance even when intervals overlap somewhat.
For survey sizing, use the sample size calculator. For summarising the sample itself, see descriptive statistics.