Skip to content

Confidence interval calculator

Math & numbers

How precise is your sample's estimate?

The confidence interval for a mean or a proportion from a sample, with the margin of error and the method used.

Interval for

%

Method
The standard deviation is

95% confidence interval

46.27 – 53.73

For the mean: 50.00 ± 3.73, from a sample of 30.

More about the interval

Margin of error
± 3.73
Standard error
1.83
Critical value t (29 degrees of freedom)
2.0452

Sponsored Links

The confidence interval for a mean or a proportion from a sample, with the margin of error and the method used.

How to use

  1. Choose whether you estimate a mean (an average) or a proportion (a share of yes answers).
  2. Enter the sample's mean and standard deviation, or how many successes it had, with the sample size and the confidence level.
  3. Read the interval as the answer; open Method to switch between t and z, or Wilson and Wald.

Sponsored Links

How it works

A sample gives an estimate, and a confidence interval says how far off that estimate could plausibly be. A 95 % interval comes from a method that catches the true value in 95 % of samples; it does not mean the true value is in this particular range with 95 % probability, but it is a good guide to the precision.

For a mean the interval is x̄ ± t × s ÷ √n, where x̄ is the sample mean, s the standard deviation, n the sample size and t the critical value of Student's t distribution with n − 1 degrees of freedom (use z when the population's σ is known). For a mean of 50 with s = 10 from 30 people, t = 2.045 and the 95 % interval is 50 ± 3.73, so 46.27 to 53.73. For a proportion the Wilson score interval is the default because it stays sensible with small samples and shares near 0 % or 100 %; the plain Wald interval p̂ ± z × √(p̂(1 − p̂) ÷ n) is offered for comparison. Sources: the NIST/SEMATECH e-Handbook and Newcombe (1998).

The interval covers only random sampling error. It cannot correct a biased sample, and the t interval assumes the data are roughly normal or the sample is large.

Worked example

What is a 95% interval for mean 100, known population standard deviation 15 and sample size 100?

  1. Standard error: 15 ÷ √100 = 1.5.
  2. Using the z method, the margin is 2.94.

The interval is 100 ± 2.94: from 97.06 to 102.94.

Frequently asked questions

What does a 95 % confidence interval mean?

If you repeated the survey or experiment many times, about 95 % of the intervals calculated this way would contain the true value.

When should I use t instead of z?

Use t when the standard deviation was measured from the same sample, which is almost always. Use z only when the population's standard deviation is known beforehand.

Why is the proportion interval not centred on my sample share?

The Wilson interval is pulled slightly towards 50 %, which makes it more accurate for small samples and for shares near 0 % or 100 %.

How do I make the interval narrower?

Collect a larger sample: the width shrinks with the square root of the sample size, so four times as many observations halve it. A lower confidence level also narrows it.

Does the interval contain 95% of individual observations?

No. A confidence interval for a mean estimates the population mean. It is not a range for individual observations or a prediction interval.

Sponsored Links

Sponsored Links