Skip to content
Popular Calculators
Browse Statistics calculators

Confidence Interval Calculator

Find a confidence interval for a mean, from data or summary figures with the t or z value, or for a proportion with the Wilson interval.

What do you want to work out?

About the Confidence Interval Calculator

A sample gives an estimate — an average, a percentage — but a different sample would give a slightly different one. A confidence interval puts a range around the estimate that shows how precise it is. A poll might find 40 percent support with a 95 percent confidence interval of 35 to 45 percent; a study might estimate an average weight loss of 5 kg with an interval of 3.2 to 6.8 kg. The narrower the interval, the more precise the estimate.

This confidence interval calculator finds intervals for a mean — from raw data or from the sample mean, standard deviation and size — and for a proportion. For means it uses the t distribution when the standard deviation comes from the sample, as it almost always does, or the z value when the population standard deviation is known. For proportions it gives the standard interval and the more accurate Wilson interval. You can choose any common confidence level from 80 to 99.9 percent.

How to Use the Confidence Interval Calculator

Choose Mean from summary, Mean from data or Proportion.

For a summary, enter the sample mean, standard deviation and sample size, and say whether the standard deviation is from the sample or a known population value.

For data, paste your numbers.

For a proportion, enter the percentage in the sample and the sample size.

Choose the confidence level — 95% is the usual choice.

The Formulas

  mean (σ unknown):  x̄ ± t(n − 1) × s ÷ √n
  mean (σ known):    x̄ ± z × σ ÷ √n
  proportion:        p̂ ± z × √( p̂(1 − p̂) ÷ n )

  z for 90% = 1.645,  95% = 1.960,  99% = 2.576

The part after ± is the margin of error. The t value depends on the degrees of freedom, n − 1, and is always a little larger than z.

Step-by-Step Example: Mean From Summary

A sample of 25 with mean 50 and standard deviation 10, at 95% confidence.

  Standard error:   10 ÷ √25 = 2
  t (24 df):        2.0639
  Margin:           2.0639 × 2 = 4.1278
  Interval:         50 ± 4.13 → 45.87 to 54.13

We can be 95% confident the population mean lies between 45.87 and 54.13. Using 1.96 instead of t would give the slightly narrower 46.08 to 53.92.

Step-by-Step Example: Mean From Data

The values 2, 4, 4, 4, 5, 5, 7, 9.

  Mean 5, sample SD 2.1381, n = 8
  Standard error:   2.1381 ÷ √8 = 0.7559
  t (7 df):         2.3646
  Margin:           2.3646 × 0.7559 = 1.7875
  Interval:         3.21 to 6.79

With only eight values, the t value is well above 1.96, widening the interval.

Step-by-Step Example: Proportion

40% of a sample of 400.

  Standard error:   √(0.4 × 0.6 ÷ 400) = 0.02449
  Margin:           1.96 × 0.02449 = 0.0480
  Interval:         35.20% to 44.80%
  Wilson interval:  35.32% to 44.87%

What "95% Confident" Means

The confidence level describes the method, not a single interval. If the study were repeated many times, each time calculating a 95 percent interval, about 95 percent of those intervals would contain the true value and about 5 percent would miss it. Any one interval either contains the truth or does not; we simply do not know which. It is therefore not quite right to say there is a 95 percent probability that the true mean lies in this particular interval, although in practice that is how many people read it.

Choosing a Confidence Level

Higher confidence needs a wider interval. For the summary example, the 90 percent interval is about 46.58 to 53.42, the 95 percent interval 45.87 to 54.13, and the 99 percent interval 44.41 to 55.59. Most research reports 95 percent intervals by convention. Use 99 percent when a wrong conclusion would be costly, and 90 percent for quick, exploratory estimates.

Confidence Intervals and Significance Tests

Confidence intervals and hypothesis tests are two views of the same calculation. A 95 percent interval contains exactly the values that a two-sided test at the 5 percent level would not reject. If a 95 percent interval for the average effect of a diet runs from 1.2 to 4.8 kg, a test of "no effect" (zero) would be significant, because zero lies outside the interval. Many journals now prefer intervals to bare p-values, because an interval shows not only whether an effect is likely to be real but also how large it might plausibly be — a result can be statistically significant yet too small to matter in practice.

Making Intervals Narrower

The margin of error is proportional to the standard deviation and inversely proportional to √n. To halve the margin you need four times as much data. Reducing noise — measuring more carefully, or studying a more uniform group — also helps. Lowering the confidence level narrows the interval too, but only by accepting a greater chance of missing the true value.

Understanding Your Result

The headline is the interval.

The estimate ± margin line shows the centre and the margin of error.

The standard error and critical value line shows the two numbers multiplied to make the margin.

The Wilson interval line, for proportions, gives the more accurate alternative.

The what it means line states the interval in words.

When Should You Use This Calculator?

Use it to report the precision of an average or percentage from a sample.

Use it to add error bars to survey results or experimental measurements.

Use it to judge whether two estimates might plausibly be equal.

Use it for statistics homework on estimation.

Common Mistakes

Using z when the SD comes from the sample. Use t, especially for small samples.

Using the population SD formula. Confidence intervals use the sample SD.

Reading the interval as the range of the data. It describes the mean, not individual values.

Ignoring non-random sampling. Bias is not captured by the margin of error.

Using the simple proportion interval with very few successes. Prefer the Wilson interval.

Frequently Asked Questions

How do I find a 95% confidence interval for a mean of 50, SD 10 and n 25?

The standard error is 10 ÷ √25 = 2. With 24 degrees of freedom the t value is 2.0639, so the margin is 2.0639 × 2 = 4.128 and the interval runs from 45.87 to 54.13.

Why use t instead of 1.96?

When the standard deviation is estimated from the sample, extra uncertainty is added, and the t distribution allows for it with wider intervals. With 25 values t is 2.064 rather than 1.96; with 8 values it is 2.365. For large samples the two converge.

What is the confidence interval for the mean of 2, 4, 4, 4, 5, 5, 7, 9?

The mean is 5, the sample SD 2.1381 and the standard error 0.7559. With 7 degrees of freedom t is 2.3646, so the margin is 1.787 and the 95 percent interval is 3.21 to 6.79.

How do I find a confidence interval for a proportion?

Use p̂ ± z × √(p̂(1 − p̂) ÷ n). For 40 percent in a sample of 400, the standard error is 2.449 points and the 95 percent margin is 1.96 × 2.449 = 4.80 points, giving 35.20 to 44.80 percent.

What does 95 percent confidence actually mean?

If the same study were repeated many times, about 95 percent of the intervals calculated would contain the true value. It does not mean there is a 95 percent probability that this particular interval contains it; the true value either is or is not inside.

How can I make a confidence interval narrower?

Collect a larger sample, since the margin shrinks with √n, or accept a lower confidence level. Quadrupling the sample halves the margin. Reducing measurement noise, which lowers the standard deviation, also narrows the interval.

Last reviewed September 28, 2026 by the CalculatorPeak editorial team.