Skip to main content
v2026.11,610 entries · CC-BY 4.0
LAC HealthLaboratory & ResearchLab & research supplies.Reagents, consumables, PPE & instruments — documented, fast, chain-of-custody shipping.Shop lac.us lac.us

Confidence Interval Explained: How to Calculate and Interpret One

How to calculate a confidence interval for a mean or proportion, how confidence level and sample size affect its width, and the correct frequentist interpretation.

A confidence interval (CI) is one of the most-searched statistics terms on the web, and one of the most commonly misinterpreted. This guide walks through what a confidence interval actually is, how to calculate one by hand for a mean or a proportion, how confidence level and sample size change its width, and how to interpret it correctly — including the mistake nearly every introductory stats course has to correct at some point. For the compact operational definition, worked examples, and a counter-example, see the Confidence Interval dictionary entry; this guide goes further into calculation, software, reporting standards, and common questions.

What Is a Confidence Interval?

A confidence interval is a range of values, calculated from sample data, that estimates an unknown population parameter (a mean, a proportion, a difference between groups, a regression coefficient) together with a stated confidence level — most often 95%, sometimes 90% or 99%. It is reported as a point estimate plus a margin of error, for example: “mean recovery time was 6.2 days, 95% CI [5.8, 6.6].”

A CI does two things a bare point estimate cannot do on its own: it signals the precision of the estimate (a narrow interval means more precision than a wide one), and it gives readers a plausible range rather than a single number that implies false exactness. This is why confidence intervals are now standard or required alongside p-values and effect sizes in most major journal reporting checklists (see the reporting-standards section below).

Confidence Interval Formula

The general form of a confidence interval, for the estimators most commonly taught (sample means, sample proportions), is:

Confidence Interval = Point Estimate ± (Critical Value × Standard Error)

Three components make up every CI:

  • Point estimate — the sample statistic itself (sample mean, sample proportion, difference in means, regression coefficient).
  • Standard error — a measure of how much the point estimate would be expected to vary from sample to sample, which depends on the variability in the data and the sample size.
  • Critical value — a multiplier determined by the chosen confidence level and the sampling distribution being used (commonly the z-distribution or the t-distribution).

How to Calculate a Confidence Interval for a Mean, Step by Step

  1. Calculate the sample mean (x̄), the point estimate.
  2. Calculate the standard error of the mean: the sample standard deviation (s) divided by the square root of the sample size (s / √n).
  3. Choose the correct critical value and distribution:
    • Use the z-distribution when the population standard deviation is known, or the sample is large (conventionally n ≥ 30, by the Central Limit Theorem). For a 95% confidence level, the two-sided critical value is z = 1.96; for 90%, z = 1.645; for 99%, z = 2.576.
    • Use the t-distribution when the population standard deviation is unknown and the sample is small — the standard case in most real research. The critical value depends on the degrees of freedom (n − 1) and is read from a t-table or computed in statistical software. It is always slightly larger than the equivalent z-value, which widens the interval to account for the extra uncertainty introduced by estimating the standard deviation from the sample itself.
  4. Compute the margin of error (critical value × standard error) and add/subtract it from the point estimate to get the upper and lower bounds.

Worked example. A researcher surveys 500 early-career researchers and finds a mean of 6.2 hours per week spent on grant-reporting administration, with a sample standard deviation of 2.3 hours.

  • Standard error = 2.3 / √500 ≈ 0.103
  • Because n is large, use z = 1.96 for a 95% CI
  • Margin of error = 1.96 × 0.103 ≈ 0.20
  • 95% CI = 6.2 ± 0.20 = [6.0, 6.4] hours

Confidence Interval for a Proportion

For a sample proportion (p̂), the standard error formula changes to √[p̂(1 − p̂) / n], and the z-distribution is typically used (the normal approximation is standard practice when np̂ and n(1 − p̂) are both reasonably large, conventionally ≥ 5–10).

Worked example. A study finds that 62% of surveyed early-career researchers (n = 400) have a formal data management plan.

  • Standard error = √[0.62 × 0.38 / 400] ≈ 0.0243
  • Margin of error (95% CI) = 1.96 × 0.0243 ≈ 0.0476, or about 4.8 percentage points
  • 95% CI = 62% ± 4.8% = [57.2%, 66.8%]

