What Is a Confidence Interval?

A sample mean of 50 looks precise β€” until you ask how far the true mean could be. A confidence interval answers that question: it turns a single estimate into a range of plausible values, and shows how much trust the range deserves. This guide explains what a confidence interval is, how to build one step by step, and what 95% really means β€” with worked examples from three calculators on this site.

A confidence interval is a range of plausible values for a population parameter, built as a point estimate plus or minus a margin of error at a chosen confidence level β€” usually 95%. The level describes how often the procedure works across repeated samples, not the odds for one particular interval. A sample mean of 50, on its own, says nothing about how far the true mean might be. The interval turns that single number into a range you can use β€” and shows exactly how much uncertainty is left.

What Is a Confidence Interval?

A confidence interval is a range of values that is likely to contain the true value of a population parameter β€” a mean, a proportion, or the difference between two means. It is built from your sample in two parts: a point estimate (your best single guess, such as the sample mean) and a margin of error (how far the truth could plausibly sit from that guess).

Think of a point estimate as a single arrow fired at a target, and a confidence interval as a safety net. The arrow is your best guess; the net is the range you are willing to claim. A wider net catches the truth more often, but it says less about where the truth is. A narrower net says more, but misses more often. The confidence level β€” usually 95% β€” is how often you want the net to catch the truth when you repeat the whole exercise.

That is why a confidence interval always comes with its level attached: β€œthe 95% confidence interval is [46.266, 53.734]” is a complete statement; β€œthe interval is [46.266, 53.734]” is not. The level tells you how the interval was made, and how much to trust it.

A confidence interval is a range for the parameter β€” the unknown truth about the population β€” not a range for the data. It does not say where 95% of the individual values fall; it says where the true mean, the true proportion, or the true difference probably sits.

Three things decide what an interval looks like: the point estimate (where it is centred), the standard error (how much the estimate wobbles from sample to sample), and the critical value (how many standard errors out you go for the confidence level you chose). The next sections take each one in turn β€” and then put them to work in four examples, one for each of the confidence interval calculators on this site.

The Formula, Piece by Piece

Every confidence interval follows the same pattern, whatever the parameter:

Confidence interval = point estimate Β± margin of error
Margin of error = critical value Γ— standard error

Each part answers a different question. The point estimate is where the interval is centred: the sample mean for a mean, pΜ‚ for a proportion, or the difference between two sample means. The standard error measures how much that estimate would wobble if you took another sample β€” for a mean it is SE = s / √n, where s is the sample standard deviation and n is the sample size. If the two are easy to confuse, read our guide to standard error vs standard deviation, or work one out on the Standard Error Calculator. The critical value is how many standard errors out you go, and it depends on the confidence level you chose β€” and, for small samples, on the sample size.

IngredientWhat it isFor a mean
Point estimateYour best single guess from the sampleSample mean, xΜ„
Standard errorHow much the estimate wobbles between samplesSE = s / √n
Critical valueHow many standard errors out you goz* = 1.96, or t* with df = n βˆ’ 1

The Margin of Error Calculator handles the second half of the formula: give it a confidence level and a standard error and it returns the margin of error β€” and the interval that goes with it.

What Does 95% Really Mean?

Take 100 different random samples from the same population and build a 95% confidence interval from each one. About 95 of those 100 intervals will contain the true value, and about 5 will miss it. That is what 95% describes: the procedure, repeated over many samples β€” not the interval sitting in front of you.

The common misreading is to say, once the interval is computed, β€œthere is a 95% chance that the true value is inside this interval.” That is wrong. Once calculated, the interval either contains the true value or it does not; the 95% was spent when the interval was built, and there is no probability left to assign. The NIST/SEMATECH e-Handbook makes the same point about confidence limits for the mean: a 95% interval does not mean a 95% probability that this one interval contains the true mean β€” it means that about 95% of intervals built this way, over many repeats, would contain it.

This misreading is so widespread that it has been documented in the research literature itself: Greenland et al. (2016) and Morey et al. (2016) both showed how often even trained researchers describe a 95% interval as though it were a 95% probability about one interval. The correct way to talk about it is procedural: β€œif I kept taking samples and building intervals this way, about 95 in 100 would capture the true value.”

