ðŸŽŊ Confidence Interval Calculator

Last updated: June 8, 2026

Confidence Interval Calculator

Build a CI for a mean or proportion — with margin of error broken out.

95% Confidence Interval
Margin of Error Span
Point Estimate

Confidence Intervals: What the Number Actually Tells You (And What It Doesn't)

There is arguably no statistic more routinely misread than the confidence interval. Researchers write papers around them, news outlets cite them, and product managers paste them into slide decks — and yet the majority of people reading those numbers hold an interpretation that is technically wrong. Understanding what a confidence interval actually guarantees, how the machinery behind it works, and when to reach for a z-distribution versus a t-distribution separates competent data analysis from statistical theater.

The Frequentist Promise

A 95% confidence interval does not mean "there is a 95% probability the true parameter lies inside this interval." In frequentist statistics, the true population mean ξ (or proportion p) is a fixed, unknown constant — it is not a random variable, so it cannot have a probability of being in a range. The interval itself is the random object, constructed fresh from each sample you draw.

The correct statement is procedural: if you repeated your sampling procedure and interval construction an infinite number of times, 95% of the resulting intervals would contain the true parameter. For any single interval you've already built, the true value is either inside it or it isn't. The 95% is a long-run property of the method, not a single-trial probability. This distinction matters enormously if you're making decisions based on whether a parameter is "probably" in a range.

The Anatomy of a Confidence Interval

Every confidence interval for a mean or proportion follows the same skeleton:

CI = Point Estimate Âą Margin of Error

where the margin of error itself decomposes as:

ME = Critical Value × Standard Error

Breaking it down this way is not just pedagogical bookkeeping. Each component tells you something actionable. The standard error reflects how much natural sampling variability exists in your estimate — it shrinks as √n, which is why quadrupling your sample size only halves your interval width. The critical value encodes your chosen confidence level — higher confidence demands a larger critical value, which widens the interval. You cannot simultaneously achieve high confidence and a narrow interval without collecting more data.

Z-Distribution vs. T-Distribution: The Correct Choice

The decision between using a z critical value and a t critical value hinges on two things: whether you know the population standard deviation σ, and your sample size.

In practice, σ is almost never known. When you estimate it from your sample using s, you introduce an additional layer of uncertainty. The t-distribution accounts for this by having heavier tails than the normal — those tails represent the extra uncertainty from estimating σ. The degrees of freedom parameter (df = n − 1) governs how heavy those tails are. With df = 4 (n = 5), the 95% critical value is 2.776, compared to z = 1.960. With df = 29 (n = 30), it's already 2.042 — quite close to the z value. By the time df exceeds roughly 120, the t and z distributions are functionally indistinguishable.

The practical takeaway: always use the t-distribution when you're estimating σ from sample data, particularly with smaller samples. Using z when you should use t will produce intervals that are slightly too narrow — they'll contain the true parameter less often than the stated confidence level promises.

For proportions, the standard approach uses the z-distribution because the standard error formula √(pĖ‚(1−pĖ‚)/n) estimates the variability directly from the proportion itself. But this normal approximation only performs well when both np and n(1−p) are at least 10. If you're studying a rare event — say, a defect rate of 1% with a sample of 50 — the normal approximation breaks down and you need an exact method like the Clopper-Pearson interval.

Why Margin of Error Is the Number Worth Obsessing Over

Journalists and analysts often report confidence intervals without isolating the margin of error, which is a missed opportunity. The margin of error is what you control through study design. Want a margin of error of ±2 percentage points at 95% confidence for a proportion near 50%? You need approximately 2,401 observations. Cut your budget in half to 600 observations and your margin expands to ±4 points — which might render your survey useless for detecting differences between subgroups.

The formula for the required sample size to achieve a target margin of error E for a proportion is:

n = (z* / E)Âē × pĖ‚(1 − pĖ‚)

When you have no prior estimate of p, using pĖ‚ = 0.5 maximizes the expression pĖ‚(1 − pĖ‚) and gives the most conservative (largest) required n. This is standard practice in pre-study power calculations.

Common Errors That Produce Wrong Intervals

Using the population standard deviation formula (dividing by n) instead of the sample standard deviation (dividing by n − 1) when computing s is a frequent mistake that produces a biased standard error. The Bessel correction (the n − 1 denominator) exists precisely because sample variance computed with n in the denominator systematically underestimates σÂē.

A subtler error is applying a two-sided interval critical value when you actually want a one-sided bound. If you're only interested in whether the mean exceeds a threshold — say, whether a drug's effectiveness is above 40% — you want a one-sided lower confidence bound using z = 1.645 (for 95%), not the two-sided 1.960. The two-sided interval is more conservative in both directions simultaneously, which is not always what the decision requires.

Finally, confusing statistical significance with practical significance is endemic. A confidence interval that excludes zero (or any other null value) tells you the effect is detectable with your sample size. It says nothing about whether the effect is large enough to matter. A drug that reduces blood pressure by 0.3 mmHg might produce an interval of (0.1, 0.5) — statistically significant, clinically irrelevant.

Interpreting the Output in Context

When you calculate a confidence interval, the width of that interval is itself informative. A very wide interval — say, a mean income estimate of ($35,000, $85,000) — is honest, not embarrassing. It's telling you the data are too sparse or too variable to pin down the parameter precisely. Reporting such an interval correctly communicates uncertainty. Refusing to calculate the interval because the data are thin, or cherry-picking a different confidence level to make the interval look narrower, is analytical malpractice.

A narrow interval that excludes a practically meaningful threshold is your clearest signal. If you're testing whether the average response time of an API is under 200 ms, and your 99% interval is (145 ms, 178 ms), you've demonstrated with very high confidence that performance meets the target. The margin of error — roughly ±16 ms — tells you how precisely you've pinned down the true mean, and the confidence level tells you how reliable that precision is.

The confidence interval is not magic. It is a rigorous, reproducible summary of what a sample can tell you about a population, given explicit assumptions about distributional form and sampling independence. Use it with those assumptions in mind, decompose the margin of error to understand your precision, and choose z versus t based on what you actually know about σ — and you'll be using one of statistics' most powerful tools correctly.

FAQ

What is the difference between a 90%, 95%, and 99% confidence interval?
The confidence level controls the tradeoff between certainty and precision. A 90% CI uses a smaller critical value (z = 1.645), producing a narrower interval — but 10% of such intervals miss the true parameter. A 99% CI uses z = 2.576, giving a wider interval that captures the true value more reliably. The 95% level (z = 1.96) is the convention in most fields because it balances these competing demands reasonably well.
When should I use a t critical value instead of a z value?
Use the t-distribution whenever you are estimating the population standard deviation from your sample data (which is almost always the case in practice). The t-distribution has heavier tails than the normal to account for this extra uncertainty. The degrees of freedom are n − 1. As n grows large (roughly beyond 100–120), the t and z critical values converge and the choice becomes academic.
What does 'margin of error' actually measure?
The margin of error (ME) is the half-width of the confidence interval: the interval runs from point estimate minus ME to point estimate plus ME. It equals the critical value multiplied by the standard error, so it reflects both your chosen confidence level and the natural sampling variability of your estimate. A smaller ME means a more precise estimate, achievable through larger sample sizes or lower confidence levels.
Why does the calculator warn me when np or n(1−p) is less than 10?
The formula for a proportion confidence interval relies on the normal approximation to the binomial distribution. This approximation is only valid when both np and n(1−p) are at least 10, ensuring the binomial is roughly bell-shaped. If those conditions fail — common with rare events or very small samples — the normal-based interval may be too narrow or asymmetric. In those cases, consider the exact Clopper-Pearson interval.
Does a 95% confidence interval mean there is a 95% chance the true mean is inside it?
No — this is the most common misinterpretation. The true population parameter is a fixed (unknown) constant, not a random variable, so it cannot have a probability of being in a range. The 95% refers to the long-run procedure: if you repeated the sampling and interval construction many times, 95% of the resulting intervals would contain the true parameter. Any single specific interval either contains it or doesn't.
How can I make my confidence interval narrower without sacrificing confidence level?
The only way to narrow a confidence interval while keeping the confidence level fixed is to reduce the standard error — which means increasing the sample size n. The standard error for a mean is s/√n, so to halve the interval width you must quadruple n. You can also reduce variability by controlling the study design more carefully (e.g., stratified sampling), but collecting more data is the most direct lever.