Confidence Interval Calculator

A confidence interval expresses the uncertainty around an estimate from a sample. Calculate the interval for a mean or a proportion, see the margin of error, and find the sample size needed to reach a target precision.

How it works

Calculate a confidence interval for a population mean (t or z) or a proportion (Wald and Wilson), with the margin of error and the sample size needed for a target precision.

Mean (σ unknown): x̄ ± t(α/2, n−1) × s ÷ √n
Mean (σ known):   x̄ ± z(α/2) × σ ÷ √n
Proportion (Wald): p̂ ± z × √(p̂(1 − p̂) ÷ n)
Finite population correction = √((N − n) ÷ (N − 1))
Required n (mean) = (z·σ ÷ E)²;   (proportion) = z²·p(1 − p) ÷ E²

Common uses

  • Survey and patient-satisfaction results
  • Audit and quality-control sampling
  • Statistics coursework and research

Worked example

The calculator above opens with this example. Change any input to see the results update instantly, or select Reset to return to these figures.

EstimateMean, population SD unknown (t)
Sample mean52.4
Standard deviation8.6
Sample size (n)40
Confidence level95%
Example inputs
95.0% confidence interval49.65 to 55.15
Sample mean52.40
Margin of error2.75
Standard error1.3598
Critical value (t)2.0227
Results

If you repeated the sampling many times, about 95.0% of intervals built this way would contain the true value.

Interpreting the results

  • Use the t interval for means unless the population standard deviation is genuinely known.
  • For proportions near 0% or 100%, or small samples, rely on the Wilson interval shown in the notes.
  • Halving the margin of error requires roughly four times the sample size.

Frequently asked questions

What does a 95% confidence interval mean?

If the same sampling process were repeated many times, about 95% of the intervals built this way would contain the true population value. It does not mean there is a 95% probability that this particular interval contains it.

When should I use t instead of z?

Use the t distribution when the population standard deviation is unknown and estimated from the sample, which is almost always the case in practice. The z distribution applies when the population standard deviation is known.

How can I reduce the margin of error?

Increase the sample size or accept a lower confidence level. Because the margin of error falls with the square root of the sample size, halving it requires about four times as many observations.

Browse all 13 Statistics & Forecasting calculators