DoesWhatAnswersSlangEmojisCalculatorsTriviaPlayBlog

Trivia Questions and Weird Facts

Statistics

Confidence Interval Calculator

A sample gives you one estimate; a confidence interval shows its sampling uncertainty. Calculate an interval for a mean using a sample or known population standard deviation, or use a Wilson interval for a success rate. The method is named beside the result.

Loading the calculator. It runs in your browser, so JavaScript needs to be on.

How to use the Confidence Interval Calculator

  1. Choose Mean, sample SD (t) when you estimated the standard deviation from your sample. Choose Mean, known population SD (z) only when the population standard deviation is known.
  2. Enter Sample mean, Standard deviation and Sample size for either mean mode.
  3. For a binary outcome, choose Proportion (Wilson), then enter Number of successes and Sample size.
  4. Select Confidence level and read the lower and upper limits. The rows show the margin or half-width and the information used to calculate it.

The formula

Mean interval: sample mean plus or minus critical value times SD / square root of n. The critical value is Student t with n - 1 degrees of freedom for a sample SD, or normal z for a known population SD. For a Wilson proportion interval, let p = successes/n and d = 1 + z squared/n. The center is (p + z squared/(2n))/d, and the half-width is z times square root of [p(1-p)/n + z squared/(4n squared)] / d.

Worked example

A sample mean of 100, known population SD of 15 and sample size of 100 give standard error 1.5. At 95% confidence, z is approximately 1.959964, producing 97.0601 to 102.9399. For 50 successes among 100 observations, the 95% Wilson interval is 40.3832% to 59.6168%.

When the t interval is the right choice

Population standard deviations are rarely known in ordinary surveys and experiments. If you calculated SD from the observed sample, use t. Its heavier tails reflect the extra uncertainty from estimating variability. With two observations, the 95% t critical value is about 12.706; with large samples it approaches 1.960. For small samples, strong skew or outliers can make the usual t assumptions poor.

What 95% confidence actually describes

The 95% describes the interval-making method over repeated random samples. Under its assumptions, about 95% of the intervals would contain the fixed population parameter. It does not mean 95% of individual observations lie inside your interval. An interval for a mean is much narrower than an interval intended to predict the next individual observation.

Why the proportion interval is not symmetric

The Wilson method keeps its bounds within 0% and 100% and shifts its midpoint toward 50%, especially with small samples or rates near the boundaries. Zero successes therefore does not imply an upper limit of zero. The t and z mean methods follow the standard confidence-limit framework. None of these intervals corrects biased sampling, dependence or survey weighting.

Confidence Interval Calculator questions

Should I use a t interval or a z interval?

Use t when the SD comes from your sample. Use z when the population SD is known independently.

Does a bigger sample make the interval narrower?

Yes, if confidence and variability stay fixed. Multiplying sample size by four roughly halves a mean interval's margin of error.

Can I calculate a confidence interval with one observation?

A sample-SD t interval needs at least two observations. The known-SD z and Wilson proportion calculations can run with one, although uncertainty will usually be substantial.

Related calculators