Confidence interval calculator

Find the confidence interval for a mean or a proportion, with the margin of error, critical value and every step of the working.

  • Free, no sign-up
  • Step-by-step working
  • Runs in your browser
What are you estimating?
Your data

Separate values with commas, spaces or new lines. You can paste a column from Excel or Google Sheets.

How to use the confidence interval calculator

  1. Choose whether you're estimating a mean (an average, like test scores or weights) or a proportion (a share, like the percentage of voters who agree).
  2. For a mean, enter the sample mean, standard deviation and sample size, or switch to Raw data and paste your values. For a proportion, enter the number of successes and the sample size.
  3. Pick a confidence level. 95% is the usual choice; 90% gives a narrower interval and 99% a wider one.
  4. Click Calculate interval to see the interval, the margin of error and each step of the working.
  5. Download the chart if you need it for a report or assignment.

Confidence interval formulas

Every confidence interval has the same shape: a point estimate, plus and minus a margin of error. The margin of error is a critical value times the standard error.

Mean, σ unknown: x ± t* × sn

Mean, σ known: x ± z* × σn

Proportion: p ± z* × p(1 − p)n

x
The sample mean
p
The sample proportion: successes divided by the sample size, x / n
s
The sample standard deviation
σ
The population standard deviation, when it is known
n
The sample size
t*
The critical value from the t distribution with n − 1 degrees of freedom, leaving (1 − confidence) / 2 in each tail
z*
The critical value from the standard normal distribution, e.g. 1.960 for 95%

Critical values for common confidence levels

Confidence levelz*t* (df = 10)t* (df = 30)
80%1.2821.3721.310
90%1.6451.8121.697
95%1.9602.2282.042
98%2.3262.7642.457
99%2.5763.1692.750

As the degrees of freedom grow, t* gets closer to z*. The calculator works out the exact value for your sample size.

Worked example

A teacher samples 30 students and finds a mean exam score of 72.4 with a standard deviation of 8.5. What is the 95% confidence interval for the mean score of all students?

  1. σ is unknown, so use t with n − 1 degrees of freedom
    df = 30 − 1 = 29
  2. Find the critical value that leaves 2.5% in each tail
    t* = t0.975, 29 = 2.0452
  3. Standard error of the mean
    SE = 8.530 = 1.5519
  4. Margin of error
    ME = 2.0452 × 1.5519 = 3.1740
  5. Add and subtract it from the mean
    72.4 ± 3.1740 = 69.23 to 75.57

What it means: the teacher can be 95% confident that the average score for all students is between about 69.2 and 75.6. The interval is fairly narrow because 30 students is a reasonable sample and the scores don't vary wildly.

How to interpret a confidence interval

A confidence interval gives a range of plausible values for a population value you can't measure directly. Report it alongside the point estimate, for example "mean 72.4, 95% CI 69.2 to 75.6".

  • The confidence level is about the method. Repeat the study many times and about 95% of the 95% intervals would capture the true value. It is not a 95% chance that this particular interval is right.
  • Width tells you precision. A narrow interval means a precise estimate. A wide one means you need more data before drawing firm conclusions.
  • Higher confidence means a wider interval. A 99% interval is wider than a 95% interval from the same data, because it has to capture the true value more often.
  • It does not describe individual values. A confidence interval for the mean says where the average is likely to be, not where 95% of individual observations fall.

Confidence intervals and hypothesis tests are two views of the same evidence. If a reference value falls outside a 95% interval, a two-tailed t-test against that value would be significant at α = 0.05.

Frequently asked questions

What does a 95% confidence interval actually mean?

It describes the method, not one particular interval. If you took many random samples and built a 95% interval from each one, about 95% of those intervals would contain the true population value. For a single interval, the true value is either inside it or not; "95% confident" is shorthand for having used a method that works 95% of the time.

Should I use the t or z distribution?

For a mean, use t when you estimate the standard deviation from the sample itself, which is almost always the case in practice. Use z only when the population standard deviation σ is genuinely known. For a proportion, the standard interval uses z. With large samples (n above about 100), t and z give nearly identical intervals.

How can I make a confidence interval narrower?

Collect a larger sample, or accept a lower confidence level. The width shrinks with the square root of the sample size, so halving the margin of error needs about four times as many observations. Reducing measurement noise (a smaller standard deviation) also helps. Use the sample size calculator to plan for a target margin of error.

What is the difference between a confidence interval and a margin of error?

The margin of error is half the width of the confidence interval. The interval is the point estimate plus and minus the margin of error. A poll that reports "52% ± 3 points" has the confidence interval 49% to 55%.

What does it mean if the confidence interval includes zero?

For a difference or an effect, an interval that includes zero means the data are consistent with no effect at that confidence level. A 95% interval that excludes zero matches a two-tailed test that is significant at α = 0.05. For a single mean, compare the interval with whatever reference value you care about instead.

When is the proportion interval not accurate?

The standard (Wald) interval relies on a normal approximation. It works well when you have at least 10 successes and 10 failures. With fewer, or with proportions close to 0% or 100%, the interval can be too narrow, and a Wilson or exact (Clopper-Pearson) interval is a better choice. The calculator warns you when this applies.

Last reviewed November 10, 2026