Confidence Interval Calculator

Build a confidence interval for a mean or a proportion in seconds. Enter your summary statistics or paste raw data, choose a confidence level, and get the interval, margin of error, and standard error — with the right z or t critical value applied automatically and every step shown.

Textbook-accurate · Reviewed July 2026 · z and t critical values follow the NIST e-Handbook of Statistical Methods

Choose Your Interval Type

Sample mean (x̄)
Pop. SD (σ)
Sample size (n)
Confidence level

Your Confidence Interval

95% Confidence Interval
Enter values to see your result
Estimate
Margin of error
Std error
Critical value

Interval Visual

Point estimate with its margin of error

What Is a Confidence Interval?

A confidence interval is a range of plausible values for an unknown population parameter — such as a true average or a true proportion — estimated from a sample. Instead of reporting a single number, which is almost certainly a little off, a confidence interval gives you a range along with a stated level of confidence in the method that produced it. You’ll usually see it written like “the average was 72 (95% CI: 68.08 to 75.92),” pairing a point estimate with the uncertainty around it.

The interval has two ingredients: a point estimate (your sample mean or sample proportion) sitting at the center, and a margin of error extending out on either side. The margin of error is what turns a single guess into a range, and its size depends on how confident you want to be, how much your data varies, and how large your sample is.

The Confidence Interval Formula

Every confidence interval follows the same underlying pattern:

estimate ± (critical value × standard error)

The specific formula depends on what you’re estimating and what you know. This calculator handles the four most common cases:

Mean with known σ (z-interval)

When you know the population standard deviation, use the z-interval:

x̄ ± z* × (σ / √n)

Here x̄ is the sample mean, σ is the population standard deviation, n is the sample size, and z* is the z critical value for your confidence level (1.96 for 95%).

Mean with unknown σ (t-interval)

In practice you rarely know the true σ, so you estimate it with the sample standard deviation s and use the t-distribution:

x̄ ± t* × (s / √n)

The t critical value t* depends on both the confidence level and the degrees of freedom (df = n − 1). Because the t-distribution has slightly heavier tails, it produces a marginally wider interval that honestly reflects the extra uncertainty of estimating σ from your data.

Proportion (survey or poll)

For a percentage — the share of people who prefer a candidate, the pass rate of a process — use the proportion interval:

p̂ ± z* × √( p̂(1 − p̂) / n )

where p̂ is the sample proportion (successes ÷ sample size). This is the formula behind every “±3% margin of error” you see in election polling.

How to Interpret a Confidence Interval (Correctly)

This is the single most misunderstood idea in introductory statistics, so it’s worth stating carefully. A 95% confidence interval does not mean “there is a 95% probability that the true value lies in this specific interval.” Once you’ve calculated an interval from your sample, the true parameter is a fixed number — it’s either inside your interval or it isn’t, and there’s no probability left to assign.

The correct interpretation is about the method, not the single interval: if you repeated the whole sampling procedure many times and built a confidence interval each time, about 95% of those intervals would contain the true parameter. The confidence level describes the long-run reliability of the process, like a net that catches the true value 95% of the time across many casts. In everyday reporting, it’s fine to say “we are 95% confident the true average is between 68.08 and 75.92” — just remember the confidence lives in the procedure that generated the range.

 CorrectIncorrect
What 95% describesThe reliability of the method over many samplesThe probability for this one interval
Statement“95% of such intervals capture the true value.”“There’s a 95% chance the true value is in here.”
The true parameterFixed but unknownRandomly moving into the interval

What Changes the Width of a Confidence Interval?

Three factors control how wide — and therefore how precise — your interval is:

  • Confidence level: higher confidence means a wider interval. A 99% interval is wider than a 95% interval on the same data, because you’re demanding greater certainty.
  • Sample size: larger samples give narrower intervals. Because the standard error is σ/√n, the width shrinks with the square root of n.
  • Variability: more spread-out data (a larger standard deviation) widens the interval.

Why is a 99% confidence interval wider than a 95%?

Because a higher confidence level uses a larger critical value. Moving from 95% to 99% raises the z critical value from 1.96 to 2.576 — about 31% larger — which directly multiplies the margin of error and widens the interval by the same proportion. This is the fundamental trade-off in estimation: you can have a narrow interval or high confidence, but not both at once without collecting more data.

The sample size trade-off

Because the margin of error is proportional to 1/√n, cutting it in half requires quadrupling your sample size, not doubling it. This is why large-scale surveys are expensive: precision gets progressively costlier the tighter you want the interval.

Critical Values for Common Confidence Levels

The z critical values below are used directly for proportions and for means with known σ. For a t-interval, the critical value is slightly larger and depends on your degrees of freedom, which this calculator computes exactly.

