Confidence Interval Calculator

Enter the sample mean, standard deviation and size, choose a confidence level, and see the range the true mean is likely to lie in. A second option handles a proportion such as a survey result.

What are you estimating?

Worked examples

A mean

Mean 50, SD 10, n = 25, 95%

45.87 to 54.13

Critical t is 2.0639 with 24 degrees of freedom.

A proportion

40 out of 100, 95%

30.9% to 49.8% (Wilson)

The simple interval is 30.4% to 49.6%.

About Confidence Interval Calculator

A confidence interval gives a range of values that is likely to contain the true figure you are trying to estimate. A 95% interval means that if you repeated the sampling many times and built an interval each time, about 95% of those intervals would contain the true value. For a mean, it is the sample mean plus and minus a margin of error, which is a critical value times the standard error, the standard deviation divided by the square root of the sample size.

For a mean found from a sample, the right critical value comes from the t distribution, which allows for the extra uncertainty in a small sample and approaches the normal value as the sample grows. For a proportion, such as 40 people out of 100, the page gives the Wilson interval, which stays sensible for small samples and for percentages near 0 or 100, and also shows the simpler normal approximation. A mean of 50, a standard deviation of 10 and a sample of 25 gives a 95% interval of 45.87 to 54.13.

How to use Confidence Interval Calculator

  1. Choose whether you are estimating a mean or a proportion.
  2. Enter the sample mean, standard deviation and size, or the number of successes and sample size.
  3. Choose the confidence level, for example 95%.
  4. Read the interval, the margin of error and the working.

Common uses

  • Reporting survey results with a margin of error
  • Stating the precision of a measured average
  • Statistics coursework and dissertations
  • Comparing a sample result with a target

Frequently asked questions

What does a 95% confidence interval mean?

If you took many samples and built an interval from each in the same way, about 95% of the intervals would contain the true value. It is a statement about the method rather than about one interval.

When should I use t instead of z?

Use t when the standard deviation comes from your sample, which is the usual case. Use z only if the standard deviation of the whole population is known.

How do I get a narrower interval?

Take a larger sample or accept a lower confidence level. Halving the width needs about four times the sample size.

What is the Wilson interval?

It is a method for a proportion that works better than the simple formula for small samples and for results near 0% or 100%.

What is the margin of error?

It is half the width of the interval: how far either side of the estimate the true value could plausibly lie.