Confidence Interval Calculator

This confidence interval calculator works for a mean or a proportion. With a sample mean of 50, a standard deviation of 10 and n = 30, the 95% confidence interval runs from 46.27 to 53.73.

Example: What do you want to estimate: Mean · Sample mean 50 · Standard deviation 10 · Sample size n 30 · The standard deviation is: estimated from the sample (t distribution) · Confidence level: 95 % → Confidence interval: 95% confidence interval for the mean: 46.266 to 53.734. Source: NIST/SEMATECH e-Handbook of Statistical Methods – 1.3.5.2 Confidence Limits for the Mean. Updated: .

The sample standard deviation (computed with n − 1), not the standard error.
Almost always the standard deviation is estimated, so use t. Use z only if it is known in advance.
A higher level gives a wider interval. 95% is the usual choice.
My ToolboxYour inputs are saved in this browser only.

Result

Confidence interval
95% confidence interval for the mean: 46.266 to 53.734
More figures
  • Standard error of the mean: 1.8257
  • t value with 29 degrees of freedom: 2.0452
  • Margin of error (±): 3.7341
Calculation
50 ± 2.045 × 10 ÷ √30 = 50 ± 3.7341

How it is calculated

How to calculate a confidence interval

A confidence interval gives a range in which the true population value lies with the chosen level of confidence. For a mean it is mean ± critical value × s ÷ √n. With 30 values, a mean of 50 and s = 10, the standard error is 1.83, the t value (29 degrees of freedom, 95%) is 2.045, so the margin of error is 3.73.

t or z?

If you do not know the population standard deviation, you estimate it from the sample and use the t distribution. Its critical value is larger for small n, so the interval is wider. Only for large samples does t approach the z value of 1.96.

Proportions: Wilson instead of the rule of thumb

For a proportion, say 45 of 100 respondents, the calculator uses the Wilson score interval. It stays valid for few successes or proportions near 0 and 100%, and its coverage is better than the simple Wald interval.

What the level means

95% means: if you repeated the sampling many times, about 95% of the intervals calculated this way would contain the true value. It does not mean the true value lies in this particular interval with 95% probability. To halve the width you need four times as much data.

Limits

The interval reflects random error only, not bias from a poor sample or badly worded questions. It assumes independent observations.

Frequently asked questions

How do you calculate a confidence interval for a mean?

Take the mean plus and minus the t critical value times the standard error. The standard error is s divided by the square root of n.

What does a 95% confidence interval mean?

If the survey were repeated many times, about 95% of the intervals would contain the true value. It is not a statement about this one interval.

When should I use t and when z?

Use t when the standard deviation was estimated from the sample. z fits only when the population standard deviation is known.

How large must the sample be for a narrower interval?

The width shrinks with the square root of n. For an interval half as wide you need four times as many observations.

How do I get a confidence interval for a proportion?

Choose “Proportion”, enter the successes and the sample size. The calculator uses the Wilson formula and shows the Wald interval for comparison.

Sources and legal basis

As of: · Editorial policy

Related tools