Confidence interval calculator

Build a confidence interval for a mean or a proportion, from summary statistics or your raw data, at any confidence level.

Interval for
Data
45.87 – 54.13
Estimate
50
t* (df = 24)
2.064
Standard error
2
Half-width
4.128

M = 50, 95% CI [45.87, 54.13]

What “95% confident” really means

Draw 40 samples of 15 from a population whose true mean is 100 (the vertical line). Each bar is one sample's 95% interval. Most catch the true mean; a few miss, shown in coral. The confidence level describes how often the method works, not any single interval.

Formulas used

Mean: x̄ ± tα/2, n−1 · s/√n. Proportion (Wilson): (p̂ + z²/2n ± z√(p̂(1−p̂)/n + z²/4n²)) / (1 + z²/n). The Wilson interval stays inside 0–100% and keeps close to its nominal coverage even for small n.

Confidence levels and critical values

Confidence levelz*t* (df = 10)t* (df = 30)
90%1.6451.8121.697
95%1.962.2282.042
99%2.5763.1692.75

A higher confidence level gives a wider interval: you buy certainty with precision. To narrow the interval without lowering confidence, increase the sample size (see the sample size calculator).

Frequently asked questions

How do I calculate a confidence interval for a mean?

x̄ ± t* × s/√n, where t* is the critical value from the t distribution with n − 1 degrees of freedom. For n = 25, x̄ = 50, s = 10 at 95%: t* = 2.064, so 50 ± 4.13, or 45.87 to 54.13.

What does a 95% confidence level mean?

If you repeated the study many times and built an interval each time, about 95% of those intervals would contain the true value. It does not mean there is a 95% probability that this particular interval contains it.

Why use the Wilson interval for proportions?

The simple Wald interval (p ± z√(p(1−p)/n)) performs badly with small samples or proportions near 0 or 1, sometimes extending below 0%. Brown, Cai and DasGupta (2001) recommend the Wilson score interval instead.

When is z used instead of t?

Only when the population standard deviation is genuinely known, which is rare in research. With a sample SD, use t; for large n the two converge.