Skip to calculator
Libre CalculatorThe universe in numbers

Confidence interval calculator

Find the margin of error and the interval around a sample mean when σ is known.

Answer

95.1 to 104.9

100 ± 4.9

Steps

E = 1.96 × 15 ÷ √36 = 4.9; 100 − 4.9 = 95.1 and 100 + 4.9 = 104.9

The interval reaches one margin of error either side of the sample mean
A number line with the sample mean 100 in the middle and a shaded interval from 95.1 to 104.9, which is 4.9 on each side.

Watch the explainer

212 seconds · 8 chapters · captions included

0:00 / 3:32How many jars for half the wobble?

Explanation

What this interval shows

A confidence interval for a mean is the sample mean plus or minus a margin of error. The margin is a critical value times the standard error σ/√n, so it shrinks as the sample grows and widens when you ask for more confidence.

How to use it

Enter the sample mean, the population standard deviation (σ, known in advance), the sample size and the critical value for the confidence level you want. Common two-sided values are 1.645 for 90%, 1.96 for 95% and 2.576 for 99%.

E = z* × σ / √n; interval x̄ − E to x̄ + E

Variables
Emargin of error
x̄sample mean
σpopulation standard deviation
nsample size
zcritical value

A 2-standard-error interval

Sample mean100
Population standard deviation10
Sample size25
Critical value2
Result4

E = 2 × 10 ÷ √25 = 4; 100 − 4 = 96 and 100 + 4 = 104

A small sample of 9

Sample mean20
Population standard deviation6
Sample size9
Critical value2
Result4

E = 2 × 6 ÷ √9 = 4; 20 − 4 = 16 and 20 + 4 = 24

A 1-standard-error margin

Sample mean0
Population standard deviation2
Sample size4
Critical value1
Result1

E = 1 × 2 ÷ √4 = 1; 0 − 1 = -1 and 0 + 1 = 1

Diagram of this result

The diagram shows the sample mean on a number line with the interval shaded from the lower bound to the upper bound, one margin of error on each side.

The sample mean, the margin of error and both bounds are stated in text and come from the same calculation.

Common mistakes

Do not enter a sample standard deviation and treat the result as a t interval. A 95% level describes how often the method captures the true mean over repeated samples; it is not the probability that this particular interval contains it. Independent sampling matters.

Limits and assumptions

Assumes a known population σ, independent observations and a sample mean that is normally distributed or close to it for a large sample. Sample size 1 to 1,000,000; σ and the critical value above zero. It does not look up t critical values or check sampling assumptions. Inputs keep up to 30 significant digits and the calculation uses 50; only the displayed answer is rounded.

Sources

NIST Engineering Statistics Handbook, confidence limits for the mean: https://www.itl.nist.gov/div898/handbook/eda/section3/eda352.htm

Why is 1.96 used for 95%?

In a standard normal distribution, 95% of the area lies within 1.96 standard deviations of the centre (more precisely 1.959964). Using that multiplier on the standard error gives a two-sided 95% interval.