Confidence Interval Calculator Z-Score
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
A confidence interval calculator with a z-score uses your sample mean, standard deviation, and sample size to compute a range that likely contains the true population mean. You enter those three values plus your chosen confidence level (like 95%), and the calculator returns the lower and upper bounds of the interval, along with the margin of error. The z-score is the number of standard deviations from the mean that corresponds to your confidence level, such as 1.96 for 95% confidence.
Formula
The formula for a z-based confidence interval is:
Confidence Interval = x̄ ± z × (σ / √n)
Where:
- x̄ (x-bar) is the sample mean (the average you observed).
- z is the z-score for your chosen confidence level (e.g., 1.96 for 95%).
- σ (sigma) is the population standard deviation (known in advance).
- n is the sample size.
- σ / √n is the standard error of the mean.
The result is a range: [x̄ – z×SE, x̄ + z×SE]. The margin of error is the amount added and subtracted from the sample mean.
Worked Example
Suppose you have a sample mean of 100, a known population standard deviation of 15, and a sample size of 30. You want a 95% confidence interval.
- Find the z-score for 95% confidence: 1.96.
- Compute the standard error: σ / √n = 15 / √30 ≈ 15 / 5.477 ≈ 2.7386.
- Multiply by z: 1.96 × 2.7386 ≈ 5.37.
- Lower bound: 100 – 5.37 = 94.63.
- Upper bound: 100 + 5.37 = 105.37.
So the 95% confidence interval is approximately [94.63, 105.37]. The calculator block above gives the same result when you use the defaults.
When to Use a Z-Score vs. a T-Score
The z-score method is valid only when the population standard deviation (σ) is known. In most real research, you do not know σ; you only have the sample standard deviation (s). In that case, you should use a t-score from the t-distribution, which accounts for the extra uncertainty. The t-score approaches the z-score as sample size grows, so for n > 30 many textbooks use z as an approximation, but the t-distribution is more accurate for small samples.
Here is a quick guide:
- Population SD known and data normally distributed (or n large): use z-score.
- Population SD unknown: use t-score with n–1 degrees of freedom.
- Sample size very small (n < 30) and data not normal: consider nonparametric methods.
Many online calculators labeled “z-score� actually ask for the sample standard deviation, which is a common mismatch. Always check which standard deviation you are entering.
How to Choose the Right Z-Score
The z-score depends on your confidence level. For a two-sided interval, the z-score is the value that leaves α/2 in each tail, where α = 1 – confidence level. Common values:
- 90% confidence → z = 1.645
- 95% confidence → z = 1.96
- 99% confidence → z = 2.576
You can find these from a standard normal table or using the inverse normal function. For example, in Excel, NORM.S.INV(0.975) gives 1.96 for 95% confidence because 0.975 = 1 – 0.05/2.
If you are doing a one-sided interval (e.g., “we are 95% confident the mean is at least X�), the z-score changes: 1.645 for 95% one-sided, not 1.96. Most calculators assume two-sided, so read the output carefully.
Common Mistakes and Misconceptions
One frequent error is confusing the population standard deviation with the sample standard deviation. Using the sample SD in a z-formula underestimates the margin of error, giving an interval that is too narrow. Another mistake is using the wrong z-score for the confidence level, such as using 1.96 for a 90% interval.
Another misconception: “95% confidence� does not mean there is a 95% probability that the true mean lies in this specific interval. It means that if you repeated the sampling many times, about 95% of the computed intervals would contain the true mean. The interval you have is either one of those that contains it, or not.
Also, the z-interval assumes the sample mean is normally distributed. That holds if the population is normal or if the sample size is large enough (central limit theorem). For heavily skewed data with small n, the interval may be inaccurate.
Interpreting the Result
The output gives you a range of plausible values for the population mean. A wider interval (larger margin of error) indicates more uncertainty, often due to a small sample size or high variability. A narrower interval suggests more precision.
For example, if your 95% interval for average height is [170 cm, 180 cm], you can say you are 95% confident the true average lies between those values. But you cannot say that 95% of individuals fall in that range—that would be a prediction interval, which is much wider.
When reporting, include the confidence level, the interval, and the sample size. For instance: “The mean was 175 cm (95% CI: 170, 180; n=50).�
Limits of the Z-Interval
The z-interval is only as good as its assumptions. If the population standard deviation is unknown, if the data are not independent, or if the sample is biased, the interval may be misleading. Also, the formula assumes simple random sampling; convenience samples or clustered designs require different formulas.
For proportions, the z-interval uses a different standard error: √(p̂(1–p̂)/n). The same z-scores apply, but the formula changes. This calculator is for a mean, not a proportion.
Finally, the z-interval is not robust to outliers. A single extreme value can pull the sample mean and inflate the standard deviation, making the interval less representative. Always plot your data before trusting the interval.
Frequently Asked Questions
What is the z-score for a 95% confidence interval?
The z-score for a two-sided 95% confidence interval is 1.96. This means that 95% of the area under the standard normal curve lies between -1.96 and +1.96. For 90% it is 1.645, and for 99% it is 2.576.
Can I use a z-score if I only have the sample standard deviation?
Strictly, no. The z-score formula requires the population standard deviation. If you only have the sample standard deviation, you should use a t-score with n–1 degrees of freedom. However, for large samples (n > 30), the t-score is very close to the z-score, so many practitioners use z as an approximation.
What is the difference between a confidence interval and a prediction interval?
A confidence interval estimates a population parameter (like the mean) with a certain level of confidence. A prediction interval estimates a future individual observation. Prediction intervals are much wider because they include the random variation of a single data point, not just the sampling error of the mean.
Why is my interval so wide?
A wide interval means a large margin of error. This can be due to a small sample size, a large standard deviation, or a high confidence level (like 99%). To narrow the interval, increase the sample size, reduce measurement error, or accept a lower confidence level.
Does the confidence interval tell me where the population mean is?
No. It tells you a range of values that are plausible given your sample. The true mean is fixed, but you don’t know it. The interval either contains it or not. The “95%� refers to the long-run success rate of the method, not the probability for this specific interval.
Related
Formula used
in xbar | Sample mean | - | 100 | 0 in sigma | Population SD | - | 15 | 0 in n | Sample size | - | 30 | 1 sel conf | Confidence level | 90%=1.645, 95%=1.96, 99%=2.576 | 95%=1.96 out moe | Margin of error | - | z * (sigma / sqrt(n)) | 2 out lower | Lower bound | - | xbar - moe | 2 out upper | Upper bound | - | xbar + moe | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.