How Confidence Level and Sample Size Change the Width of the Interval

Two relationships are worth internalizing, whether you are reading a study or planning one:

  • Higher confidence level, wider interval. For a fixed sample size, moving from a 95% to a 99% confidence level produces a wider interval, because greater certainty of capturing the true parameter requires a larger margin of error. A 90% CI is narrower than a 95% CI on the same data, but carries a higher chance of not containing the true parameter across repeated sampling.
  • Larger sample size, narrower interval. For a fixed confidence level, a larger sample produces a narrower interval, because standard error shrinks as sample size grows (it scales with 1/√n, not 1/n — doubling precision requires roughly quadrupling the sample). This is the statistical basis for the common design guidance that larger, well-powered samples yield more precise estimates, not just more likely to be “statistically significant.”

See experimental design for how sample-size planning connects to the precision a study will ultimately be able to report.

How to Interpret a Confidence Interval Correctly

This is the single most commonly misreported statistical concept in both student and published research writing. The intuitive-sounding interpretation — “there is a 95% probability that the true population mean lies within this interval” — is not the correct frequentist interpretation, and stating it that way in a manuscript is a factual error, not just imprecise phrasing.

In the frequentist framework that most introductory statistics courses and most published confidence intervals use, the population parameter is treated as a fixed, unknown constant, not a random variable. It either is or is not inside any one calculated interval; there is no probability left to assign once a specific sample has been drawn and a specific interval calculated. The confidence level describes the long-run reliability of the procedure: if the same sampling and interval-construction procedure were repeated many times on new samples from the same population, approximately 95% of the resulting intervals would contain the true parameter, and about 5% would not. Any single interval is one draw from that long-run process.

The correct phrasing: “we are 95% confident that the interval [5.8, 6.6] contains the true population mean,” where “confident” refers to the reliability of the method, not a probability statement about this specific interval. A true probability statement about the parameter, conditional on the observed data, is what a Bayesian credible interval provides instead — which is why the two are easy to conflate but are not interchangeable. See Frequentist vs. Bayesian Statistics for how the two frameworks diverge on exactly this point, and the Confidence Interval dictionary entry for the full definition-level treatment of this distinction, including a worked counter-example.

Confidence Interval vs. Margin of Error vs. P-Value vs. Prediction Interval

These four terms are routinely confused with one another:

  • Margin of error is a component of a confidence interval, not a separate concept — it is the critical-value-times-standard-error term added and subtracted from the point estimate. A CI is the point estimate plus and minus the margin of error.
  • P-value answers a different question entirely: given a null hypothesis, how likely is data this extreme (or more extreme) to occur by chance? A CI, by contrast, gives a range of plausible parameter values. The two are related — for a two-sided test at α = 0.05, a 95% CI that excludes the null value corresponds to a p-value below 0.05 — but a CI conveys more information (direction and magnitude of an effect, and its precision) than a p-value alone. See How to Report P Values and Null Hypothesis vs. Alternative Hypothesis for the hypothesis-testing side of this relationship.
  • Prediction interval estimates the range for a single future observation, accounting for both the uncertainty in the estimated parameter and the natural variability of individual observations — it is always wider than the confidence interval computed from the same data at the same confidence level, because predicting one new data point is inherently less certain than estimating an average.

Confidence Intervals in Different Research Contexts

The same underlying logic applies across research designs, though the estimator and standard-error formula change:

  • Survey research — CIs around a proportion or mean (as in the worked examples above) quantify sampling error, separate from non-sampling error like non-response or measurement bias, which a CI does not capture.
  • Clinical trials — CIs are reported around effect measures such as risk ratios, odds ratios, hazard ratios, or mean differences between arms. A CI that crosses the null value (1.0 for a ratio, 0 for a difference) indicates the result is not statistically significant at that confidence level, but the width and position of the interval still convey how precisely the effect was estimated and what range of true effects remains plausible.
  • Meta-analysis — forest plots display each included study’s point estimate and CI as a horizontal line, with the pooled (combined) estimate and its own, typically narrower, CI shown at the bottom — visually illustrating how combining studies increases precision.
  • Regression analysis — CIs around a regression coefficient indicate the range of plausible values for the relationship between a predictor and an outcome, holding other variables constant, and are reported alongside the coefficient and its p-value in most regression output tables.

