About the Confidence Interval calculator
A sample mean is an estimate. A confidence interval adds a range around it that reflects sampling uncertainty. This calculator builds that interval for a population mean from three summary numbers: the sample mean, the standard deviation and the sample size.
Choose a confidence level from 80% to 99.9% and pick a t critical value (the usual choice when the population standard deviation is unknown) or a z value (when it is known). You get the interval, the margin of error, the standard error, the critical value and, for t, the degrees of freedom.
How to use it
- Enter your Sample mean (x̄).
- Enter the Standard deviation: your sample's s for a t interval, or the known population σ for a z interval.
- Enter the Sample size (n), at least 2.
- Pick a Confidence level, such as 95%.
- Under Use, choose t (σ unknown) or z (σ known), then read the interval and margin of error.
The formula
CI = x̄ ± critical value × SE, where SE = s ÷ √n
- x̄ is the sample mean, s the standard deviation and n the sample size.
- SE is the standard error of the mean.
- For t, the critical value t* comes from the t distribution with n − 1 degrees of freedom.
- For z, z* comes from the standard normal: 1.645 for 90%, 1.960 for 95%, 2.576 for 99%.
- Margin of error = critical value × SE: half the width of the interval.
Worked example
A sample of 36 parts has a mean length of 50 mm and a standard deviation of 8 mm. The standard error is 8 ÷ √36 = 1.333.
For a 95% t interval with 35 degrees of freedom, t* ≈ 2.030. The margin of error is 2.030 × 1.333 ≈ 2.707, so the interval runs from about 47.29 to 52.71 mm.
If 8 mm were the known population standard deviation, the z interval would use 1.960 instead, giving 47.39 to 52.61 mm. The t interval is a little wider because it accounts for the extra uncertainty of estimating σ from the sample. As n grows, t* approaches z* and the two intervals converge.
What a 95% confidence interval really means
The confidence level describes the method, not one particular interval. If you repeated the study many times and built an interval each time, about 95% of those intervals would contain the true population mean. Any single interval either contains it or does not; we just don't know which.
So it is not quite right to say there is a 95% probability that the true mean lies in this specific interval. It is also wrong to say 95% of individual values fall inside it. The interval is about the mean, and it is usually much narrower than the spread of the data.
The method assumes a random sample and a population that is roughly normal, or a sample large enough for the central limit theorem to apply. Strong skew with a small n can make the interval unreliable. To narrow an interval, increase the sample size: halving the margin of error takes about four times as many observations. The sample size calculator helps plan that for proportions.
Frequently asked questions
Should I use t or z?
Use t when you estimate the standard deviation from your sample, which is almost always the case. Use z only when the population standard deviation is genuinely known in advance.
Why is a 99% interval wider than a 95% interval?
To be confident of capturing the true mean more often, the method must cast a wider net. Higher confidence means a larger critical value and a bigger margin of error.
What are degrees of freedom here?
For a one-sample t interval they equal n − 1. Fewer degrees of freedom give a heavier-tailed t distribution and a larger critical value.
Does the interval tell me where individual values fall?
No. It estimates the population mean. To describe where individual values lie, look at the standard deviation or a prediction interval instead.
Can I use this for a proportion?
This calculator is built for means. A proportion uses a different standard error, √[p(1 − p) ÷ n], so it isn't a direct fit.
Last updated October 24, 2026. Results are estimates for education and planning — see our disclaimer.