Confidence Interval Calculator

Build a confidence interval for a population mean or proportion from summary statistics or raw data, with the critical value, margin of error and every step.

Interval for
The sample SD s, or the population σ if it is known.
Sample mean (x̄)
72.5
Margin of error
±2.622487
Critical value (t*)
2.0227df = 39
Standard error
1.296534
Interval width
5.244974
95% confidence interval for μ69.8775 to 75.122572.5 ± 2.6225
  • Uses Student’s t because σ is estimated by the sample SD.

Show the work

  1. Standard error: SE = s ÷ √n = 8.2 ÷ √40 = 1.296534
  2. Critical value: t* = t0.025, 39 = 2.0227 (df = n − 1 = 39)
  3. Margin of error: E = t* × SE = 2.0227 × 1.296534 = 2.622487
  4. Interval: x̄ ± E = 72.5 ± 2.622487 → 69.877513 to 75.122487
68707274767869.877575.1225
The same estimate at other confidence levels
ConfidenceCritical valueMargin of errorLowerUpper
80%1.3036±1.69021270.80978874.190212
90%1.6849±2.18449870.31550274.684498
95%2.0227±2.62248769.87751375.122487
98%2.4258±3.14518569.35481575.645185
99%2.7079±3.51090168.98909976.010901
99.9%3.5581±4.61322367.88677777.113223

A single sample mean or percentage is only a best guess. A confidence interval adds the honest part: a range of plausible values for the population, sized by how much the estimate would bounce around from sample to sample. Enter summary statistics, paste raw data or give a count of successes, choose a confidence level, and the calculator returns the interval, the margin of error and the reasoning behind each number.

How to use the confidence interval calculator

  1. Choose what you are estimating: a mean from summary statistics, a mean from raw data, or a proportion.
  2. For a mean, enter the sample mean, the standard deviation and the sample size, or paste the data. Tick the σ box only if the population standard deviation is truly known.
  3. For a proportion, enter the number of successes and the sample size, then pick the interval method.
  4. Set the confidence level. 95% is the usual default; 90% and 99% are also common.
  5. Read the interval on the tape, the picture of the interval on a number line, and the table that repeats the estimate at six other confidence levels.

Confidence interval formulas

For a mean with an estimated standard deviation, the interval uses Student’s t with n − 1 degrees of freedom:

x̄ ± t* × s ÷ √n

When σ is known, replace t* with the normal critical value z* and s with σ. For a proportion, the familiar Wald interval is

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

The Wilson score interval shifts the center toward one half and adjusts the width:

[p̂ + z²/2n ± z√(p̂(1 − p̂)/n + z²/4n²)] ÷ (1 + z²/n)

The Clopper–Pearson bounds are quantiles of beta distributions, chosen so that each tail of the binomial distribution holds exactly α/2.

Worked example

A sample of 40 delivery times has a mean of 72.5 minutes and a standard deviation of 8.2 minutes. Find a 95% confidence interval for the mean delivery time.

  1. Standard error: 8.2 ÷ √40 = 1.296534.
  2. Critical value: with 39 degrees of freedom, t* = 2.0227 (slightly larger than the normal value 1.96, to allow for estimating σ).
  3. Margin of error: 2.0227 × 1.296534 = 2.6225 minutes.
  4. Interval: 72.5 ± 2.6225, or 69.88 to 75.12 minutes.

For a proportion, suppose 312 of 520 surveyed customers say they would buy again. The sample proportion is 0.60. The Wilson 95% interval runs from 55.73% to 64.12%, while the Wald formula gives 55.79% to 64.21%. With hundreds of responses on each side the two methods nearly agree; they drift apart when the counts are small.

Reading and reporting the interval

What the width tells you

The width is driven by three things: variability in the data, the sample size and the confidence level. Doubling precision (halving the width) takes four times as many observations, because the standard error shrinks with the square root of n. If the interval is too wide to be useful, the sample size calculator shows how many observations you would need.

Common mistakes

  • Saying “there is a 95% chance μ is in this interval.” The population mean is fixed; the randomness is in the sampling. Say instead that you are 95% confident, meaning the method captures μ 95% of the time.
  • Using the t interval on badly skewed small samples. With fewer than about 30 observations, the t method assumes the population is roughly normal. Look at the data first, for example with the descriptive statistics calculator.
  • Ignoring how the sample was drawn. No formula fixes a biased sample. The interval only accounts for random sampling error.

Connection to hypothesis tests

A two-sided test at level α rejects a hypothesized value exactly when that value falls outside the matching (1 − α) confidence interval. Because 70 minutes lies inside the 95% interval above, a two-sided t-test of μ = 70 at α = 0.05 will not reject it. The interval gives you more than the test does: it tells you which values are plausible, not just whether one value was ruled out.

Intervals assume a random sample of independent observations. For a margin of error on its own, see the margin of error calculator.

Frequently asked questions

What does a 95% confidence interval actually mean?

It describes the method, not one particular interval. If you repeated the sampling many times and built an interval each time, about 95% of those intervals would contain the true population value. Any single interval either contains it or does not; the 95% is the long-run success rate of the procedure.

When should I use t instead of z for a mean?

Use t whenever the standard deviation comes from the sample itself, which is almost always the case in practice. Use z only when the population standard deviation is genuinely known, for example from a long-running, stable process. For large samples the two give nearly the same answer.

Which proportion method should I pick?

Wilson is the best general choice: it stays inside 0 to 1 and keeps close to the stated coverage even for small samples or proportions near 0% or 100%. The Wald formula is what most textbooks teach and is fine when there are at least 10 successes and 10 failures. Clopper–Pearson is exact but conservative, so its intervals are a little wider.

Why does a higher confidence level give a wider interval?

To be right more often, the interval has to cast a wider net. Moving from 95% to 99% raises the critical value from about 1.96 to 2.576 for z, so the margin of error grows by roughly a third. The only way to get a narrower interval at the same confidence is a larger sample.

Can I use this for a difference between two groups?

Not directly. A difference in means needs the combined standard error of both samples. The t-test calculator reports a confidence interval for the difference alongside the test, which is the easier route.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.