Confidence interval calculator (mean or proportion)
Your sample gives an estimate. The confidence interval shows the range where the true value probably lies.
Result
[45.8722, 54.1278]Confidence interval
- Lower bound
- 45.8722
- Upper bound
- 54.1278
- Margin of error (±)
- 4.1278
- Standard error
- 2
- Critical value t = 2.0639 (df = 24)
- Assumptions: random sample, roughly normal data or a large enough n; σ estimated by the sample standard deviation.
Inputs
- What you estimate
- Mean (Student t)
- Sample mean
- 50
- Standard deviation
- 10
- Sample size (n)
- 25
- Confidence level
- 95%
How it is calculated
Mean: mean ± q × standard deviation ÷ √n.
Result
Confidence interval
- Lower bound
- 45.8722
- Upper bound
- 54.1278
- Margin of error (±)
- 4.1278
How it is calculated
- Mean: mean ± q × standard deviation ÷ √n.
- q comes from Student’s t law with n − 1 degrees of freedom, or from the normal law when σ is known (1.96 at 95%).
- Proportion: p = yes ÷ n, Wilson interval (more accurate than p ± z√(p(1 − p)/n), shown for comparison).
Example
Mean 50, standard deviation 10, n = 25, 95%, Student: t = 2.0639 (24 df), margin ≈ 4.1278, interval [45.8722, 54.1278].
Good to know
- This is not a prediction interval: it brackets the true mean, not a single new measurement.
- 95% confidence means the method works 95 times out of 100, not that the true value has a 95% chance of lying in this exact interval.
- A biased sample gives a wrong interval, even a narrow one.
When to use it
- Give a survey result with its margin, for example 62% ± 4%.
- Report a measured mean with its uncertainty in a lab report.
- To plan how many people to ask before the survey, use the Sample size calculator (survey).
Frequently asked questions
Why is a 99% interval wider than a 95% one?
Being more sure that the interval contains the true value means taking a wider range. At the same sample size, more confidence always costs precision.
How do I make the interval narrower?
Increase the sample size. The margin shrinks with √n, so 4 times more people roughly halves it.
When should I use t instead of z?
Use t when the standard deviation comes from your sample, which is the usual case. z is only for when the population standard deviation is known in advance.