Use this free confidence interval calculator to estimate a range that is likely to contain the true value for a whole group, based on a sample. Enter your sample mean, the standard deviation, and the sample size to get a confidence interval and the margin of error. Or enter the number of successes and the sample size to get an interval for a proportion, as used in polls and surveys. You can also find the sample size you need for a target margin of error. No signup needed.
Calculate confidence intervals for a population mean or proportion, or find the sample size needed for your desired margin of error.
Example: 120 successes out of 400 responses.
Use 0.5 if the proportion is unknown.
| 80% | 1.282 |
| 90% | 1.645 |
| 95% | 1.960 |
| 98% | 2.326 |
| 99% | 2.576 |
| 99.9% | 3.291 |
For a mean:
A confidence interval is a range of values, built from sample data, that is likely to contain the true value for the whole population. For example, a poll finds that 52% of voters support a plan, with a margin of error of 3 points. The 95% confidence interval is 49% to 55%.
A 95% confidence level means that if you repeated the sampling process many times, about 95% of the intervals you build would contain the true value. It does not mean there is a 95% chance that this one interval contains the true value, once it has been calculated. The true value is a fixed number, and the interval either contains it or does not.
Confidence interval = Estimate ± Margin of error
Margin of error = Critical value × Standard error
For a mean, when the population standard deviation (σ) is known:
For a mean, when only the sample standard deviation (s) is known:
For a proportion:
Sample size for a mean: n = (z × σ ÷ E)²
Sample size for a proportion: n = z² × p × (1 − p) ÷ E², where p = 0.5 if unknown
E is the margin of error you want. Round the sample size up to the next whole number.
| Confidence level | z critical value |
|---|---|
| 80% | 1.282 |
| 90% | 1.645 |
| 95% | 1.960 |
| 98% | 2.326 |
| 99% | 2.576 |
| 99.9% | 3.291 |
For 95% confidence, the t value is about 2.365 for n = 8 (7 degrees of freedom), 2.064 for n = 25 (24 degrees of freedom), and 2.045 for n = 30 (29 degrees of freedom).
A sample of 100 has a mean of 50. The population standard deviation is 10. Find the 95% confidence interval.
A sample of 8 values has a mean of 14.875 and a sample standard deviation of 2.997.
A sample of 25 has a mean of 72 and a sample standard deviation of 8.
Using Example 1 (mean 50, standard error 1):
| Confidence level | z | Margin of error | Interval |
|---|---|---|---|
| 90% | 1.645 | 1.645 | 48.36 to 51.64 |
| 95% | 1.960 | 1.960 | 48.04 to 51.96 |
| 99% | 2.576 | 2.576 | 47.42 to 52.58 |
A higher confidence level gives a wider interval. You trade precision for confidence.
With a standard deviation of 10 and 95% confidence:
| Sample size | Margin of error |
|---|---|
| 25 | ±3.92 |
| 100 | ±1.96 |
| 400 | ±0.98 |
A larger sample gives a narrower interval. To cut the margin of error in half, you need about four times as many observations.
In a survey of 400 people, 120 say they prefer a product.
(The Wilson method, which works better for small samples or for proportions near 0 or 1, gives 25.7% to 34.7%.)
A poll of 1,000 people finds that 52% support a proposal.
Since the interval includes 50%, this poll cannot rule out that support is below half.
You want a margin of error of ±3% with 95% confidence, and you do not know the proportion, so you use 50%.
You want to estimate a mean within ±2, the standard deviation is about 10, and you want 95% confidence.
A range of values, based on a sample, that is likely to contain the true value for the whole population. A 95% confidence interval is built by a method that captures the true value in about 95% of repeated samples.
Calculate the standard error (standard deviation ÷ √n), multiply it by the critical value (z or t), and add and subtract the result from the sample mean. For a mean of 50, a standard deviation of 10, and n = 100, the 95% interval is 48.04 to 51.96.
Find the sample proportion p̂, calculate √(p̂ × (1 − p̂) ÷ n), multiply by z, and add and subtract from p̂. For 120 of 400, the 95% interval is 25.5% to 34.5%.
Half the width of the confidence interval. It is the critical value times the standard error.
If you repeated the study many times, about 95% of the intervals would contain the true value. It does not mean there is a 95% probability that one specific interval contains it.
1.96. For 90% it is 1.645, and for 99% it is 2.576.
Use t when you do not know the population standard deviation and your sample is small. For large samples, t and z are almost the same.
A larger sample gives a smaller standard error and a narrower interval. To halve the margin of error, you need about four times the sample size.
A higher confidence level, such as 99% instead of 95%, gives a wider interval.
For a proportion, n = z² × p × (1 − p) ÷ E². For a margin of error of 3% at 95% confidence with p = 0.5, you need 1,068 people.
It can for small samples or extreme proportions, such as going below 0% or above 100%. In that case, use a better method such as the Wilson interval, and limit the range to 0% to 100%.
Yes. It is free, with no registration and no limits.
It uses standard formulas and the numbers you enter. The result assumes a random sample and a reasonably normal distribution (or a large sample), and it does not correct for bias.
A few of the most-used tools in each hub.
This calculator is for general informational and educational purposes only. Results depend on the numbers you enter and on assumptions such as random sampling. They do not account for bias or errors in data collection. For research, medical, business, or other important decisions, consult a qualified statistician.