Confidence Interval Calculator

Compute a confidence interval and margin of error for a mean or a proportion, from summary numbers or raw data.

95% confidence interval
69.2658 to 75.5342

72.4 ± 3.1342

Margin of error3.13419
Critical value t* (df = 39)2.0227
Standard error1.54952

Working: 72.4 ± 2.0227 × 9.8/√40 = 72.4 ± 3.1342

Explain my result

An AI tutor reads your numbers and explains what they mean in plain words. Sends only the inputs and results shown above.

What “95% confident” looks like

Here, 20 imaginary studies each sample n values from a population whose true mean is 50 (dashed line) and build a 95% interval. Most intervals cross the line; about one in twenty misses (orange). Press “New samples” to rerun them.

Raise n and every interval shrinks, roughly in proportion to 1/√n, but the hit rate stays near 95%. Confidence describes the method, not one interval.

18 of 20 intervals contain the true mean.

Formulas

Mean: x̄ ± t* · s/√n   ·   Proportion: p̂ ± z* · √(p̂(1 − p̂)/n)

The critical value comes from the t distribution with n − 1 degrees of freedom (or the standard normal). The standard error is the standard error of the estimate. Planning a study and need a particular margin of error? Work backwards with the sample size calculator.

Frequently asked questions

What does a 95% confidence interval actually mean?

If you repeated the study many times and built an interval each time, about 95% of those intervals would contain the true value. It does not mean there is a 95% probability that this particular interval contains it; the true value is fixed, and the interval either covers it or not.

Should I use z or t?

Use t when you estimate the standard deviation from the sample, which is nearly always. Use z only when the population standard deviation is genuinely known, or for proportions. For large samples the two give almost the same answer.

How do I calculate the margin of error?

Margin of error = critical value × standard error. For a mean: t* × s/√n. For a proportion: z* × √(p̂(1 − p̂)/n). A poll of 1,000 people with p̂ = 0.5 has a 95% margin of error of about ±3.1 percentage points.

How can I make the interval narrower?

Increase the sample size (the width shrinks with √n, so four times the data halves the width), lower the confidence level, or reduce measurement noise.

What is the Wilson interval shown for proportions?

An alternative to the textbook (Wald) interval that behaves better with small samples or proportions near 0 or 1. Agresti and Coull (1998) recommend it. Your course may expect the Wald version, so both are shown.