Build confidence intervals the textbook way: for a mean when the population SD is known (z method), for a mean from a sample SD (t method with exact t critical values), and for a proportion — at 90%, 95% or 99% confidence.
If the same sampling procedure were repeated many times, about 95% of the intervals built this way would contain the true value. It is a statement about the method's long-run reliability, not a 95% probability about this one interval in the strict frequentist reading.
Use t when σ is unknown and estimated from the sample (the usual case). The t critical value is larger than z — especially for small samples — which honestly widens the interval. This calculator computes exact t critical values from the t distribution.
The margin shrinks with √n: quadrupling the sample halves the margin. Going from n = 100 to n = 400 in the poll example cuts ±9.6 points to ±4.8 points.
The standard (Wald) interval used here can misbehave for very small samples or extreme proportions; treat results cautiously when np or n(1−p) is under about 10.
Mean, σ known: x̄ ± z* × σ ÷ √n. Mean, s known: x̄ ± t*(df = n − 1) × s ÷ √n, with t* found by inverting the t CDF numerically. Proportion: p̂ ± z* × √(p̂(1 − p̂) ÷ n). Critical values: z* = Φ⁻¹((1 + level) ÷ 2) — 1.645, 1.960, 2.576 for 90/95/99%.
Inputs: mean type (σ known): x̄ = 100, σ = 15, n = 25, 95%.
Steps: Standard error = 15 ÷ √25 = 15 ÷ 5 = 3. Margin = 1.960 × 3 = 5.88. Interval = 100 ± 5.88.
Result: 94.12 to 105.88. T-method check: with s = 15 instead, t*(24 df) = 2.064, margin = 6.19, interval 93.81 to 106.19 — wider, as it should be.
Add this calculator to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the calculator to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.