Confidence Interval Calculator for a Mean

A confidence interval is the sample mean plus or minus a margin of error: x̄ ± critical value × σ / √n. For a mean of 100, a standard deviation of 15 and a sample of 36, the 95% confidence interval is 95.1001 to 104.8999, a margin of error of 4.8999. Enter your sample's mean, standard deviation and size, and pick the confidence level.

Type a number and the answer appears straight away.

Your answer

95% confidence interval95.1001 to 104.8999100 ± 4.8999

Margin of error
± 4.8999
Standard error (σ / √n)
2.5
Critical value (z)
1.95996
Lower bound
95.10009
Upper bound
104.89991
Interval width
9.79982

The interval assumes a random sample from a roughly normal population, or a sample large enough for the mean to be close to normal. It describes the uncertainty in the mean, not the spread of individual values.

The math behind it: Confidence Interval

Confidence interval = x̄ ± z × σ / √n (or x̄ ± t × s / √n with n − 1 degrees of freedom)

Start with the standard error, the standard deviation divided by the square root of the sample size. For 15 and 36 that is 15 / 6 = 2.5. Multiply by the critical value for your confidence level, 1.95996 for 95% on the normal distribution, to get the margin of error of 4.8999. Add it to and subtract it from the mean of 100 to get the interval, 95.1001 to 104.8999.

Higher confidence means a wider interval. With the same sample, 90% confidence uses a critical value of 1.64485 and gives 95.8879 to 104.1121, while 99% uses 2.57583 and gives 93.5604 to 106.4396. A bigger sample narrows it: 100 people instead of 36 shrinks the 95% margin of error to 2.9399, because the standard error falls with the square root of the sample size.

Use the normal (z) distribution when the population standard deviation is known or the sample is large. When you estimate the standard deviation from a small sample, Student's t distribution is more honest, because it widens the interval to allow for that extra uncertainty. For 10 values with a mean of 50 and a standard deviation of 10, the t critical value with 9 degrees of freedom is 2.26216 and the 95% interval is 42.8464 to 57.1536. As the sample grows, t and z become almost the same.

A 95% confidence interval means that if you took many samples and built an interval from each, about 95% of those intervals would contain the true mean. It does not mean 95% of individual values fall inside it. To find the mean and standard deviation from raw numbers, use the standard deviation calculator. The z-score calculator converts between z-scores and percentiles, and the mean, median and mode calculator summarizes any list.

Common questions

How do you calculate a 95% confidence interval?

Divide the standard deviation by the square root of the sample size, multiply by 1.95996 (often rounded to 1.96) and add and subtract the result from the mean. A mean of 100 with a standard deviation of 15 and 36 values gives 95.1001 to 104.8999.

What is the margin of error in a confidence interval?

It is the critical value times the standard error, the distance from the mean to either end of the interval. For a standard deviation of 15 and a sample of 36 at 95% confidence it is 4.8999.

What is the z-value for a 99% confidence interval?

2.57583. For 90% it is 1.64485 and for 95% it is 1.95996. Those are the points that leave half of the remaining probability in each tail of the normal curve.

When should I use t instead of z for a confidence interval?

Use t when the standard deviation comes from the sample itself and the sample is small, roughly under 30. With 10 values the 95% critical value is 2.26216 instead of 1.95996, giving a wider, safer interval.

Does a bigger sample make the confidence interval smaller?

Yes. The margin of error shrinks with the square root of the sample size. With a standard deviation of 15, going from 36 to 100 values cuts the 95% margin of error from 4.8999 to 2.9399.

You might also need

Checked and updated: