🎯

Confidence Interval Calculator

✓ Free & no signup 🔒 Runs 100% in your browser Updated 2026-11-25 Online Calculators

A single number — "the average customer spends 42 dollars" — hides something important: how sure are you? A confidence interval turns that point estimate into a range, like "42 plus or minus 3.1 dollars," and attaches a confidence level to it. That range is what you should quote in a report, a dashboard, or an A/B test summary, because it communicates both the estimate and the uncertainty behind it in one line.

This calculator builds a confidence interval for a population mean from four inputs: your sample mean, the sample standard deviation, the sample size, and a confidence level (90%, 95%, 98%, or 99%). It returns the margin of error and the full interval. Everything computes locally in your browser the moment you type — free, no signup, and nothing you enter leaves your device.

Below you will find the formula, the exact critical values used for each confidence level, worked examples with real numbers, and an honest discussion of when this z-based method is appropriate and when you should reach for the t-distribution instead.

What Is a Confidence Interval?

A confidence interval is a range built around a sample estimate that would capture the true population value in a stated percentage of repeated samples. If you drew 100 different random samples and built a 95% interval from each, roughly 95 of those intervals would contain the true population mean. It is a property of the method, not of any single interval — a common misreading is "there is a 95% probability the true mean is in this specific range," which is close in spirit but not technically what the math guarantees.

Three factors control the width of the interval:

  • Sample size. More data narrows the interval, but with diminishing returns — quadrupling n only halves the margin of error.
  • Standard deviation. Noisier data produces wider intervals. There is no computational trick around genuinely scattered data.
  • Confidence level. Wanting more certainty (99% instead of 90%) widens the interval. Confidence and precision trade off directly.

Example: a sample of 100 orders has a mean of 42.00 and a standard deviation of 15.80. The 95% margin of error is 1.96 × 15.80 / √100 = 1.96 × 1.58 = 3.10, so the interval is 38.90 to 45.10. You can say the true average order value is estimated at 42 dollars with a 95% interval spanning roughly 38.90 to 45.10.

How to Use This Calculator (Step by Step)

  1. Enter the sample mean — the average of your sample. If you only have raw values, compute their mean first (or paste them into a mean calculator) and enter the result.
  2. Enter the sample standard deviation. If your software reports the population-style standard deviation (dividing by n) rather than the sample version (dividing by n − 1), convert it: multiply by √(n / (n − 1)). For n = 25, that factor is about 1.0206.
  3. Enter the sample size n — the number of observations, not the population size.
  4. Choose the confidence level: 90%, 95%, 98%, or 99%. 95% is the standard default in most fields.
  5. Read the margin of error and the interval bounds. Quote the full range in your report, not just the mean.

Worked run-through: sample mean 68.4, standard deviation 9.2, n = 45, confidence 98%. The margin of error is 2.3263 × 9.2 / √45 = 2.3263 × 9.2 / 6.7082 = 3.19. The interval is 68.4 − 3.19 = 65.21 to 68.4 + 3.19 = 71.59.

The Formula and the Critical Values

The calculator uses the standard normal (z) method:

  • margin of error = z × s / √n
  • lower bound = sample mean − margin of error
  • upper bound = sample mean + margin of error

Each confidence level corresponds to a fixed z critical value — the point where the standard normal distribution leaves the right tail area equal to (1 − confidence) / 2:

Confidence levelz valueTail area per side
90%1.64495%
95%1.96002.5%
98%2.32631%
99%2.57580.5%

Seeing the multipliers side by side explains the trade-off. For a sample with s = 12 and n = 64, the standard error is 12 / 8 = 1.5, so the margins are: 1.6449 × 1.5 = 2.47 at 90%, 1.96 × 1.5 = 2.94 at 95%, 2.3263 × 1.5 = 3.49 at 98%, and 2.5758 × 1.5 = 3.86 at 99%. Moving from 90% to 99% confidence stretches the interval by over 50%.

The Honest Caveat: z vs. t

Strictly speaking, when the population standard deviation is unknown — which it almost always is in practice — the correct distribution is Student's t, not the normal. The t-distribution has heavier tails, so its critical values are larger than the z values above, especially for small samples. Using z with a small sample produces an interval that is too narrow, meaning it overstates your precision.

The practical guidance:

  • n ≥ 30: the z approximation is standard practice and the difference is small. At n = 30 the exact t critical value for 95% confidence is 2.045 versus the z value 1.960 — the interval computed here is roughly 4% narrower than the fully exact one.
  • n < 30: use the t-distribution. For n = 10 at 95% confidence the t critical value is 2.262 versus 1.960 — a 15% understatement of the margin of error, which is not negligible.
  • Very skewed data or heavy outliers: no formula fixes a non-representative sample. Check a histogram of your raw data before trusting any interval.

This tool uses the z values transparently because they are the standard textbook method and give correct, stable results for moderate and large samples. For small samples, treat the output as a slightly optimistic approximation or use a dedicated t-based tool.

