This confidence interval calculator finds the range that's likely to contain a population mean, based on a sample. Enter the sample mean, the standard deviation and the sample size, choose a confidence level, and you'll get the lower and upper bounds, the margin of error, the standard error and the z-score. It's useful for survey results, lab measurements, quality checks and coursework, wherever you need to show how precise an average is.
What is a confidence interval?
A confidence interval gives lower and upper bounds that are likely to contain the true value of an unknown parameter, such as a population mean. Instead of reporting a single estimate, such as an average screen time of 3 hours a day, a confidence interval provides a range, such as from 2 hours to 4 hours. It's based on a coverage probability called the confidence level, which is typically 95%.
Confidence interval formula
Confidence interval = mean ± z × (standard deviation ÷ √sample size)
The part after the ± sign is the margin of error. The standard deviation divided by the square root of the sample size is called the standard error, and z is the z-score for your confidence level.
How to use the confidence interval calculator
- Enter the sample mean, which is the average of your data.
- Enter the standard deviation of the sample.
- Enter the sample size, the number of values in the sample.
- Choose the confidence level. 95% is the most common choice.
- Press Calculate.
Worked example
A sample of 100 measurements has a mean of 50 and a standard deviation of 10. The standard error is 10 ÷ √100, which is 1. At a 95% confidence level the z-score is 1.96, so the margin of error is 1.96 × 1 = 1.96. The confidence interval runs from 50 − 1.96 to 50 + 1.96, which is 48.04 to 51.96. If you choose 99% instead, the interval widens to 47.4242 to 52.5758.
z-scores for common confidence levels
| Confidence level | z-score |
|---|---|
| 80% | 1.2816 |
| 85% | 1.4395 |
| 90% | 1.6449 |
| 95% | 1.96 |
| 98% | 2.3263 |
| 99% | 2.5758 |
| 99.9% | 3.2905 |
Precise values of z are given by the quantile function of the normal distribution. If no explicit confidence level is given, the most commonly used level is 95%.
What a 95% confidence level really means
This is often misunderstood. A 95% confidence level doesn't imply a 95% probability that the true value lies within the particular interval you calculated from one sample. The confidence level reflects the long-run performance of the method. In other words, if the same sampling procedure were repeated 100 times from the same population, approximately 95 of the resulting intervals would be expected to contain the true population mean. The true mean is a fixed unknown number, and it's the interval that changes from sample to sample.
What makes an interval wider or narrower
- Sample size. The smaller the sample, the wider the margin. Because the sample size sits under a square root, you need four times as many values to halve the margin of error.
- Spread of the data. A larger standard deviation gives a wider interval.
- Confidence level. Asking for more confidence, such as 99% in place of 95%, makes the interval wider.
Small samples
This calculator uses z-scores from the normal distribution. That's a good approximation when the sample has about 30 values or more. For smaller samples, where the standard deviation is itself estimated from only a few values, statisticians use the t distribution, which gives a somewhat wider interval. If you enter a sample size below 30, the result includes a reminder of this.
Where confidence intervals are used
- Surveys and polls, to show how far the result might be from the figure for the whole population.
- Science and medicine, to report the precision of a measured effect.
- Manufacturing, to check that an average weight or size is within tolerance.
- Coursework, to check answers to statistics problems.
A quick estimate in your head
At a confidence level of 95%, the z-score is very close to 2. So a rough interval is the mean plus or minus two standard errors. In the worked example, the standard error is 1, so the rough answer is 48 to 52, which is almost the same as the exact 48.04 to 51.96. This shortcut is handy for checking that a result is sensible before you rely on it, or for reading a report that gives only the mean and the standard error.
How to report your result
Give the mean, the confidence level and both bounds, so that a reader can see what you did. A clear way to write the worked example is: the mean was 50, with a 95% confidence interval of 48.04 to 51.96, from a sample of 100. Round the bounds to the same number of decimal places as your data, or one more. If you compare two groups, show an interval for each one, worked out at the same confidence level, so that a reader can set them side by side.
Common mistakes
- Reading it as a probability about the true value. The confidence level describes the method, as explained above.
- Entering the variance. Use the standard deviation, which is the square root of the variance.
- Entering the standard error as the standard deviation. The calculator divides by the square root of the sample size for you.
- Using it for very small samples without allowing for the wider t-interval.
Related calculators
Find the spread of your data with the standard deviation calculator, plan a survey with the sample size calculator, and standardize a value with the z-score calculator.
What next
Use this often? Add Confidence I to your Home screen.
Frequently asked questions
How does the confidence interval calculator work?
It works out the standard error, multiplies it by the z-score for your confidence level to get the margin of error, then adds and subtracts that from the mean.
What is the z-score for a 95% confidence interval?
It's 1.96. For 90% it's about 1.645, and for 99% it's about 2.576.
What does a 95% confidence interval mean?
If you repeated the sampling many times, about 95% of the intervals calculated this way would contain the true population mean.
How do I make the confidence interval narrower?
Use a larger sample, or accept a lower confidence level. Four times the sample size halves the margin of error.
Can I use it for a small sample?
You can, but for fewer than about 30 values a t-interval is more accurate and slightly wider.
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.