statistics calculators

Confidence Interval Calculator

Compute the lower and upper bounds of a confidence interval for a population mean using a sample mean, the standard error of that mean, and a critical z-value (1.645 / 1.96 / 2.576 for 90% / 95% / 99% confidence). This is the standard way to report uncertainty around survey results, lab measurements, or any sample-based estimate.

About this calculator

A confidence interval (CI) gives a plausible range for an unknown population mean, derived from sample data. The construction is: CI = x̄ ± (z · SE), where x̄ is the sample mean, SE is the standard error of the mean (SE = s / √n for a single sample), and z is the critical value from the standard normal distribution at your chosen confidence level. Common z-values: 1.645 (90% CI), 1.960 (95% CI), 2.576 (99% CI). The lower bound is x̄ − z·SE and the upper bound is x̄ + z·SE. The interval's correct interpretation is procedural: if you repeated the sampling and interval-construction process many times, the stated percentage of resulting intervals would contain the true population mean. It does not mean there is a 95% probability that the true mean lies in any one specific interval (that is a Bayesian credible interval, computed differently). Width is driven by SE and z: smaller samples or larger σ produce a wider interval, and higher confidence demands a wider interval (the trade-off between precision and confidence is fundamental). Edge cases: the z-based formula assumes the sample mean is approximately normally distributed, which holds either when the underlying data is normal or — by the Central Limit Theorem — when n is roughly ≥ 30. For small samples with unknown σ, use a t-distribution critical value instead (which depends on degrees of freedom). For proportions, binomial outcomes, or non-normal estimators, specialised CI formulas exist (Wilson, Clopper-Pearson, bootstrap). The interval also implicitly assumes the sample is a random, representative sample of the target population — bias in sampling cannot be cured by a confidence interval.

How to use

Example 1 — Survey of average test score. A random sample of 50 students has a mean score of 78 with standard error 3.2. For a 95% confidence interval, enter sample mean = 78, standard error = 3.2, z-value = 1.96. Lower bound = 78 − 1.96 × 3.2 = 78 − 6.272 = 71.73. Upper bound = 78 + 1.96 × 3.2 = 84.27. Interval: [71.73, 84.27]. ✓ You report: "We estimate the true mean test score is 78 (95% CI: 71.7–84.3)." Example 2 — Lab measurement at higher confidence. A chemist measures a sample's mean concentration as 25.5 mg/L with SE = 0.8. For a 99% CI (more conservative), enter sample mean = 25.5, standard error = 0.8, z-value = 2.576. Lower bound = 25.5 − 2.576 × 0.8 = 25.5 − 2.061 = 23.44. Upper bound = 25.5 + 2.061 = 27.56. Interval: [23.44, 27.56]. ✓ At 95% the same data would give 25.5 ± 1.568 = [23.93, 27.07] — narrower because a less stringent confidence level is being demanded.

Frequently asked questions

What does a 95% confidence interval actually mean?

The strictly correct interpretation is procedural: if you drew many independent random samples and computed a 95% CI from each, about 95% of those intervals would contain the true population parameter. It does not mean that for any one specific interval there is a 95% probability the parameter is inside — that is a Bayesian credible interval, computed differently. In practice, scientists and statisticians treat the CI as a range of plausible values for the parameter given the data and the model assumptions. The exact interpretation rarely matters operationally, but it matters in scientific writing: saying "there is a 95% chance the true mean is between 71.7 and 84.3" is technically wrong under classical (frequentist) statistics, even though it is the natural way most people read it.

When should I use a t-distribution critical value instead of z?

Use t-values when the population standard deviation σ is unknown and you are estimating it from the same sample (almost always, in practice), and especially when the sample size is small (n < 30). The t-distribution has heavier tails than the normal distribution, so it produces a wider, more honest CI that accounts for the additional uncertainty in estimating σ. The critical value depends on the degrees of freedom (df = n − 1): at df = 10 and 95% CI, t = 2.228 (vs. z = 1.96); at df = 30, t = 2.042; at df = 100, t = 1.984, converging to z as n grows. For n ≥ 30 the difference between t and z is small enough that z-based intervals are commonly used as an approximation, but for any rigorous work — especially with small samples or strict reporting — switch to t-values from a t-table or statistical software.

How does sample size affect the width of the confidence interval?

Width is driven by the standard error, which equals s / √n for a single sample mean. Because SE shrinks with the square root of n, you have to quadruple the sample size to halve the interval width — a hard constraint that explains why high-precision research is so expensive. Doubling sample size only narrows the CI by about 29%. This is why a poll of 400 people produces only a slightly tighter interval than a poll of 1,000, despite costing roughly half as much to run. When designing a study, work backwards from the precision you actually need (use a sample-size calculator) rather than picking a round number; very large samples are overkill for crude estimates and very small ones produce intervals so wide they cannot distinguish meaningful outcomes.

What are the most common mistakes people make with confidence intervals?

The first is interpreting "95% CI" as "95% probability the parameter is in this interval" — a tempting but technically incorrect frequentist statement (see above). The second is forgetting that the interval is only as good as the sampling: a biased sample produces a biased CI, no matter how tight. The third is confusing CI for the mean with prediction intervals for individual observations (the latter are much wider, because they include person-to-person variation). The fourth is using the z-based formula on small samples when you should be using t — the resulting interval is artificially narrow and over-states precision. Finally, people often present a CI without the assumptions behind it: random sampling, independence, approximate normality of the estimator (or large enough n for CLT). If any of those fail, the nominal coverage probability does not hold.

When should I not use this calculator?

Skip it when you do not yet have the standard error — compute SE first from your raw data (s / √n), or use a CI-for-mean calculator that takes raw inputs. Do not use it for confidence intervals on proportions or binomial outcomes; those require Wilson, Agresti-Coull, or Clopper-Pearson formulas, not a z·SE construction. It is the wrong tool for small samples where σ is unknown — switch to a t-based CI calculator with degrees-of-freedom adjustment. Do not use it for medians, percentiles, ratios, or other non-mean statistics; each has its own CI formula or requires bootstrapping. Finally, do not use a CI as a hypothesis-testing shortcut without thinking about effect size and power; a wide interval that includes the null value does not "prove" no effect, it just means the sample was too small to distinguish one.