Math & Geometry
Confidence Interval Calculator
Confidence interval for a mean (from the sample mean and standard deviation) or for a proportion, with the margin of error and standard error.
How to use this calculator
- Choose whether you are estimating a mean or a proportion.
- Select the confidence level.
- Enter the sample size and either the sample mean and standard deviation, or the sample proportion.
- Read the interval, its bounds, the margin of error and the standard error.
What a confidence interval tells you
A sample mean or percentage is only an estimate of the true value in the population. A confidence interval gives a range around the estimate that is likely to contain the true value: a 95% interval is built by a method that captures the true value in 95% of repeated samples. Its half-width is the margin of error, equal to the z-value for the chosen confidence level multiplied by the standard error.
For a mean, the standard error is the sample standard deviation divided by the square root of the sample size; for a proportion it is √(p̂(1 − p̂) ÷ n). Larger samples give narrower intervals, but precision improves only with the square root of n — quadrupling the sample halves the margin of error.
Reading and reporting the result
Report an interval with its confidence level, for example “mean waiting time 50 minutes (95% CI 48.0 to 52.0)”. If two groups' intervals do not overlap, their difference is statistically significant; overlapping intervals do not prove the opposite. Polls usually report the margin of error for 50%, the widest case — about ±4.9 points for 400 respondents and ±3.1 for 1,000.
Assumptions
The z-based interval assumes a random sample and a sampling distribution close to normal, which holds for reasonably large samples. For small samples of a mean, use the t-distribution, which gives slightly wider intervals; for proportions near 0% or 100%, the Wilson interval is more accurate.
Formula & method
Mean: x̄ ± z × s ÷ √nProportion: p̂ ± z × √(p̂(1 − p̂) ÷ n)Margin of error = z × standard errorWorked example
Mean of 50, standard deviation 10, 100 observations, 95% confidence
- Standard error = 10 ÷ √100 = 1
- Margin of error = 1.96 × 1 = 1.96
- Interval = 50 ± 1.96
Answer: 48.04 to 51.96.
Frequently asked questions
Should I use z or t for small samples?
For a mean with fewer than about 30 observations, the t-distribution gives a slightly wider, more accurate interval; this calculator uses z.
Does a 95% interval mean there is a 95% chance the true value is inside?
Strictly, 95% of intervals built this way contain the true value; a given interval either does or does not.
Why is my poll's margin of error ±3%?
For about 1,000 respondents at 95% confidence and p = 50%, the margin is 3.1 points.
How do I make the interval narrower?
Increase the sample size or accept a lower confidence level.
What is the standard error?
The standard deviation of the estimate across repeated samples.
Which z-value goes with 99%?
2.576.
Can I use it for small samples?
For means with fewer than about 30 observations, prefer a t-based interval.