Calculating Confidence Intervals in Statistical Software

Manual calculation is useful for understanding the mechanics, but in practice CIs are almost always computed in software:

  • R — functions such as t.test() return a confidence interval for a mean by default; confint() returns CIs for fitted model coefficients (e.g. from lm() or glm()).
  • Python — the scipy.stats module provides interval functions for common distributions (e.g. a t-based interval for a mean using the sample statistics), and libraries such as statsmodels return CIs alongside regression coefficients.
  • Excel — the CONFIDENCE.T and CONFIDENCE.NORM functions return the margin of error for a mean using the t- and z-distributions respectively; this is added to and subtracted from the sample mean to get the interval.
  • SPSS — CIs for a mean are available through the Explore or One-Sample T Test procedures; CIs for regression coefficients are a standard option in the Linear Regression dialog.

Whichever tool is used, it is worth checking which distribution (z or t) and which standard-error formula the software defaults to, since this affects the exact bounds returned, particularly for small samples.

Reporting Confidence Intervals in Research

Reporting a confidence interval alongside a point estimate is not optional in most current reporting standards. The APA Publication Manual (7th edition, Section 6.5) states that an effect size and its confidence interval should be reported for each primary outcome, alongside significance testing. The CONSORT 2010 statement, the standard reporting checklist for randomized trials, likewise requires effect sizes and their precision (confidence intervals) for every primary and secondary outcome, rather than p-values reported in isolation. In practice, this means a results section should rarely report a bare significant/not-significant verdict without also giving the reader the interval that shows how precisely the effect was actually estimated.

Common Mistakes When Reporting or Interpreting Confidence Intervals

  • Treating the CI as a probability statement about the parameter. The most common error, covered in detail above — the correct frequentist interpretation is about the long-run reliability of the procedure, not the probability that this one interval contains the true value.
  • Confusing a sample range with a confidence interval. A statement like “ages ranged from 22 to 68” is just the observed minimum and maximum — it has no stated confidence level and no defined estimation procedure, so it is not a confidence interval even though it superficially resembles one.
  • Over-interpreting a wide interval as “no effect.” A wide CI usually signals imprecision (often from a small sample), not necessarily a small or absent effect — the interval may still be centered on a meaningful effect size even if it is wide.
  • Ignoring where the interval sits relative to a meaningful threshold. Whether a CI excludes the null value is a significance question; whether it excludes or includes values that would be considered practically meaningful is a separate, often more useful, question for interpreting real-world relevance.

Frequently Asked Questions

What does a 95% confidence interval mean in simple terms?

It means the method used to construct the interval would, if repeated on many independent samples from the same population, produce intervals that contain the true population value about 95% of the time. It is a statement about the reliability of the procedure, not a 95% probability that the true value falls in this one specific interval.

Why is a 95% confidence level used so often instead of, say, 90% or 99%?

95% has become a conventional default in many fields, balancing a reasonably high level of confidence against a manageable interval width; it is not a mathematical requirement. 90% and 99% (and other levels) are legitimate choices and are used routinely — the appropriate level depends on the consequences of being wrong and the field’s reporting conventions.

What does it mean when a confidence interval includes zero (or 1.0 for a ratio)?

For a difference between groups, an interval that includes zero means the data are consistent with there being no difference at the stated confidence level — the result is not statistically significant at that threshold. For a ratio measure (risk ratio, odds ratio, hazard ratio), the equivalent null value is 1.0 rather than zero.

Can a confidence interval be too wide to be useful?

Yes. A very wide interval, typically the result of a small sample or highly variable data, may be too imprecise to support a practical decision even if it technically excludes the null value. Narrowing it generally requires a larger sample, since standard error shrinks with sample size.

What sample size do I need for a narrower confidence interval?

Because standard error scales with 1/√n, cutting the margin of error in half requires roughly quadrupling the sample size, not just doubling it. Formal sample-size and power calculations, done before data collection, are the standard way to plan for a target level of precision.

Is a confidence interval the same as a credible interval?

No. A confidence interval is a frequentist construct describing the reliability of the estimation procedure. A credible interval is the Bayesian equivalent and does support a direct probability statement about the parameter, but only because it starts from a prior distribution rather than treating the parameter as a fixed constant. See Frequentist vs. Bayesian Statistics for the full comparison.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →