Statistics

Confidence Interval Calculator

Settings
Reset
Share
Save
Embed
Report a bug

Share calculator

Add our free calculator to your website

Please enter a valid URL. Only HTTPS URLs are supported.


Use as default values for the embed calculator what is currently in input fields of the calculator on the page.


Input border focus color, switchbox checked color, select item hover color etc.


Please agree to the Terms of Use.

Preview

Save calculator

Calculator Settings

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Share calculator

What is a confidence interval?

A confidence interval is a range of plausible values for an unknown population parameter — here, the population mean. Instead of reporting a single point estimate, it expresses the uncertainty around that estimate as a lower and an upper bound.

A 95% confidence interval, for example, means that if you repeated the same sampling procedure many times, about 95% of the intervals you build would contain the true mean. The width of the interval depends on how much your data varies, how many observations you have, and how confident you want to be.

This calculator uses the z (normal) approximation, which is appropriate when the population standard deviation is known or the sample is large enough for the Central Limit Theorem to apply.

How does the calculator work?

You provide four pieces of information:

  • Sample mean (x̄) — the average of your observations.
  • Standard deviation (σ) — the spread of the data; must be positive.
  • Sample size (n) — the number of observations; an integer of at least 1.
  • Confidence level — how sure you want to be: 90%, 95%, or 99%.

Each confidence level maps to a critical z-value:

Confidence levelz-value
90%1.645
95%1.960
99%2.576

The calculator returns the margin of error, the lower bound, and the upper bound.

Formulas

The standard error of the mean is:

SE=σnSE = \frac{\sigma}{\sqrt{n}}

The margin of error scales the standard error by the critical z-value:

E=zσnE = z \cdot \frac{\sigma}{\sqrt{n}}

The confidence interval for the mean is then:

xˉ±zσn\bar{x} \pm z \cdot \frac{\sigma}{\sqrt{n}}

Worked examples

Example 1: x̄ = 100, σ = 15, n = 36, 95%

The standard error is:

SE=1536=156=2.5SE = \frac{15}{\sqrt{36}} = \frac{15}{6} = 2.5

With z = 1.96 the margin of error is:

E=1.96×2.5=4.9E = 1.96 \times 2.5 = 4.9

So the 95% confidence interval is [95.1, 104.9].

Example 2: x̄ = 50, σ = 10, n = 25, 99%

The standard error is:

SE=1025=105=2SE = \frac{10}{\sqrt{25}} = \frac{10}{5} = 2

With z = 2.576 the margin of error is:

E=2.576×2=5.152E = 2.576 \times 2 = 5.152

So the 99% confidence interval is [44.848, 55.152].

Practical notes

  • A higher confidence level widens the interval: being more certain that you have captured the true mean requires a larger range.
  • A larger sample size narrows the interval, because the standard error shrinks with √n.
  • The z approximation assumes the sampling distribution of the mean is approximately normal. For small samples with an unknown standard deviation, a t-interval is usually more accurate.
  • The margin of error is symmetric, so the interval is always centered on the sample mean.

Report a bug

This field is required.