Account

What new tool do you want?

Math & Education

Confidence Interval Calculator

Calculate a confidence interval for a mean (from raw data or summary statistics) or for a proportion, at 90%, 95% or 99% confidence.

How to use

  1. 1Choose mean or proportion.
  2. 2Enter the data (or mean, SD and sample size), or successes and trials for a proportion.

How it's calculated

Mean: x̄ ± t* × s ÷ √n (t distribution with n − 1 df). Proportion: p̂ ± z* × √(p̂(1 − p̂) ÷ n) (Wald), plus the Wilson interval for small samples.

Frequently asked questions

What does a 95% confidence interval mean?

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

Why use t instead of z for means?

Because the population standard deviation is estimated from the sample. For large samples t and z are almost identical.

Why show the Wilson interval?

The simple (Wald) interval is inaccurate for small samples or proportions near 0% or 100%; Wilson performs much better.

Why a mean's interval uses t, not z

The formula x̄ ± t* × s/√n uses the t distribution instead of the normal distribution because the sample standard deviation (s) is itself an estimate, not the true population value — using z instead would understate the uncertainty, especially with smaller samples. The default example (mean 50, SD 10, n = 36) gives a critical t* of about 2.03 at 95% confidence — noticeably above the z equivalent of 1.96, though the gap shrinks as the sample grows and t converges toward z.

Two formulas for a proportion, because the simple one breaks down

The plain (Wald) interval — p̂ ± z√(p̂(1−p̂)/n) — is easy to compute but gets unreliable when the sample is small or the proportion sits near 0% or 100%, sometimes producing an interval that extends below 0% or above 100%. For 120 successes in 400 trials (p̂ = 30%) at 95% confidence, the Wald interval comes out to 25.51%–34.49%, while the Wilson interval — which shifts its center slightly above p̂ and adjusts the width — gives 25.72%–34.66%. The two are close here because 400 is a reasonably large sample; with a smaller n or a p̂ near the edges, the gap between them grows much larger.

What actually shrinks the margin of error

Margin of error scales with 1/√n, so quadrupling your sample size only halves the margin — a common surprise for anyone expecting proportional gains. Confidence level matters too: moving from 90% to 99% confidence widens the interval because you're demanding more certainty that the true value is captured, at the cost of a less precise-looking range.

Typing raw data ignores the mean, spread, and sample size

On the mean interval, the summary boxes start filled, and they are what get used while the data box is empty. The moment I paste at least two numbers into that box, the mean, the spread, and the count are taken from the paste and the summary boxes are ignored, even if I leave 50, 10, and 36 sitting there. Fewer than two pasted numbers is rejected. A sample size under 2, or a negative spread, is rejected when I am using the summary instead. Proportion mode does not look at the data box at all. It needs the successes to fall between zero and the number of trials, inclusive, and it shows both the simple interval and the Wilson interval for the same count.

Related tools

More: Math & Education