Find the confidence interval and margin of error for a sample mean or a sample proportion at 90%, 95%, 99% or any other confidence level.
How to use the confidence interval calculator
Choose whether you are estimating a mean (an average such as height, spend or test score) or a proportion (a percentage such as the share of voters supporting a candidate). For a mean, enter the sample mean, the standard deviation and the sample size. For a proportion, enter the sample percentage and the sample size. Then set the confidence level — 95% is the convention in most fields. The calculator returns the interval, the margin of error, the standard error and the critical value, with a table showing how the interval widens or narrows at other confidence levels.
By default the mean interval uses the t-distribution, which is correct when the standard deviation comes from the sample itself. Tick the box only if the population standard deviation is genuinely known in advance, in which case the normal (z) distribution is used.
Confidence interval formulas
- x̄ or p̂ — the sample mean or sample proportion (the point estimate)
- s — the sample standard deviation; n — the sample size
- t* or z* — the critical value that leaves α/2 in each tail, where α = 1 − confidence level
- The part after the ± sign is the margin of error.
Worked example
A sample of 30 delivery times has a mean of 50 minutes and a standard deviation of 10 minutes. The standard error is 10 ÷ √30 ≈ 1.826. With 29 degrees of freedom, the 95% critical t-value is 2.0452, so the margin of error is 2.0452 × 1.826 ≈ 3.73 minutes. The 95% confidence interval is therefore about 46.27 to 53.73 minutes. Had we used z* = 1.96 instead, the interval would be slightly narrower (±3.58), understating the uncertainty that comes from estimating the standard deviation.
For a proportion: if 52% of 1,000 people surveyed say yes, the standard error is √(0.52 × 0.48 ÷ 1000) ≈ 0.0158, and the 95% margin of error is 1.96 × 0.0158 ≈ ±3.1 percentage points, giving an interval of 48.9% to 55.1%.
What a confidence interval really means
A 95% confidence interval comes from a procedure that captures the true population value in 95% of repeated samples. It is not quite right to say "there is a 95% probability the true mean is in this particular interval" — the true mean is fixed, and the interval either contains it or not. In practice, the interval gives a range of plausible values for the population parameter, and its width shows how precise your estimate is.
Choosing the confidence level
Higher confidence means a wider interval. Moving from 95% to 99% increases the critical value from 1.96 to 2.576 (for large samples), widening the interval by about a third. Lower levels such as 90% give tighter ranges but are wrong more often. Medical and engineering work sometimes uses 99%; business and social research typically use 95% or 90%.
Assumptions and caveats
- Random sampling. No formula can fix a biased sample. A large but unrepresentative survey still gives a misleading interval.
- Normality. The t-interval assumes the data is roughly normal or the sample is large enough (often n ≥ 30) for the central limit theorem to apply. Strongly skewed small samples need other methods.
- Proportions near 0% or 100%. The simple (Wald) formula breaks down when n·p̂ or n·(1 − p̂) is below about 10. The calculator therefore also shows the Wilson score interval, which stays accurate in those cases.
- Finite populations. If you sample more than about 5% of a small population, the true margin of error is a little smaller than shown.
If you only have raw data, compute the mean and standard deviation first with the standard deviation calculator. To see where a single observation falls relative to the mean, use the z-score calculator.
Cite or link to this page
Using this confidence interval calculator in an article, report or homework? Copy a citation or a ready-made link:
Calcivia. (2026). Confidence Interval Calculator. Retrieved October 31, 2026, from https://www.calcivia.com/confidence-interval-calculator/"Confidence Interval Calculator." Calcivia, 2026, https://www.calcivia.com/confidence-interval-calculator/. Accessed 31 Oct. 2026.<a href="https://www.calcivia.com/confidence-interval-calculator/">Confidence Interval Calculator</a> by Calcivia