How a Confidence Interval Is Built and What It Actually Claims
A confidence interval turns a single estimate into a range, so a report carries its own uncertainty rather than pretending to precision it does not have. Measure 100 bricks and find an average mass of 3 kg and you have a point estimate; add a 95% interval of 2.85 kg to 3.15 kg and you have communicated how much that estimate could move if you weighed a different hundred bricks. Pollsters quote it as a margin of error, medical papers report it beside every treatment effect, and quality teams use it to decide whether a batch really shifted. The width is driven by three things: how variable the data is, how large the sample is, and how confident you want to be.
Three formulas cover the standard cases. When the population standard deviation σ is genuinely known, the interval for a mean is x̄ ± z* × σ/√n, where x̄ is the sample mean, n is the sample size, σ/√n is the standard error, and z* is the two-tailed critical value from the standard normal distribution — 1.645 at 90%, 1.960 at 95%, 2.576 at 99%. When σ is unknown and you have only the sample standard deviation s, Student's t distribution replaces the normal: x̄ ± t* × s/√n with df = n − 1. The t value always exceeds z at the same level, which is the price of estimating σ from your own data. For a proportion the interval is p̂ ± z* × √(p̂(1 − p̂)/n), where p̂ is the observed fraction. Rearranging any of these for n gives the sample size a target margin needs.
Check it against calculator.net's published example. With x̄ = 22.8, σ = 2.7, n = 100 and 95% confidence, the standard error is 2.7 ÷ 10 = 0.27, so the margin of error is 1.960 × 0.27 = 0.5292 and the interval runs 22.2708 to 23.3292 — matching that page exactly. A LibreTexts textbook case with μ = 90, σ = 36 and n = 9 gives 66.48 to 113.52, again identical. On the t side, OpenStax Example 8.8 measures sensory rates for 15 subjects: x̄ = 8.2267, s = 1.6722, t*(df 14) = 2.1448, producing a 95% interval of 7.30 to 9.15. For a proportion, 600 successes out of 1,000 gives p̂ = 0.6 with a margin of error of ±3.04 percentage points, so the interval is 56.96% to 63.04%. Ask for a ±3-point margin at 95% with p̂ = 0.5 and you need 1,068 respondents.
Four real decisions hang on this. A market researcher planning a survey budget needs the sample-size mode first: 385 responses buy a ±5-point margin, and 1,068 buy ±3, so the extra precision nearly triples the cost. A lab technician with twelve replicate measurements must use the t interval, because σ was never known and n is small. A product manager reading an A/B test conversion rate of 5.2% needs the proportion interval to see whether the lift is distinguishable from noise at all. And anyone reporting a mean in a dissertation is usually required to give the interval alongside it, since a bare average hides whether the sample was 10 observations or 10,000.
Now the part most calculators leave out. A 95% interval does not mean there is a 95% probability that the true value lies inside the interval you just computed. In the frequentist reading the population value is fixed, not random — your interval either contains it or it does not. The 95% describes the method: repeat the sampling many times and about 95 in every 100 intervals will capture the truth. calculator.net makes the same point, and it is the commonest misreading in student work. Two caveats: the proportion formula is the Wald interval, unreliable when np̂ or n(1 − p̂) falls below 10, where Wilson or Clopper-Pearson is better; and every interval assumes a random sample. Critical z values follow the standard normal table. Nothing you enter is uploaded.