Confidence Interval Calculator

A confidence interval gives a range that is likely to contain the true value, based on a sample. Use it for an average (mean) or a share (proportion).

For a
Results update as you type.

95% confidence interval

50.253181 to 54.346819

52.3 ± 2.04682

Margin of error
2.0468193
Standard error (s ÷ √n)
1.0119289
Critical t (df = 39)
2.02269

About this calculator

For a mean the calculator uses the t distribution when the standard deviation comes from the sample, which is the usual case.

How to use it

  1. Choose mean or proportion.
  2. Enter the sample results and confidence level.
  3. Read the interval and margin of error.

The formula

Mean: x̄ ± t × s ÷ √n; proportion: p̂ ± z × √(p̂(1 − p̂) ÷ n)
x̄
sample mean
s
standard deviation
n
sample size
t, z
critical value for the confidence level

Worked example

Mean 52.3, s 6.4, n 40 at 95%

  1. SE = 6.4 ÷ √40 = 1.012; t with 39 df = 2.023.
  2. Interval: 52.3 ± 2.047, or 50.25 to 54.35.

What the result means

95% confidence means that the method captures the true value in 95% of samples, not that there is a 95% chance this particular interval is right.

Assumptions

  • A random sample; roughly normal data or a sample of 30 or more for a mean.

Limitations

  • The Wald interval for proportions is poor for small samples; the Wilson interval is shown alongside.

Frequently asked questions

Should I use t or z?

Use t when the standard deviation is estimated from the sample. Use z only if the population standard deviation is genuinely known.

Why is the interval wider at 99%?

More confidence needs a wider net.

How do I make the interval narrower?

Increase the sample size: quadrupling n halves the width.

Last reviewed on 6 October 2026. Found a mistake? Tell us.