So what should you take away from a single interval? Its width. A narrow interval says the data pin the parameter down tightly; a wide interval says honestly that they do not. The level tells you how the interval was built; the width tells you how much it says.

Z or T? Choosing the Right Critical Value

The critical value is where the confidence level meets the data, and the choice depends on one question: do you know the population standard deviation, Οƒ?

If Οƒ is known β€” rare in practice, but it happens with calibrated instruments and large reference data sets β€” use a z value. The three z values worth memorising are 1.645 for 90%, 1.96 for 95% and 2.576 for 99%. You can look up any other level on the Critical Z-Value Calculator.

If Οƒ is unknown β€” the usual case β€” use a t value, worked out from the sample standard deviation s, with degrees of freedom df = n βˆ’ 1. A t value is always a little wider than the matching z value, because estimating Οƒ adds uncertainty; the gap shrinks as the sample grows, and for large samples t and z are practically the same. Look up any t value on the T-Distribution Calculator.

Confidence levelz*t* with df = 9t* with df = 29
90%1.6451.8331.699
95%1.9602.2622.045
99%2.5763.2502.756

A classic example comes from analytical chemistry: with 10 measurements and a 95% confidence level, the degrees of freedom are df = 10 βˆ’ 1 = 9, so the critical value is t = 2.262, and the interval is Mean Β± 2.262 Γ— (SD / √n). With 30 measurements the same 95% level needs only t = 2.045 β€” the extra data have earned a tighter interval.

The rule in one line: Οƒ known β†’ z. Οƒ unknown β†’ t with df = n βˆ’ 1. Using z when Οƒ is unknown and the sample is small is one of the most common mistakes in interval building β€” it makes the interval narrower than it should be.

Worked Example 1: A Mean

Thirty measurements have a sample mean of 50 and a sample standard deviation of 10. Build the 95% confidence interval for the true mean.

  1. Standard error. SE = 10 / √30 = 1.826. This is how much the sample mean would wobble from sample to sample.
  2. Critical value. The population standard deviation is not known, so use t, with df = 30 βˆ’ 1 = 29. The 95% critical value is t* = 2.045.
  3. Margin of error. MoE = 2.045 Γ— 1.826 = 3.734.
  4. Interval. 50 Β± 3.734 = [46.266, 53.734].

50 Β± 2.045 Γ— (10 / √30) = 50 Β± 3.734 = [46.266, 53.734]

The plausible values for the true mean run from 46.266 to 53.734. These are the exact defaults at the top of the Confidence Interval from Mean and Standard Deviation Calculator β€” enter 50, 10 and 30 at 95% and you will see the same interval, with the same t*, standard error and margin of error.

Worked Example 2: The Width Table

Same data as Example 1 β€” mean 50, SD 10 β€” with only the confidence level changed first, and then only the sample size:
Confidence level n t* SE Margin of error Interval
90% 30 1.699 1.826 3.102 [46.90, 53.10]
95% 30 2.045 1.826 3.734 [46.266, 53.734]
99% 30 2.756 1.826 5.032 [44.97, 55.03]
95% 120 1.980 0.913 1.808 [48.19, 51.81]
Two patterns jump out. Raising the level from 90% to 99% stretches the margin of error from 3.102 to 5.032 β€” the price of extra confidence is a wider interval. Quadrupling the sample from 30 to 120 roughly halves the margin of error, from 3.734 to 1.808, because the standard error falls with √n: √120 / √30 = 2. That is the quadrupling rule β€” to halve the width, quadruple the sample. Try the same numbers on the CI-from-Mean calculator at 95% and you will see [46.266, 53.734] for n = 30.

Worked Example 3: A Proportion

