Confidence Interval Calculator

Choose the kind of estimate, then enter the sample figures and the confidence level. You get the interval, the critical value and the margin of error, plus a table for other levels or for both proportion methods.

Free Runs in your browser Checked Tuesday, November 10, 2026

Any value above 0% and below 100%. The usual choices are 90%, 95% and 99%.

The average of the sample.

The standard deviation computed from the sample.

The number of observations. The t interval needs at least 2.

Result

Confidence interval — The lower and upper limits at the chosen level.
Lower limit — For a mean.
Upper limit — For a mean.
Margin of error — Half the width of the interval, for a mean.
Sample mean — The estimate at the centre of the interval.
Sample proportion p̂ — Successes divided by trials.
Lower limit — For a proportion.
Upper limit — For a proportion.
Critical value — z for the normal distribution, or t with n − 1 degrees of freedom.
Other levels, or both proportion methods

How it is worked out

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Choose Estimate: a mean with σ known (z) or with the sample SD (t), or a proportion by the Wald or Wilson method.
  2. Type the Confidence level, for example 95%.
  3. For a mean, type the Sample mean x̄, the Sample size n and either the Population standard deviation σ or the Sample standard deviation s. For a proportion, type the Successes x and the Trials n.
  4. Read Confidence interval, then How it is worked out. The table compares other levels, or both proportion methods.

Intervals for a mean

A confidence interval for a mean is the sample mean plus or minus a critical value times the standard error. When the population standard deviation σ is known, the standard error is σ ÷ √n and the critical value is z, the point of the standard normal distribution with (1 + C) ÷ 2 below it. When only the sample standard deviation s is known, the standard error is s ÷ √n and the critical value is t with n − 1 degrees of freedom. The t distribution has heavier tails, so its interval is a little wider, which matters most for small samples.

Use the t interval whenever σ is not known. From about 30 observations on, the t and z values are close, so the two intervals almost agree.

z interval: x̄ ± z × σ ÷ √n
t interval: x̄ ± t × s ÷ √n, with n − 1 degrees of freedom
z = Φ⁻¹((1 + C) ÷ 2)

Intervals for a proportion

The Wald interval is p̂ ± z √(p̂ (1 − p̂) ÷ n), where p̂ = x ÷ n. It is simple but works poorly for small samples and for proportions near 0% or 100%: its limits can fall below 0% or above 100%, and when all or none of the trials succeed it has zero width.

The Wilson score interval, published by Edwin B. Wilson in 1927, centres the estimate on a weighted value and always stays between 0% and 100%. Brown, Cai and DasGupta (2001) compared the two and recommend the Wilson interval over the Wald interval for most sample sizes.

Wald: p̂ ± z √(p̂ (1 − p̂) ÷ n)
Wilson: [p̂ + z² ÷ (2n) ± z √(p̂ (1 − p̂) ÷ n + z² ÷ (4n²))] ÷ (1 + z² ÷ n)

What the calculator does not cover

  • Samples that were not drawn at random, and complex surveys with weights, clusters or a design effect.
  • A finite population correction for a sample that is a large share of its population.
  • Comparisons of two means or two proportions, which need a different interval. To plan the number of observations, use the sample size calculator.

Worked examples: a mean and a proportion at 95%

A sample of 25 with mean 50 and standard deviation 10 gives t = 2.063899 and SE = 10 ÷ √25 = 2.0000, so the margin is 4.1278 and the interval is 45.8722 to 54.1278.

For 56 successes in 100 trials, the Wald interval is 46.27% to 65.73% and the Wilson interval is 46.23% to 65.33%.

Method Lower limit Upper limit
Wald 46.27% 65.73%
Wilson 46.23% 65.33%

Frequently asked questions

What does a 95% confidence interval mean?

It is a range built by a method that contains the true value in about 95 of every 100 samples drawn the same way. It does not mean that one particular interval has a 95% chance of containing the true value.

When should I use the z interval and when the t interval?

Use z only when the population standard deviation σ is known, which is rare. In practice the sample standard deviation is used, and the t interval is the right choice for any sample of at least 2 observations.

Why is the Wilson interval better than the Wald interval?

The Wald interval estimates its own spread from the sample proportion, which fails for small samples and for proportions near 0 or 1. The Wilson interval stays within 0% and 100%, and its actual coverage is much closer to the stated level.

Which confidence level should I choose?

95% is the most common choice. A higher level such as 99% gives a wider interval and a lower one such as 90% a narrower one. The level is a decision about how sure you want to be, not a property of the data.

How many observations do I need for a given margin of error?

Use the sample size calculator. For a proportion, the required sample depends on the margin of error, the confidence level and the expected proportion.

Does the calculator send my numbers anywhere?

No. The calculation runs in your browser, and nothing you type is sent to our servers.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.