Confidence Interval Calculator

A confidence interval for a mean is x̄ ± c × (s ÷ √n). The only real decision is where the critical value c comes from: if the standard deviation was estimated from your own sample — which it nearly always was — c must come from Student’s t with n − 1 degrees of freedom, not from the normal curve. At n = 30 that widens the interval by about 4%; at n = 8 it widens it by 21%, which is why using z on a small sample quietly overstates how much you know.

  • Accurate
  • Real-time
  • Easy to use
  • 100% free

95% confidence interval

94.40 to 105.60

Upper bound

105.60

Details

Updates as you type
<-500-2500250500+

The average of the sample you actually measured.

0255075100+

The sample standard deviation s, or the known population σ — whichever the selector below says you have.

251.5101150.5200+

How many observations the mean was computed from. At least 2.

A higher level always widens the interval — there is no free precision.

Estimating the spread from the same small sample costs precision, and Student’s t is what pays for it. Choose known σ only when the spread comes from outside this sample.

Summary

Noticeably wider than z

Confidence interval

94.40 to 105.60

Where this result sits on the scale
1×1.3×
Lower bound
94.40
Upper bound
105.60
Margin of error (±)
5.60
Critical value t*(29 df)
2.0452
Standard error of the mean
2.7386
Interval width
11.20
Margin if z were used (too narrow)
5.37
How much wider t makes it
4.4%
  • The 95% confidence interval for the mean is 94.40 to 105.60 — that is 100.00 give or take 5.60. The critical value 2.0452 comes from Student's t with 29 degrees of freedom, because the standard deviation was estimated from the sample.
  • It does not mean there is a 95% probability that the true mean lies between 94.40 and 105.60. The true mean is a fixed number; it is either in this interval or it is not. What is 95% is the METHOD: if you repeated the whole exercise on fresh samples, about 95 intervals in every 100 built this way would contain it.
  • Because s is an estimate, t* = 2.0452 is used rather than z* = 1.9600, which makes the interval 4.4% wider. Reaching for z here is the usual mistake, and it is worst exactly where it matters most: at n = 8 the z interval is about 17% too narrow.
  • The formula assumes a random sample, and either a roughly normal population or a sample large enough for the central limit theorem to carry the mean. It is an interval for the MEAN, not a range that 95% of individual observations fall in — that range is far wider.
How this is calculated
Sample mean (x̄)
100.00
Sample standard deviation (s)
15.00
Sample size (n)
30
√n
5.4772
Standard error = s ÷ √n
2.7386

Confidence level
95%
α (the area left outside)
5%
Degrees of freedom (n − 1)
29
t* at 95%, 29 df
2.0452
Margin of error = critical × standard error
5.60
Lower = x̄ − margin
94.40
Upper = x̄ + margin
105.60
How the interval narrows with sample sizeLower boundUpper bound
031629312551627384960

Sample size

Compare scenarios

See how one change moves the result

  • CurrentYour inputs as they stand94.40 to 105.60Current
  • Sample mean (x̄)125119.40 to 130.60
  • Standard deviation18.7593.00 to 107.00
  • Sample size (n)3895.07 to 104.93

Frequently asked questions

Does a 95% confidence interval mean there is a 95% chance the true mean is inside it?

No, and this is the single most common misreading. The population mean is a fixed number, not a random one: it is either inside your interval or it is not, and no probability attaches to that once the interval is built. The 95% describes the procedure. If you drew fresh samples over and over and built an interval from each one the same way, about 95 in every 100 of those intervals would contain the true mean. You do not know whether the one in front of you is among them.

Should I use the t distribution or the z distribution?

Use t whenever the standard deviation came from the same sample as the mean, which is almost always. Substituting an estimated s for the unknown σ adds a second source of uncertainty, and Student’s t with n − 1 degrees of freedom is the distribution that accounts for it. Use z only when σ is genuinely known from outside the sample — set by the measuring instrument, established by a large body of prior work, or given by the problem. This calculator lets you pick, and always tells you which one it applied.

How much does it actually matter if I use z instead of t?

It depends entirely on the sample size, because t only approaches z as n grows. At n = 8 the 95% t critical value is 2.3646 against z’s 1.9600, so a z interval is about 17% too narrow — a materially overconfident claim. At n = 30 the gap is 4.4%, at n = 120 it is 1.0%, and past a few hundred observations it is invisible. The rule of thumb that "n above 30 means you can use z" is a convenience, not a theorem; t costs nothing to use and is correct at every n.

How are the critical values worked out?

The t critical value is a real inverse-t, not a lookup table or a polynomial fit. The two-sided tail P(|T| > t) equals the regularized incomplete beta function I_x(ν/2, 1/2) with x = ν/(ν + t²), which is evaluated by continued fraction to about 15 digits, and the quantile is recovered by bisecting it. The tests pin the results against published tables — t(0.975, 10) = 2.228, t(0.975, 30) = 2.042, t(0.975, 1) = 12.706. The z critical values invert the Abramowitz and Stegun 26.2.17 approximation to the normal CDF, the same one the z-score calculator uses, which is why the confidence levels stop at 99%: beyond that, the inversion error would start showing in the fourth decimal.

Why does a bigger sample give a narrower interval?

Two reasons, and only one of them is the famous one. The margin of error is c × s ÷ √n, so quadrupling the sample halves the margin — that is the 1 ÷ √n law, and it is why chasing a very tight interval gets expensive fast. The second reason is that the critical value itself shrinks: more data means more degrees of freedom, which pulls t in toward z. Both effects run the same way, which is what makes the curve on the chart steeper at the left than pure 1 ÷ √n alone would be.

Is this the range that 95% of individual values fall in?

No. A confidence interval is a statement about the mean, and it gets narrower as you collect more data. The range covering 95% of individual observations is a prediction interval, it is roughly x̄ ± 2s rather than x̄ ± 2s ÷ √n, and it does not shrink with sample size — more data pins down the average, it does not make the population less varied. With s = 15 and n = 30 the two differ by a factor of about five.

You might also like