Sixty people out of 200 surveyed say yes. The sample proportion is pΜ‚ = 60 / 200 = 0.30. Build the 95% confidence interval for the true proportion. The textbook method is the Wald interval. Its standard error is SE = √(pΜ‚(1 βˆ’ pΜ‚) / n) = √(0.30 Γ— 0.70 / 200) = 0.0324. The margin of error is MoE = 1.96 Γ— 0.0324 = 0.0635, so the interval is 0.30 Β± 0.0635 = [0.236, 0.364]. The Wilson interval gives [0.241, 0.367] on the same data β€” a touch narrower, and slightly asymmetric around 0.30. Wilson is the better choice near the edges: the Wald interval is symmetric around pΜ‚, so when pΜ‚ is close to 0 or 1 it can spill below 0 or above 1 β€” impossible values for a proportion. Wilson stays inside [0, 1] and keeps its stated coverage better for small samples and extreme proportions. At 99% the same data give z = 2.576, MoE = 0.0835, a Wald interval of [0.217, 0.383] and a Wilson interval of [0.224, 0.389]. Run the numbers yourself on the CI for a Proportion Calculator β€” it reports both the Wald and the Wilson interval, and flags the Wald interval when it strays outside [0, 1].

Worked Example 4: A Difference of Two Means

Group A scores a mean of 75 (SD 10, n = 30) and Group B a mean of 70 (SD 12, n = 30). Is the 5-point gap real? Build the 95% confidence interval for the difference.
  1. Difference. 75 βˆ’ 70 = 5.
  2. Standard error. SE = √(10² / 30 + 12² / 30) = √8.133 = 2.85.
  3. Critical value. Welch’s method, df β‰ˆ 56, so t* β‰ˆ 2.00.
  4. Margin of error. MoE = 2.00 Γ— 2.85 = 5.71.
  5. Interval. 5 Β± 5.71 = [βˆ’0.71, 10.71].
The interval includes 0 β€” so at 95% the difference is not statistically significant. The data are consistent with no difference at all, and equally consistent with Group A being ahead by as much as 10.71 points. The interval does not say β€œthere is no difference”; it says the evidence is not strong enough to rule one out. The pooled method tells the same story here: assuming equal variances gives a pooled SD of sp = 11.05 and df = 58, and the pooled interval works out to the same [βˆ’0.71, 10.71]. Equal sample sizes and similar standard deviations make the two methods agree here; with unequal samples or very different spreads they can diverge. Check it on the CI for Difference of Two Means Calculator, which also flags whether the interval contains 0.

Confidence Interval vs Hypothesis Test

A hypothesis test asks a yes-or-no question: is there a real difference? A confidence interval answers the same question β€” and shows the size. The two are connected by one rule: if the 95% confidence interval for a difference excludes the null value (usually 0), the difference is statistically significant at the 5% level; if the interval includes 0, it is not. Example 4 shows this live: the interval [βˆ’0.71, 10.71] contains 0, so the 5-point gap is not significant at 95%.

A p-value is the probability of seeing data at least this extreme if the null hypothesis were true β€” a single number that says how surprising the result is. It does not say how big the effect is, or how precisely it is estimated. That is what the interval adds: it gives the range of plausible values, so you can see whether the effect is large, small, or too uncertain to call. A confidence interval that excludes zero for a difference between groups tells you the difference is statistically significant β€” and it also tells you how large it might be. Report both: the interval for the size, the p-value for the strength of the evidence.

Common Mistakes

Five mistakes account for most of the confusion about confidence intervals:

  1. Reading β€œ95%” as the odds for one interval. β€œThere is a 95% chance the true value is in this interval” is wrong. Once calculated, the interval either contains the true value or it does not; the 95% describes the procedure across repeated samples.
  2. Using z when Οƒ is unknown and n is small. With an estimated standard deviation you need a t value with df = n βˆ’ 1. Using z makes the interval narrower than it should be.
  3. Forgetting the interval is about the parameter, not the sample. It is not the range that contains 95% of the data, and it is not the range of the sample values β€” it is the range of plausible values for the population parameter.
  4. Chasing 100% confidence. Achieving 100% confidence is impossible: to be certain of catching the true value, the interval would have to be infinitely wide. High confidence is bought with width.
  5. Treating an interval that includes 0 as proof of β€œno difference”. It only means the data are consistent with no difference β€” and, in Example 4, with a difference as large as 10.71.

What does a 95% confidence interval really mean?

It means the method works 95% of the time. Build a 95% interval from each of 100 different random samples, and about 95 of them will contain the true value. It does not mean there is a 95% probability that this one interval contains it β€” once the interval is calculated, the true value is either inside or outside, and the 95% was already spent. What the interval does tell you is the range of plausible values, and its width tells you how precisely the data pin the parameter down.