Confidence levelz critical value (z*)Typical use
90%1.645Quick estimates, lower stakes
95%1.960The research standard
99%2.576High-stakes decisions

Z-Interval vs. T-Interval: Which to Use

The choice comes down to one question: do you know the population standard deviation? Use a z-interval when σ is known (rare) or your sample is large. Use a t-interval when σ is unknown and you’re estimating it from the sample standard deviation — which is almost always the case in real research with smaller samples. The t-distribution’s heavier tails add a little width to account for that extra uncertainty, and as the sample grows the two intervals converge. The margin of error itself builds on the standard deviation, so it’s worth computing that accurately first with our Standard Deviation Calculator, or getting the mean and SD together from the Descriptive Statistics Calculator.

Where Confidence Intervals Are Used

  • Polling & surveys: the “margin of error” reported with every poll is the half-width of a 95% confidence interval for a proportion.
  • Clinical trials & medicine: treatment effects are reported with confidence intervals to show the range of plausible benefit.
  • A/B testing & product: intervals show whether an observed lift is real or within the noise.
  • Quality control: intervals monitor whether a process mean stays within specification.
  • Academic research: journals increasingly require confidence intervals alongside or instead of p-values, because they show the size and precision of an effect, not just its existence.

Frequently Asked Questions

A confidence interval is a range of plausible values for an unknown population value, like a true average or percentage, estimated from a sample. Instead of a single best guess, it gives a lower and upper bound plus a confidence level. For example, “the mean is 72 with a 95% CI of 68 to 76” says the sample estimate is 72 and, based on the data, the true mean plausibly falls between 68 and 76.

No — this is the most common misconception. Once an interval is calculated, the true parameter is a fixed number that is either in the interval or not, so there’s no probability to assign to that specific interval. The 95% refers to the method: if you repeated the sampling and built an interval many times, about 95% of those intervals would contain the true value. The confidence is in the long-run reliability of the procedure, not the single result.

Use the pattern estimate ± (critical value × standard error). For a mean, the estimate is the sample mean and the standard error is the standard deviation divided by the square root of the sample size; multiply by z* (known σ) or t* (unknown σ) for your confidence level, then add and subtract from the mean. For a proportion, the estimate is x/n and the standard error is the square root of p̂(1−p̂)/n. This calculator applies the correct formula automatically.

Because a higher confidence level requires a larger critical value, which enlarges the margin of error. The z critical value rises from 1.96 at 95% to 2.576 at 99% — about 31% larger — so the interval widens by the same proportion on the same data. It’s a trade-off: greater certainty that the interval captures the true value comes at the cost of precision. To regain precision at higher confidence, you need a larger sample.

Use a z-interval when the population standard deviation is known or your sample is large. Use a t-interval when the population standard deviation is unknown and you estimate it from the sample standard deviation, which is the usual situation, especially for smaller samples. The t-distribution has heavier tails that produce a slightly wider, more honest interval. As sample size grows, the t- and z-intervals become nearly identical.

The margin of error is the “plus or minus” part of a confidence interval — half its total width. It equals the critical value times the standard error. When a poll reports “40% support, margin of error ±3%,” the confidence interval is 37% to 43%. A larger sample shrinks the margin of error, while a higher confidence level enlarges it. To halve the margin of error you must quadruple the sample size, since it’s proportional to one over the square root of n.

Methodology & formulas used

This calculator uses standard interval-estimation formulas, reviewed July 2026. All computation runs locally in your browser; your data is never uploaded.

  • Mean, σ known (z-interval): x̄ ± z* · (σ/√n).
  • Mean, σ unknown (t-interval): x̄ ± t* · (s/√n), with df = n − 1.
  • Proportion (Wald): p̂ ± z* · √(p̂(1−p̂)/n), where p̂ = x/n.
  • Raw data: the sample mean and sample standard deviation are computed from your numbers, then a t-interval is built.
  • z critical values come from the standard normal distribution; t critical values are computed by inverting the Student-t CDF (via the regularized incomplete beta function) for the exact degrees of freedom.
  • Margin of error = critical value × standard error; the interval is estimate ± margin of error.

Interval validity assumes the usual conditions: roughly normal data or a large enough sample for the mean, and the success–failure condition (n·p̂ ≥ 10 and n·(1−p̂) ≥ 10) for the proportion. Results are rounded for display but computed at full precision.

References

  1. NIST/SEMATECH e-Handbook of Statistical Methods. Confidence Limits for the Mean. itl.nist.gov
  2. NIST/SEMATECH e-Handbook. Critical Values of the Student’s t Distribution. itl.nist.gov
  3. Wikipedia. Confidence interval — definitions, formulas, and interpretation. en.wikipedia.org