Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
A confidence interval (CI) is a range of values, calculated from sample data, that estimates an unknown population parameter at a stated confidence level. A 95% interval comes from a procedure that would capture the true value in about 95% of repeated samples; it is not a 95% probability for any single interval. This guide covers the formula, hand calculations for a mean, a proportion and a difference, t versus z multipliers, small-sample proportions, and the common misreadings. For the compact operational definition and a counter-example, see the Confidence Interval dictionary entry.
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 confidence interval formula is point estimate ± (critical value × standard error). For a mean with a known population standard deviation or a large sample, that is x̄ ± z × (s / √n); with a small sample and unknown standard deviation, replace z with a t value. For a 95% interval, z = 1.96; the table below gives the common multipliers.
| Confidence level | Two-sided z critical value |
|---|---|
| 90% | 1.645 |
| 95% | 1.96 |
| 99% | 2.576 |
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 — (see standard error of the mean) 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
- Calculate the sample mean (x̄), the point estimate.
- Calculate the standard error of the mean: the sample standard deviation (s) divided by the square root of the sample size (s / √n).
- 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.
- 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%]
Why a Mean Usually Needs t Rather Than z
The NIST/SEMATECH e-Handbook gives the z-based interval for a mean as Ȳ ± z(1−α/2) × σ/√N, and notes that it assumes the population standard deviation σ is known. In practice σ is almost never known, so it is estimated from the sample, and the interval becomes wider to reflect that extra uncertainty. The confidence coefficient is 1−α, and the 95% level means that intervals built this way would bracket the parameter in about 95% of cases.
The handbook’s confidence limits for the mean use the t distribution instead: Ȳ ± t(1−α/2, N−1) × s/√N, where s is the sample standard deviation and N−1 the degrees of freedom. The handbook’s worked example uses the ZARR13.DAT data set with N = 195, mean 9.261460 and s = 0.022789, and a critical value t(0.975, 194) = 1.9723.
- Standard error = 0.022789 / √195 ≈ 0.001632
- Margin of error = 1.9723 × 0.001632 ≈ 0.003219
- 95% CI = 9.261460 ± 0.003219 = (9.258242, 9.264679), the interval the handbook reports
The data table below shows how the t multiplier depends on degrees of freedom and confidence level. With 1 degree of freedom the 95% multiplier is 12.706, about 6.5 times the normal value of 1.960; at 10 degrees of freedom it is 2.228 (about 14% wider); at 30 it is 2.042 (about 4% wider); and at 60 it is 2.000. This is why the “n ≥ 30” rule of thumb is only a rule of thumb: even at 30 the t interval is still slightly wider than the z interval, and with fewer than about 10 observations the difference is large. Because the multiplier multiplies the standard error, a small sample hurts twice: the standard error is larger and so is the multiplier.
Choosing between z and t
| Situation | Multiplier | Interval half-width |
|---|---|---|
| Population standard deviation known | z (1.960 at 95%) | z × σ/√N |
| Population standard deviation estimated from the sample | t with N−1 degrees of freedom | t × s/√N |
The same logic explains why software that reports an interval for a mean almost always uses t: the sample standard deviation is what you have.
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.
Confidence Intervals for Small-Sample Proportions: Wilson and Exact
The normal approximation in the proportion example above works poorly when the sample is small or the proportion is near 0 or 1. The NIST/SEMATECH e-Handbook section on confidence intervals for proportions gives the Wilson interval, which uses z, the observed proportion p̂ and n in a form whose limits are not simply p̂ ± a fixed margin, and an exact binomial interval that is based directly on the binomial distribution.
The handbook’s exact-interval example uses a 90% level (α = 0.10) with 4 defective items in a sample of 20, so p̂ = 0.20. The exact 90% interval is (0.071, 0.400). It is not symmetric about 0.20: the lower limit is 0.129 below the estimate and the upper limit is 0.200 above it. A symmetric “p̂ ± margin” interval would misstate this skew, which is the main reason small-sample work prefers Wilson or exact intervals.
The handbook also shows a one-sided limit: with p̂ = 0.13 and n = 200, the one-sided 95% lower confidence limit is p ≥ 0.09577. One-sided limits suit questions such as “is the defect rate at least this high?”, and use the one-sided critical value rather than the two-sided one in the tables above.
For the full treatment of proportions, see confidence interval for a proportion.
Confidence Interval for the Difference Between Two Means
When you compare two independent groups, the quantity of interest is the difference in means, and the interval is built the same way: the observed difference plus and minus a critical value times the standard error of that difference. Without assuming equal variances, the NIST/SEMATECH e-Handbook of Statistical Methods gives the Welch test, whose standard error is √(s₁²/N₁ + s₂²/N₂) with Welch-Satterthwaite degrees of freedom; the matching interval is:
(x̄₁ − x̄₂) ± t × √(s₁²/N₁ + s₂²/N₂)
Illustrative example. Group A has mean 52, standard deviation 10 and n = 40; group B has mean 47, standard deviation 12 and n = 45.
- Difference = 52 − 47 = 5
- Standard error = √(100/40 + 144/45) = √5.7 ≈ 2.39
- Welch degrees of freedom ≈ 83, so the 95% t value is about 1.99
- Margin of error ≈ 1.99 × 2.39 ≈ 4.75
- 95% CI for the difference ≈ [0.25, 9.75]
Because this interval excludes zero, the data reject “the two means are equal” at the 5% significance level, because a two-sided test and the matching confidence interval agree. Note how close the lower bound sits to zero: the interval shows the effect could be tiny as well as large, which a bare p-value would hide. For ratio comparisons, see confidence interval for an odds ratio, and for binary outcomes see confidence interval for a proportion. For how the two measures differ, see p-value vs confidence interval.
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.
See also reporting confidence intervals — The correct format for reporting a confidence interval in a manuscript: APA bracket notation, AMA/biomedical parenthetical notation, worked examples for means, proportions, and ratios, and a checklist of the mistakes reviewers flag most.
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.
What a 95% Interval Does and Does Not Tell You
Greenland and colleagues (2016, European Journal of Epidemiology 31:337–350) catalogue common misinterpretations of P values, confidence intervals and power. Several concern intervals directly, and they are useful as a checklist when you read or write results.
- A 95% interval is a range of effect sizes that tests did not reject. A 95% CI can be read as the set of effect sizes whose tests, using the same data and assumptions, gave P > 0.05. It is a compatibility range, not a probability statement.
- “This interval has a 95% chance of containing the true value” is wrong. The 95% belongs to the procedure, not to the interval you happened to obtain.
- Values outside the interval are not “ruled out.” They are less compatible with the data under the model, not excluded.
- Overlapping intervals do not mean “no significant difference.” Two group intervals can overlap while the interval for their difference still excludes zero; compare the difference directly, as in the two-means example above.
- 95% of future estimates do not fall inside this interval. A replication has its own sampling error, so its estimate need not fall inside the original interval.
- Precision is judged by width, not by whether the null value is inside. A narrow interval that barely excludes zero and a wide interval that barely includes it carry different information about how well the effect was estimated.
The full paper is available at PubMed Central (doi:10.1007/s10654-016-0149-3).
Before and after the data are collected
The 95% describes the interval-building procedure before the data are seen. Once an interval such as [5.8, 6.6] has been computed, it either contains the true parameter or it does not; the frequentist probability attaches to the method, which is why careful wording says “95% confident” rather than “95% probable.”
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. fromlm()orglm()). - Python — the
scipy.statsmodule provides interval functions for common distributions (e.g. a t-based interval for a mean using the sample statistics), and libraries such asstatsmodelsreturn CIs alongside regression coefficients. - Excel — the
CONFIDENCE.TandCONFIDENCE.NORMfunctions 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.
Can I say there is a 95% probability that the true mean is in my interval?
Not under the frequentist reading. The 95% refers to the long-run behaviour of the procedure; a computed interval either contains the true mean or it does not. A direct probability statement requires a Bayesian credible interval and a prior.
Do overlapping confidence intervals mean there is no significant difference?
No. Greenland et al. (2016) list this as a misinterpretation. Overlapping group intervals can still correspond to a significant difference; test or build an interval for the difference itself.
Why use t instead of z for a mean?
Because the population standard deviation is usually unknown and is estimated by s. The t multiplier, with N−1 degrees of freedom, is larger than z and widens the interval accordingly; the NIST/SEMATECH e-Handbook uses t(1−α/2, N−1) for the confidence limits of a mean.
What is the difference between a Wilson and an exact interval for small samples?
Both are given in the NIST/SEMATECH e-Handbook. The Wilson interval is a closed-form expression using z, p̂ and n whose limits are not symmetric about p̂; the exact interval is computed directly from the binomial distribution. For 4 successes in 20 trials at the 90% level the handbook’s exact interval is (0.071, 0.400).
Does a wider interval mean a worse study?
A wider interval means a less precise estimate, which commonly comes from a smaller sample, more variable data or a higher confidence level. It is a statement about precision, not by itself about study quality or about whether an effect exists.
Related CASRAI guide: standard score (z-score) — How to calculate a z-score, what standardization does (and doesn’t) do to a distribution, and how to correctly read a standard normal (z) table, including a full table.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.2 Confidence Limits for the Mean: https://www.itl.nist.gov/div898/handbook/eda/section3/eda352.htm (read 2026-11-21)
- NIST/SEMATECH e-Handbook, 1.3.6.7.2 Critical Values of the Student’s t Distribution: https://www.itl.nist.gov/div898/handbook/eda/section3/eda3672.htm (read 2026-11-21)
- NIST/SEMATECH e-Handbook, 7.1.4 Confidence intervals for the mean: https://www.itl.nist.gov/div898/handbook/prc/section1/prc14.htm (read 2026-11-21)
- NIST/SEMATECH e-Handbook, 7.2.4.1 Confidence intervals for proportions: https://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm (read 2026-11-21)
- NIST/SEMATECH e-Handbook, 7.3.1 Comparing two means (Welch test): https://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm
- Greenland S, Senn SJ, Rothman KJ, et al. Statistical tests, P values, confidence intervals, and power: a guide to misinterpretations. Eur J Epidemiol 2016;31:337–350. https://pmc.ncbi.nlm.nih.gov/articles/PMC4877414/ (read 2026-11-21)
Data: Two-sided t critical values by degrees of freedom and confidence level, with width relative to the normal 95% multiplier
Student t critical values for 90%, 95% and 99% two-sided intervals at selected degrees of freedom, read from the NIST/SEMATECH e-Handbook t table; the infinity row is the standard normal value. The relative-width column divides the 95% t value by the 95% normal value (1.960) to show how much wider a small-sample interval is.
Period covered: 2026.
| Degrees of freedom | t, 90% interval (multiplier) | t, 95% interval (multiplier) | t, 99% interval (multiplier) | 95% half-width relative to normal (ratio) |
|---|---|---|---|---|
| 1 | 6.314 | 12.706 | 63.657 | 6.48 |
| 2 | 2.92 | 4.303 | 9.925 | 2.2 |
| 5 | 2.015 | 2.571 | 4.032 | 1.31 |
| 10 | 1.812 | 2.228 | 3.169 | 1.14 |
| 20 | 1.725 | 2.086 | 2.845 | 1.06 |
| 30 | 1.697 | 2.042 | 2.75 | 1.04 |
| 60 | 1.671 | 2 | 2.66 | 1.02 |
| Infinity (normal) | 1.645 | 1.96 | 2.576 | 1 |
Sources
- NIST/SEMATECH e-Handbook 1.3.6.7.2 Critical Values of the Student's t Distribution (accessed 2026-11-21)
- NIST/SEMATECH e-Handbook 1.3.5.2 Confidence Limits for the Mean (accessed 2026-11-21)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







