Tools logoTools/
Math & Science/Confidence Interval Calculator

Confidence Interval Calculator

Confidence interval and margin of error for a sample mean.

Runs locally·Free, no signup·Updated May 6, 2026
Loading tool…
How it works

A walkthrough, end to end.

  1. 1

    Enter sample mean (x̄), sample standard deviation (s), sample size (n), and confidence level.

  2. 2

    The calculator returns the CI lower/upper bounds and the margin of error.

  3. 3

    Uses z-distribution (normal approximation, valid for n ≥ 30 or known population SD).

Reference

CI for the mean

CI = x̄ ± z* × (s / √n). Where z* is the critical value for the confidence level (1.96 for 95%). Margin of error = z* × (s / √n).

Use cases

What you can do with this.

Survey results

Sample mean response 7.5 (1–10 scale), s = 1.8, n = 200, 95% CI: 7.5 ± 0.25 = [7.25, 7.75]. Tells you the precision of your survey estimate.

Quality control

Sample mean weight of 100 products = 12.05 g, s = 0.10, 99% CI: 12.05 ± 0.026 g. If spec requires within ±0.05, the production is safely on-spec.

Clinical trial measurements

Drug effect size with 95% CI excluding 0 → statistically significant. The CI's width tells you how precise the estimate is — narrow CI = strong evidence.

Choosing confidence level

Higher confidence = wider CI (more inclusive). 90% (z=1.645), 95% (z=1.960), 99% (z=2.576). Standard scientific reporting uses 95%; medical may use 99%.

Precision vs sample size

Margin of error scales as 1/√n. Doubling sample size reduces MOE by ~30%; quadrupling cuts it in half. Use to plan study size for desired precision.

When n is small

For n < 30 with unknown population SD, use t-distribution (slightly wider CI). The calculator's z-based result is conservative; t correction matters mostly for n < 15.

Two-tailed interpretation

95% CI means: in 95% of repeated samples, the true population mean falls within the computed CI. Common misinterpretation: 'P(true mean in CI) = 95%' — slightly wrong technically.

CI calculator 2026 — what's current

Foundation of statistical inference. Modern data science (Bayesian credible intervals) sometimes preferred; classical CI remains standard in medical, engineering, and survey research.

FAQ

Frequently asked.

  • If you repeated the same study 100 times, ~95 of the resulting CIs would contain the true population mean. NOT 'there's a 95% chance the true mean is in this CI' (that's Bayesian language).

  • Z when population SD is known OR sample size n ≥ 30. T when n < 30 and only sample SD is available. The calculator uses z; for small-sample t, use a dedicated tool.

  • MOE is the half-width of the CI. CI = mean ± MOE. They convey the same information; MOE is the more common phrasing in survey reports.

  • No. Calculations run entirely in your browser.