Calculators
Home › Calculators › Confidence Interval Calculator

Confidence Interval Calculator

A range for the true mean, with its working shown.

Calculate a confidence interval for a mean

t-based, because σ is estimated from your sample, as it almost always is.

Quick answer: CI = x̄ ± t* × (s ÷ √n). For the bakery example the 95% interval is 40.53 to 48.47, built with t* = 2.365 on 7 df, not 1.96.

What a confidence interval for a mean says

A confidence interval turns one sample into a range of plausible values for the population mean. The recipe: sample mean, plus or minus a margin built from a critical value and the standard error. Because the population SD is almost never known, the t distribution supplies the critical value, with the degrees of freedom your sample size sets.

Confidence interval for a meanx̄ ± t* × (s ÷ √n)
Worked example

Eight days of bakery sales (42, 38, 45, 51, 44, 39, 47, 50): mean 44.5, s = 4.7509, standard error 1.6797. At 95%, t* on 7 df is 2.3646, the margin is 3.972, and the interval is 40.53 to 48.47 cakes a day. The shop's true average daily demand plausibly sits in that range, and planning stock for 40 a day would very likely fall short.

What "95% confident" really means

It describes the method, not this one interval. If the same sampling and interval-building were repeated forever, 95% of the intervals produced would contain the true mean. Your single interval either contains it or not. The 95% is the long-run reliability of the recipe you used. That careful wording matters, because the sloppy version ("there is a 95% chance the mean is in here") treats a fixed unknown as if it were random.

Wider or narrower?

Watch out

Using z* = 1.96 instead of t* on a small sample. With n = 8 the correct fence is 2.365; the z shortcut makes the interval about 17% too narrow and quietly breaks the 95% promise.

Frequently asked questions

When do I use t* instead of z*?

Whenever σ is estimated from the sample, which is nearly always. z* is for a genuinely known population SD, or very large samples where the difference no longer matters.

Does a 95% interval that excludes my hypothesised mean mean the test rejects?

Yes. A two-tailed test at α = 0.05 and a 95% interval are the same calculation read two ways. If μ₀ lies outside the 95% interval, the test rejects at 0.05.

Why is my interval so wide?

Small n or a large s. The only honest fixes are more data or a less variable measurement. Choosing a lower confidence level narrows the interval only by weakening what it promises.