Confidence Interval Calculator guide
Confidence Interval Calculator: Means and Proportions
Use our confidence interval calculator to work out a confidence interval and margin of error for a mean or a proportion, at any confidence level.
By the AllCalculator editorial teamUpdated 16 October 20261 min read
A sample gives an estimate, but how close is it to the truth? A confidence interval gives a range that's likely to contain the real value. Our Confidence Interval Calculator works it out.
How to use the calculator (Confidence Interval Calculator)
- Choose an interval for a mean or a proportion.
- For a mean, enter the sample mean, standard deviation and size. For a proportion, enter the number of successes and the sample size.
- Choose a confidence level, usually 95%.
The formulas
- Mean: x̄ ± t × s ÷ √n
- Proportion: p̂ ± z × √(p̂(1 − p̂) ÷ n)
The part after ± is the margin of error. The calculator uses the t distribution when the standard deviation comes from your sample, which is usually the case.
Common critical values (z)
| Confidence | z |
|---|---|
| 90% | 1.645 |
| 95% | 1.960 |
| 99% | 2.576 |
A worked example
With the calculator's default settings, a sample of 40 with a mean of 50 and a standard deviation of 8, at 95% confidence:
- Standard error: 8 ÷ √40 = 1.265
- t (39 degrees of freedom) = 2.023
- Margin of error: 2.023 × 1.265 = 2.56
- Interval: 47.44 to 52.56
Frequently asked questions
What does 95% confidence mean?
If you repeated the study many times, about 95% of the intervals would contain the true value. It doesn't mean there's a 95% chance this particular interval is right.
How can I make the interval narrower?
Use a bigger sample. Quadrupling the sample size halves the margin of error.
What sample size do I need?
Use our Sample Size Calculator to plan a survey.
Sources and further reading
- NIST/SEMATECH e-Handbook of Statistical Methodsitl.nist.gov
- ONS: Uncertainty and how we measure it for our surveysons.gov.uk
Links open official and independent websites in a new tab.
This guide is general information to help you understand your options. It isn't financial, tax, legal or building advice and doesn't take your personal circumstances into account. Figures were checked when the guide was last updated and can change, so confirm anything important with GOV.UK, HMRC, a regulated adviser or a qualified tradesperson.