This confidence interval calculator gives the range likely to contain the true population value. It works for a mean, using the t-distribution or the normal distribution as appropriate, and for a proportion, using the accurate Wilson score method. Any confidence level can be used.
Confidence interval for a mean
CI = x̄ ± t × s ÷ √n
x̄ is the sample mean, s the standard deviation and n the sample size. When s comes from the sample, the critical value t comes from the t-distribution with n − 1 degrees of freedom. When the population standard deviation is known, z from the normal distribution is used instead.
Confidence interval for a proportion
For a proportion, the calculator uses the Wilson score interval, which stays accurate with small samples and with results near 0% or 100%, where the simple p̂ ± z√(p̂(1 − p̂)/n) formula can give impossible values.
Common critical values
| Confidence | z | t (df = 10) | t (df = 30) |
|---|---|---|---|
| 90% | 1.645 | 1.812 | 1.697 |
| 95% | 1.960 | 2.228 | 2.042 |
| 99% | 2.576 | 3.169 | 2.750 |
Worked example
A sample of 25 has a mean of 50 and a standard deviation of 10. The standard error is 10 ÷ 5 = 2, and t for 24 degrees of freedom at 95% is 2.064, so the margin of error is 4.128. The 95% confidence interval is 45.872 to 54.128.
Frequently asked questions
What does a 95% confidence interval mean?
If you repeated the study many times and built an interval each time, about 95% of those intervals would contain the true value. It does not mean there is a 95% chance this particular interval contains it.
When should I use t instead of z?
Use t when the standard deviation is estimated from your sample, which is almost always. Use z only when the population standard deviation is genuinely known.
Why is my interval so wide?
Intervals widen with more variation, smaller samples and higher confidence levels. Quadrupling the sample size roughly halves the width.
How many responses do I need for a given margin of error?
Use the sample size calculator, which works backward from the margin of error you want.
Related calculators
- Sample Size Calculator
- Z-Score Calculator
- Standard Deviation Calculator
- Mean, Median, Mode Calculator
Last reviewed: October 2026.