Common Use Cases

  • A/B test analysis. Variant A converts at a sample mean order value of 55.20 with s = 21.00 from 400 sessions. The 95% margin of error is 1.96 × 21 / 20 = 2.06, giving 53.14 to 57.26. If variant B's interval sits entirely above this one, the difference is more than sampling noise.
  • Quality control. A factory samples 36 bolts with a mean diameter of 8.24 mm and s = 0.06 mm. The 99% margin is 2.5758 × 0.06 / 6 = 0.026 mm, so the process mean is estimated at 8.24 ± 0.026 mm.
  • Survey research. Respondents rate satisfaction 7.3 out of 10 with s = 1.9 from n = 250. The 95% interval is 7.3 ± 1.96 × 1.9 / 15.81 = 7.3 ± 0.24, or 7.06 to 7.54.
  • Business reporting. "Weekly revenue averages 18,400 with a 95% interval of 17,600 to 19,200" is a far more defensible sentence in a deck than a bare 18,400.
  • Classroom statistics. The calculator is a fast way to check hand-computed homework intervals — including spotting the classic error of dividing s by n instead of √n.

Tips and Best Practices

  • Quote the interval, not just the mean. Reporting "42 ± 3.1 (95%)" in one line is clearer and more honest than two separate sentences.
  • Match the confidence level to the cost of being wrong. Exploratory analysis often uses 90%; published research uses 95%; safety-critical decisions justify 99%. Do not reach for 99% just because it sounds impressive — you pay for it in width.
  • Check how n was counted. Dropping three outliers from a sample of 50 means n is 47, not 50, if the exclusions happen before the mean and s are computed.
  • Halving the margin of error costs 4× the data. If your interval is too wide, plan for a larger sample rather than hoping a different formula will fix it.
  • Use the sample standard deviation (n − 1 version). Mixing in the population version biases the interval slightly narrow; the conversion factor √(n/(n−1)) fixes a mismatched input.
  • Interpret ties to sampling, not the whole population. The interval quantifies random sampling error only; selection bias, measurement error, and non-response are separate problems no interval formula captures.

Confidence Interval vs. Margin of Error vs. Standard Error

These three terms get jumbled in reports, so here is the chain in one place. The standard error is s / √n — the typical distance between your sample mean and the true mean for samples of size n. The margin of error is the standard error multiplied by a critical value (z, or t for small samples), scaling that typical distance to your chosen confidence level. The confidence interval is the sample mean plus and minus the margin of error. With s = 20 and n = 100: standard error 2.0, 95% margin of error 3.92, interval 8.08 to 12.92 around a mean of 10.5. Keep the vocabulary straight and your methodology section will write itself.

Frequently Asked Questions

What is a 95% confidence interval in simple terms?
It is a range around your sample estimate that the method would capture the true population value about 95% of the time if you repeated the sampling many times. If a sample of 100 orders has a mean of 42 with a 95% interval of 38.9 to 45.1, you are saying the data supports an average order value anywhere in that range. The 95% describes the long-run reliability of the method, not the odds for one specific interval, though in everyday reporting the practical reading is 'we are fairly confident the true value is in here.'
How do you calculate a confidence interval step by step?
Compute the sample mean, then the sample standard deviation s. Divide s by the square root of n to get the standard error. Multiply by the z value for your confidence level: 1.6449 for 90%, 1.96 for 95%, 2.3263 for 98%, 2.5758 for 99%. That product is the margin of error. Subtract it from the mean for the lower bound and add it for the upper bound. Example: mean 50, s 8, n 64 gives standard error 1.0, 95% margin 1.96, interval 48.04 to 51.96.
What z value do I use for 90, 95, 98, and 99 percent confidence?
The standard normal critical values are 1.6449 at 90%, 1.9600 at 95%, 2.3263 at 98%, and 2.5758 at 99%. They come from where the standard normal distribution leaves (1 minus confidence) split evenly across the two tails. Larger confidence demands a larger multiplier, which widens the interval — going from 95% to 99% grows the margin of error by about 31% for the same data. This calculator applies the matching z value automatically when you pick a confidence level.
When should I use the t-distribution instead of the z-distribution?
Use the t-distribution whenever the population standard deviation is unknown and your sample is small, conventionally under 30. The t critical values are larger, producing a wider — and more honest — interval. At n = 10 with 95% confidence, t gives 2.262 versus the z value of 1.960, so a z-based interval understates the margin of error by about 15%. For n of 30 or more the gap shrinks to a few percent and the z approximation used by this calculator is standard practice.
How does sample size affect the confidence interval width?
Width scales with 1 divided by the square root of n, so growing the sample narrows the interval with diminishing returns. Quadrupling n from 25 to 100 halves the margin of error; going from 100 to 400 halves it again, but that requires 300 extra observations versus 75 for the first halving. Standard deviation matters too: noisier data widens the interval at any n. If your interval feels too wide, the honest fix is more data, not a different formula.
What does a very wide confidence interval tell me?
It means your sample contains little information about the population mean: either n is small, the data is highly scattered, or both. A mean of 52 with a 95% interval of 20 to 84 supports almost no practical decision. Check whether outliers are inflating the standard deviation, verify the sample size was entered correctly, and if the data is genuinely noisy, collect more observations. A wide interval is not an error — it is an accurate report of uncertainty, and pretending it is narrower would be the actual mistake.

Related Tools