A confidence interval is a range of plausible values for an unknown population parameter, such as a mean or a proportion, computed from sample data by a procedure that captures the true value in a stated share of repeated samples. In statistics, a 95% confidence interval means that if the same sampling and calculation were repeated many times, about 95% of the resulting intervals would contain the true parameter.
Confidence intervals express estimation uncertainty in the units of the quantity being measured, which makes them more informative than a single point estimate or a bare p-value. They show both the likely size of an effect and how precisely it has been measured.
How a confidence interval is constructed
Most confidence intervals follow the pattern point estimate plus or minus a margin of error, where the margin equals a critical value multiplied by the standard error of the estimate. The critical value comes from the sampling distribution of the estimator and the chosen confidence level.
For a sample mean with a large sample, the interval is the mean plus or minus 1.96 standard errors at the 95% level, where the standard error is the sample standard deviation divided by the square root of the sample size. For small samples with unknown population variance, the critical value comes from the t-distribution with n minus 1 degrees of freedom, which produces slightly wider intervals.
The table below shows the normal critical values used for common confidence levels.
| Confidence level | Critical value (z) | Typical use |
|---|---|---|
| 90% | 1.645 | Exploratory analysis, some business tests |
| 95% | 1.960 | Default in most scientific and business work |
| 99% | 2.576 | High-stakes or safety-related decisions |
| 99.9% | 3.291 | Very strict tolerance for error |
What determines the width
The width of a confidence interval reflects how precisely the parameter is estimated, and it depends on three factors: the variability of the data, the sample size and the confidence level. Narrow intervals indicate precise estimates, while wide intervals warn that the data are consistent with very different true values.
| Factor | Change | Effect on width |
|---|---|---|
| Sample size | Four times larger | About half as wide |
| Data variability | Higher standard deviation | Proportionally wider |
| Confidence level | From 95% to 99% | About 31% wider |
| Measurement noise | Better instruments or definitions | Narrower |
The square-root relationship with sample size is the most important practical consequence. Halving the margin of error requires roughly four times as many observations, which is why precision becomes expensive quickly and why sample size planning should start from the margin of error the decision actually needs.
Interpreting a confidence interval correctly
The confidence level describes the long-run behavior of the method, not the probability that one particular computed interval contains the true value. Once an interval is calculated, the parameter is either inside it or not; the 95% refers to how often the procedure succeeds across repetitions.
This frequentist interpretation differs from a Bayesian credible interval, which does state a probability for the parameter given the data and a prior distribution. With weak priors and large samples, the two intervals are often numerically similar, but they answer different questions.
| Statement | Correct | Comment |
|---|---|---|
| 95% of intervals from this method contain the true value | Yes | Definition of coverage |
| There is a 95% chance the true value is in this interval | No | That is a Bayesian statement |
| 95% of the data lie inside the interval | No | That describes a prediction or reference range |
| Values inside are all equally plausible | No | Values near the estimate are more compatible |
| Excluding zero implies significance at 5% | Yes, for matching two-sided tests | Duality with hypothesis testing |
Common types of confidence intervals
Different parameters and data situations call for different interval methods, because the simple normal formula can perform poorly with small samples, skewed data or proportions near zero or one.
| Method | Parameter | When appropriate |
|---|---|---|
| z-interval | Mean, known or large-sample variance | Large samples, roughly symmetric data |
| t-interval | Mean with estimated variance | Small to moderate samples |
| Wilson interval | Proportion | Small samples or rates near 0 or 1 |
| Bootstrap interval | Almost any statistic | Complex estimators, skewed data |
| Difference interval | Difference of means or rates | Comparing groups or variants |
The familiar Wald interval for proportions, the estimate plus or minus 1.96 times its standard error, can have actual coverage well below 95% when samples are small or rates are extreme. The Wilson or Agresti-Coull methods are safer defaults for conversion rates and defect rates.
Pitfalls in practice
Confidence intervals are only as reliable as the assumptions behind them, and most errors come from data that violate those assumptions rather than from arithmetic.
- Sampling bias: an interval measures random sampling error only; a biased sample yields a precise interval around the wrong value.
- Dependent observations: repeated measurements from the same users or clustered data make naive intervals too narrow.
- Overlap misreading: two overlapping intervals do not prove that the difference between groups is insignificant; the interval of the difference must be checked.
- Multiple comparisons: computing many intervals raises the chance that some miss their true values.
- Ignoring practical relevance: a narrow interval around a negligible effect is precise but not necessarily important.
Reporting the point estimate together with its interval and the confidence level is the most transparent practice, because readers can judge both magnitude and uncertainty at a glance.
The simple explanation
A confidence interval is a range with an honest margin for error. Instead of saying that the average delivery takes exactly 3.2 days, an analyst says it takes between 3.0 and 3.4 days, based on the orders that were checked.
The width tells how sure the estimate is. A narrow range means the measurement is precise, while a wide range means more data would be needed before relying on the number.
How it is used in practice
A hospital quality team wants to know the average waiting time in its emergency department. It samples 400 visits from the past quarter and finds a mean wait of 52 minutes with a standard deviation of 30 minutes.
The standard error is 30 divided by 20, or 1.5 minutes, so the 95% confidence interval is about 52 plus or minus 2.9, roughly 49 to 55 minutes. The team reports this range rather than the single figure, and notes that the sample covered all shifts to limit sampling bias.
When a new triage process is introduced, the team repeats the measurement and computes an interval for the difference in mean waits. Because that interval lies entirely below zero, management can conclude that waits fell and also see the plausible size of the improvement.