📏 Confidence Interval Calculator

Confidence intervals for a mean (t or z, from summary stats or raw data) or a proportion (Wilson, Wald, exact), with the margin of error at any level.

✓ Free✓ No Signup Required✓ Browser-Based
95% confidence interval for the mean
45.87 to 54.13
50.00 ± 4.13
Sample mean50.00
Sample SD (s)10.000
Sample size25
Standard error2.0000
Critical valuet (df = 24) = 2.0639
Margin of error4.1278

What Confidence Interval Calculator Does

This confidence interval calculator gives the range of plausible values for a population mean or proportion from your sample. For a mean, enter the sample mean, standard deviation and size — or paste the raw numbers and let it work them out. For a proportion, enter the number of successes and the sample size, such as 412 “yes” answers out of 1,000.

The result shows the interval, the margin of error, the standard error and the critical value used. Means use the t distribution unless you know the population standard deviation; proportions are shown three ways — Wilson score, Wald and exact Clopper–Pearson — so you can see when the simple method breaks down. An optional population size applies the finite population correction for surveys of a small group.

How to Use Confidence Interval Calculator

  1. Choose a mean from summary statistics, a mean from raw data, or a proportion
  2. Enter the mean, standard deviation and sample size — or paste your data, or successes and sample size
  3. Pick the confidence level, such as 95%
  4. Add the population size if you sampled a large share of it
  5. Read the interval, margin of error and critical value

Formula Used by Confidence Interval Calculator

Interval for a mean

CI = x̄ ± t(α/2, n − 1) × s ÷ √n

Worked example

The ten sample values in the raw-data box: mean 13.3, s = 1.054, 95% confidence.

  1. Standard error = 1.054 ÷ √10 = 0.333
  2. t with 9 df = 2.262
  3. Margin = 2.262 × 0.333 = 0.754

Result: 95% CI: 12.55 to 14.05.

Wilson score interval for a proportion

(p̂ + z²/2n ± z√(p̂(1 − p̂)/n + z²/4n²)) ÷ (1 + z²/n)

Worked example

40 successes out of 100, 95% confidence (z = 1.96).

  1. p̂ = 0.40
  2. Wilson: 30.9% to 49.8%
  3. Wald for comparison: 40% ± 9.6 = 30.4% to 49.6%

Result: With this many successes and failures the two agree closely; they diverge for small samples.

Critical Values by Confidence Level

Confidencezt (9 df, n = 10)t (29 df, n = 30)
80%1.2821.3831.311
90%1.6451.8331.699
95%1.9602.2622.045
98%2.3262.8212.462
99%2.5763.2502.756
99.9%3.2914.7813.659

Poll Margin of Error (95%, Result Near 50%)

Sample sizeMargin of error
100± 9.8 points
400± 4.9 points
1,000± 3.1 points
2,500± 2.0 points
10,000± 1.0 point

How to Read Your Result

Reading an interval

An interval of 45.9 to 54.1 says the data are consistent with any population mean in that range. If a value you care about — a target, an earlier result, a difference of zero — falls outside a 95% interval, the data are evidence against it at the 5% level, the same conclusion a two-tailed test at α = 0.05 would reach.

Wide interval? Collect more data

A wide interval means the estimate is imprecise. Halving the margin of error takes four times the sample, so use the sample size calculator to plan how many observations reach the precision you need before collecting more.

Proportions near 0% or 100%

With 2 successes out of 40, the Wald interval would run below zero and has to be cut off, while Wilson gives a sensible 1.4% to 16.5%. When there are fewer than 10 successes or failures, the calculator warns you that the Wald interval is unreliable.

Limitations & Accuracy Notes

  • Intervals assume a random sample; they cannot correct for biased sampling or non-response.
  • The t interval assumes the data are roughly normal, or the sample is large enough for the mean to be; strongly skewed small samples need other methods.
  • Intervals for the difference between two groups are not covered.

Frequently Asked Questions

How do you calculate a 95% confidence interval?
For a mean, use x̄ ± t × s ÷ √n, where t is the critical value for n − 1 degrees of freedom. With a mean of 50, SD of 10 and n = 25: standard error 2, t = 2.064, margin 4.13, so the interval is 45.87 to 54.13.
When should I use z instead of t?
Use t whenever the standard deviation comes from the sample, which is almost always. Use z only when the population standard deviation is genuinely known, and for proportions. As the sample grows, t approaches z — 1.96 for 95%.
What does a 95% confidence interval mean?
If you repeated the study many times and built an interval each time, about 95% of those intervals would contain the true value. Any single interval either contains it or not; the 95% describes the method’s long-run success rate.
Which confidence interval should I use for a proportion?
The Wilson score interval is widely recommended: it stays within 0–100% and keeps close to its stated coverage even for small samples or proportions near 0% or 100%. The simple Wald interval can be badly off there, and the exact Clopper–Pearson interval is conservative (wider).
What is the margin of error?
Half the width of the confidence interval: the critical value times the standard error. For a poll of 1,000 people with a 50% result, the 95% margin of error is 1.96 × √(0.25 ÷ 1,000) ≈ ±3.1 percentage points.
How does sample size affect a confidence interval?
The width shrinks with the square root of n, so quadrupling the sample halves the margin of error. A higher confidence level widens it: 99% uses a critical value of 2.576 instead of 1.96.
What is the finite population correction?
When your sample is a sizable share of the whole population — more than about 5% — the standard error is multiplied by √((N − n) ÷ (N − 1)), which narrows the interval. Enter the population size to apply it.
By OnlineToolHubs Team • September 2026