What makes a confidence interval wider or narrower?

Three things. A higher confidence level widens it (99% is wider than 95% because t* is larger); a bigger sample narrows it (the standard error falls with √n); and more variability widens it (a larger standard deviation means a larger standard error). The width table in Example 2 shows the first two at work: the margin of error grows from 3.102 at 90% to 5.032 at 99%, and shrinks from 3.734 to 1.808 when the sample is quadrupled from 30 to 120.

How is a confidence interval different from a p-value?

A p-value is a single probability: how surprising the data would be if the null hypothesis were true. A confidence interval is a range of plausible values for the parameter, and its width shows how precise the estimate is. The two agree on significance β€” if a 95% interval excludes the null value, the p-value is below 0.05 β€” but only the interval shows the size of the effect. A tiny p-value with a wide interval means β€œsomething is there, but we cannot say how big”; a narrow interval means the size is pinned down.

Frequently Asked Questions

A confidence interval is a range of plausible values for a population parameter β€” a mean, a proportion, or the difference between two means. It is built as a point estimate plus or minus a margin of error at a chosen confidence level, usually 95%. The level describes how often the procedure works across repeated samples, not the odds for one interval.

It means the method works 95% of the time. Build 95% intervals from 100 different random samples and about 95 of them will contain the true value. It does not mean there is a 95% probability that this one interval contains it β€” once calculated, the interval either contains the true value or it does not.

Take the point estimate and add and subtract the margin of error: CI = point estimate Β± (critical value Γ— standard error). For a mean, the standard error is s / √n, and the critical value is z* = 1.96 at 95% when Οƒ is known, or t* with df = n βˆ’ 1 when it is not. The worked examples in this article show each step.

The margin of error is half the width of the interval. The confidence interval is the point estimate plus and minus that margin: CI = estimate Β± MoE. For example, an estimate of 50 with a margin of error of 3.734 gives the interval [46.266, 53.734].

Use a z value when the population standard deviation Οƒ is known; use a t value when Οƒ is unknown and estimated from the sample, with degrees of freedom df = n βˆ’ 1. At 95% with 10 measurements, df = 9 and t = 2.262; with 30 measurements, df = 29 and t = 2.045.

Three things widen it: a higher confidence level (99% is wider than 95%), a smaller sample, and more variability (a larger standard deviation means a larger standard error). To narrow an interval, take a bigger sample β€” quadrupling the sample roughly halves the width.

Yes. An interval for a difference of two means can run below zero β€” Example 4 in this article gives [βˆ’0.71, 10.71]. A Wald interval for a proportion can also dip below 0 when the proportion is near 0; that is one reason the Wilson interval is preferred near the edges.

A p-value is a single probability: how surprising the data would be if the null hypothesis were true. A confidence interval is a range of plausible values for the parameter, and its width shows how precise the estimate is. If a 95% interval excludes the null value, the p-value is below 0.05 β€” but only the interval shows the size of the effect.

Conclusion

A confidence interval turns a single estimate into a range you can trust. Build it as point estimate Β± margin of error, choose 95% unless you have a reason not to, and remember what the level means: the procedure works 95% of the time across repeated samples β€” the width, not the level, is what tells you how much the data pin the parameter down. The examples above are all runnable on this site’s calculators: the confidence interval calculator for a mean, the calculator for a proportion, and the calculator for a difference of two means. Pick your numbers, build the interval, and read what it says β€” including when it includes zero.

Check Tools

Try the numbers from this guide on your own data:

Confidence Interval from Mean and Standard Deviation Calculator

Build the 95% confidence interval for a mean, exactly as in Worked Example 1 β€” with the t value, standard error and margin of error shown.

Try the CI-from-Mean calculator β†’

CI for a Proportion Calculator

Build Wald and Wilson intervals for a proportion, as in Worked Example 3 β€” with a warning when the Wald interval strays outside [0, 1].

Try the CI for a Proportion Calculator β†’

CI for Difference of Two Means Calculator

Build the interval for the difference between two means, Welch or pooled, as in Worked Example 4 β€” and see whether it contains 0.

Try the CI for Difference of Two Means Calculator β†’

You can find every calculator on the site in one place: Browse all our statistical tools β†’