When you measure a sample — the average test score of 100 students, the mean weight of 50 packages, the average monthly spend of 200 customers — that number is only an estimate of the true population average. A confidence interval turns that single estimate into a range: "We are 95% confident the true mean lies somewhere between 49.02 and 50.98." This confidence interval calculator computes that range for you in one step, using the standard normal (z) method when the population standard deviation is known.
Enter your sample mean, the standard deviation, the sample size, and pick a confidence level (90%, 95%, or 99%). The tool instantly returns the standard error, the critical z value, the margin of error, and the lower and upper bounds of the interval.
How to Use
- Enter the Sample Mean (x̄) — the average you computed from your sample. For example, if 100 people spent an average of $50 online, type 50.
- Enter the Population Std Dev (σ) — the known standard deviation of the population. If you only have the sample standard deviation, that is a reasonable substitute once n is at least 30.
- Enter the Sample Size (n) — the number of independent observations. Larger samples shrink the interval.
- Choose the Confidence Level — 90%, 95%, or 99%. The default 95% is the convention in most research and business reporting.
- Read the result card: it shows the standard error, the critical z value, the margin of error, and finally the lower and upper bounds that form your confidence interval.
Raising the confidence level widens the interval, and raising the sample size narrows it. Trade those two against each other until the range is precise enough for your decision.
The Confidence Interval Formula
For a population mean with a known standard deviation, the interval is built on the standard normal distribution:
CI = x̄ ± z · (σ / √n)
Where:
- x̄ is the sample mean.
- σ is the population standard deviation.
- n is the sample size.
- σ / √n is the standard error — how much x̄ typically varies from sample to sample.
- z is the critical value for your chosen confidence level: 1.645 for 90%, 1.960 for 95%, and 2.576 for 99%.
The term z · (σ / √n) is the margin of error. Subtract it from x̄ for the lower bound and add it for the upper bound.
Worked example: x̄ = 50, σ = 5, n = 100, 95% confidence. The standard error is 5 / √100 = 0.5. The margin of error is 1.960 × 0.5 = 0.98. So the 95% confidence interval is 49.02 to 50.98. If you repeated this survey many times, about 95% of the intervals you built would contain the true population mean.
How the Confidence Level Changes the Result
The same data at different confidence levels tells a clear story. Keep x̄ = 50, σ = 5, and n = 100:
- 90% confidence uses z = 1.645, giving a margin of error of 0.82 and an interval of roughly 49.18 to 50.82.
- 95% confidence uses z = 1.960, giving a margin of error of 0.98 and an interval of 49.02 to 50.98.
- 99% confidence uses z = 2.576, giving a margin of error of 1.29 and an interval of about 48.71 to 51.29.
Higher confidence never comes for free: to be surer you captured the truth, you must widen the net. If a half-unit margin is acceptable, 95% is fine; if you are approving a costly manufacturing tolerance, 99% may be worth the wider range.
Why Sample Size Matters
Because the standard error divides by √n, quadrupling the sample size only halves the margin of error. Going from n = 25 to n = 100 cuts the error in half; going from n = 100 to n = 400 halves it again. This is why survey costs climb fast near the target: the last few percent of precision are the most expensive. If you are planning a study, work backward from the margin of error you can accept and solve n = (z · σ / E)² before you collect any data.
Examples
Example 1 — Customer spend. A store samples 100 orders and finds a mean of $50 with a known standard deviation of $5. At the 95% level, the standard error is $0.50, the margin of error is about $0.98, and the true average order value is estimated at $49.02 to $50.98. The marketing team can plan around roughly $50 without over-claiming precision.
Example 2 — Quality control. A factory measures 36 parts and gets a mean length of 120 mm with σ = 2.5 mm. At the 99% level the margin of error is about 1.07 mm, so the true mean length is 118.93 to 121.07 mm. Because the tolerance band is wider than that interval, the run passes.
Example 3 — Very large samples. With n = 1,000,000, x̄ = 10 and σ = 2, the standard error is just 0.002 and the 95% margin of error is about 0.004. The interval narrows to 9.996 to 10.004, showing how massive samples yield razor-thin intervals.
FAQ
What is a confidence interval?
A confidence interval is a range, built around your sample mean, that is likely to contain the true population mean. The attached percentage (90%, 95%, or 99%) states how often intervals constructed this way would capture the true value if you repeated the sampling many times.
How do I calculate a 95% confidence interval?
Use the formula CI = x̄ ± 1.96 × (σ / √n). First compute the standard error σ / √n, multiply it by the critical z value 1.960 to get the margin of error, then subtract and add that margin to the sample mean. This calculator does it for you for 90%, 95%, and 99% levels.
What is the margin of error?
The margin of error is the half-width of the interval: z × (σ / √n). It is how far your estimate might reasonably be off, expressed in the same units as your data. Smaller margins mean a more precise estimate, usually achieved by increasing the sample size.
Should I use 90%, 95%, or 99% confidence?
95% is the default in most scientific, business, and reporting work. Use 90% when you want a narrower interval and can tolerate more uncertainty, and 99% when the cost of missing the true value is high, such as safety-critical measurements. Remember that higher confidence always widens the interval.
What is the difference between z and t intervals?
This calculator uses the z (normal) method, which is correct when the population standard deviation σ is known or the sample is large (n ≥ 30). When σ is unknown and the sample is small, a t-interval with degrees of freedom n − 1 is technically more appropriate; for n ≥ 30 the two are nearly identical.
What if my sample size is very large or very small?
Larger samples shrink the interval because the standard error divides by √n. With n = 1,000,000 the interval becomes extremely tight. Very small samples (n under 30) produce wide intervals and rely more on the t distribution and the assumption that the data is roughly normal. Sample size must always be a positive number.
Disclaimer
This confidence interval calculator is provided for informational purposes only and does not constitute statistical, academic, or professional advice. Results assume a simple random sample, an approximately normal or large-sample distribution, and a known or well-estimated standard deviation. Always interpret the interval in the context of your data and consult a qualified statistician before making high-stakes decisions.