Confidence interval calculator
90%, 95% and 99% confidence intervals for a mean or a proportion, plus the sample size you need.
- ๐บ๐ธ US federal & state rules
- See sources
95% confidence interval
46.2659 to 53.7341
50 ยฑ 3.7341
- Margin of error (ยฑE)
- 3.7341
- Critical value
- t = 2.0452 (df 29)
- Standard error
- 1.8257
This is an example. Enter your numbers above and press the button to see your own result.
- Assumes a random sample from a population that is roughly normal, or a sample large enough for the central limit theorem.
- Critical values are computed directly, so they can differ from a printed table in the third decimal place.
Show the math
| Distribution | Population SD unknown, so t with n - 1 degrees of freedom |
|---|---|
| Standard error | SE = s รท โn = 10 รท โ30 = 1.8257 |
| Margin of error | E = 2.0452 ร 1.8257 = 3.7341 |
| Interval | 50 ยฑ 3.7341 |
What to do next
How it works
For a mean, the interval is xฬ ยฑ critical value ร s รท โn. When the population SD is unknown, the critical value comes from the t distribution with n - 1 degrees of freedom. For a proportion, the interval is p ยฑ z ร โ(p(1 - p) รท n), and the Wilson interval is shown as well.
The required sample size is (z ร ฯ รท E)ยฒ for a mean and zยฒ ร p(1 - p) รท Eยฒ for a proportion, rounded up. With t, the calculation repeats with the new degrees of freedom until n stops changing, as NIST describes.
| df | 90% | 95% | 99% |
|---|---|---|---|
| 1 | 6.314 | 12.706 | 63.657 |
| 2 | 2.920 | 4.303 | 9.925 |
| 5 | 2.015 | 2.571 | 4.032 |
| 10 | 1.812 | 2.228 | 3.169 |
| 30 | 1.697 | 2.042 | 2.750 |
| 60 | 1.671 | 2.000 | 2.660 |
| 100 | 1.660 | 1.984 | 2.626 |
| โ | 1.645 | 1.960 | 2.576 |
Things to keep in mind
The math assumes a random sample. A low response rate or a sample that leans toward one group can be far from the truth even with a narrow interval.
There is no finite population correction, which matters only when your sample is a large share of the whole population.
Sources
- NIST/SEMATECH e-Handbook 1.3.6.7.2, Critical values of the Student's t distributionChecked 2026-10-19
- NIST/SEMATECH e-Handbook 7.2.4.1, Confidence intervals for a proportionChecked 2026-10-19
- NIST/SEMATECH e-Handbook 7.2.2.2, Sample sizes requiredChecked 2026-10-19
Frequently asked questions
What does a 95% confidence interval mean?
If you repeated the sampling many times and built an interval each time, about 95% of those intervals would contain the true mean. It does not mean there is a 95% chance the true value is in this one interval.
When do I use z and when do I use t?
Use z when you know the population standard deviation and t when you estimate it from the sample. At 95%, t is 2.045 with 29 degrees of freedom and 1.984 with 100, getting closer to z = 1.960 as n grows.
How is a poll's margin of error calculated?
For 1,000 people and a 50% result at 95% confidence, it is 1.96 ร โ(0.5 ร 0.5 รท 1,000), about ยฑ3.1 points. Pick Proportion and enter 50 and 1000 to check.
How big a sample do I need?
The margin of error shrinks with the square root of n, so halving it takes four times the sample. A ยฑ3 point poll at 95% needs 1,068 people when you assume 50%.