How to use this calculator
- Enter or choose sample mean (x̄).
- Enter or choose standard deviation.
- Enter or choose sample size (n).
- Enter or choose confidence level.
- Enter or choose method.
- The confidence interval updates as you type. Use Copy result or Share to keep it.
Method
CI = x̄ ± c × s ÷ √n, where c = t(1 − α/2, n − 1) or z(1 − α/2), and α = 1 − confidence
- x̄
- sample mean
- s
- standard deviation
- n
- sample size
- c
- two-sided critical value
Worked example
- Standard error = 10 ÷ √25 = 2.
- t* for 95% with 24 degrees of freedom = 2.0639.
- Margin = 2.0639 × 2 = 4.1278, so the interval is 50 ± 4.1278.
With a sample mean of 50, s = 10 and n = 25, the 95% confidence interval for the mean is 45.87 to 54.13.
What the result means
If you repeated the sampling many times, about 95% of intervals built this way would contain the true mean. A narrower interval needs a larger sample: halving the margin takes roughly four times as many observations.
Assumptions and limits
- Observations are independent and come from a random sample.
- The population is roughly normal, or the sample is large enough (about 30+) for the mean to be close to normal.
- This is for a single mean. Proportions, differences between groups and paired data need different formulas.
- Strong skew or outliers in small samples make the interval unreliable.
Questions
Should I use t or z?
Use t whenever the standard deviation is estimated from the sample, which is almost always. Use z only when σ is genuinely known in advance. For large n they give nearly the same answer.
Does a 95% interval mean a 95% chance the mean is inside?
Not strictly. The true mean is fixed; the 95% describes how often the method captures it over repeated samples.