Skip to main content

Confidence Interval Calculator

Build CIs for a mean from raw data or summary stats, or for a proportion, using bundled t- and z-tables.

Written by Golam Rabbani, Founder & Lead Engineer

What are you estimating?

How to use this confidence interval calculator

  1. Pick what you are estimating: a mean (from summary stats or raw data) or a proportion.
  2. For a mean, decide whether σ is known. If yes, the calculator uses a z critical value; if no, it uses Student's t.
  3. Choose the confidence level (80% to 99.9%).
  4. Press Calculate to read the interval, the margin of error, and the critical value used.

About this confidence interval calculator

A confidence interval is a range built from your sample so that, across many repeated samples, the true population parameter falls inside the interval at the chosen rate (e.g. 95% of the time for a 95% CI). For a mean, CI = x̄ ± critical × (SD / √n). The critical value is z when σ is known and t (with df = n − 1) when σ is estimated from the sample. For a proportion, CI = p̂ ± z × √(p̂(1 − p̂) / n) using the normal (Wald) approximation. Critical values come from bundled z- and t-tables — there is no live network call.

Worked example (mean). x̄ = 50, s = 8, n = 30, 95% CI, σ unknown. SE = 8 / √30 ≈ 1.4606. With df = 29 the two-tail t-critical at α = 0.05 is 2.045 (from the bundled table), giving a margin of error 2.045 × 1.4606 ≈ 2.987 and a 95% CI of (47.013, 52.987). Worked example (proportion). 320 successes in n = 500, 95% confidence. p̂ = 0.64, SE = √(0.64 · 0.36 / 500) ≈ 0.02147, z = 1.9600, margin = 0.0421, 95% CI = (0.598, 0.682). The tool warns when np̂ or n(1 − p̂) is below 10 because the normal approximation can be misleading there.

FAQ

When should I use the t-distribution vs z?
Use t whenever σ is estimated from the sample (almost all practical work). Use z only when σ is genuinely known in advance, which is rare.
What if my sample is small (say n = 15)?
Stick with t. The bundled t-table covers df from 1 to 120 with standard published values; above 120 it falls through to the z-row.
Why does the proportion calculator warn me sometimes?
Because the Wald (normal-approximation) interval is unreliable when np̂ or n(1 − p̂) drops below ~10. For very small counts, prefer an exact (Clopper–Pearson) or Wilson interval.
Does the 95% mean "95% chance the parameter is in this interval"?
Strictly speaking, no. It means that 95% of intervals built this way over repeated samples would cover the true parameter. The parameter is fixed; the interval is random.
Where do the critical values come from?
A bundled t-table (df 1–120) and z-table built from a 7-decimal inverse-normal approximation. No live API.