Confidence Interval Calculator

Confidence interval for the mean95.10 to 104.90
Margin of error±4.90
Standard error2.50
How this was calculated
  1. The standard error of the mean shrinks with the square root of the sample size: 15 ÷ sqrt(36) = 2.50.
  2. Margin of error = z × standard error = 1.96 × 2.50 = 4.90 for 95% confidence.
  3. Interval: 100.00 − 4.90 to 100.00 + 4.90, i.e. 95.10 to 104.90.
  4. Read it as a property of the method: intervals built this way capture the true mean in about 95% of repeated samples. This normal approximation assumes a reasonably large sample or roughly normal data.

A confidence interval is an estimate plus or minus a margin of error, where the margin of error equals z times the standard error. For a mean, the standard error is SD divided by the square root of n; for a proportion, it is the square root of p times 1 minus p, divided by n. This confidence interval calculator applies those formulas and returns the standard error, the margin of error, and the full interval. For example, a mean of 100 with SD 15 and n 36 at 95% confidence gives a standard error of 2.50, a margin of error of 4.90, and the interval 95.10 to 104.90. A proportion of 60% from n 400 at 95% confidence gives a margin of error of 4.80% and the interval 55.20% to 64.80%. Raising confidence widens the range: a mean of 50, SD 10, n 100 at 99% confidence, z 2.576, gives 47.42 to 52.58, wider than the 95% interval for the same data.

The method is the accepted standard because it is grounded in the normal distribution and follows the square-root law: quadrupling the sample size halves the interval width, which is why precision gets expensive. Strictly, a 95% interval is a property of the method, meaning 95% of intervals built this way capture the true value; in the frequentist reading, it is not a 95% probability that this particular interval contains it. The normal, or z, form assumes a large sample or roughly normal data; small samples should use the t distribution, and proportions near 0 or 1 need Wilson or exact intervals. This page shows the formula, step-by-step workings, worked examples, and sources.

Worked examples

A class average

Primary result: 95.10 to 104.90 — mean 100, SD 15, n = 36: a margin of error of ±4.90 at 95% confidence. (A mean (average) · 100 · 15 · 60 % · 36 · 95% (z = 1.960))

Confidence interval for the mean95.10 to 104.90
Margin of error±4.90
Standard error2.50

A survey percentage

Primary result: 55.20% to 64.80% — a headline 60% from 400 respondents really means somewhere in this band. (A proportion (percentage) · 100 · 15 · 60 % · 400 · 95% (z = 1.960))

Confidence interval for a proportion55.20% to 64.80%
Margin of error±4.80%
Standard error2.45%

Paying for 99% confidence

Primary result: 47.42 to 52.58 — the same data at 99% confidence widens the interval, the price of the extra certainty. (A mean (average) · 50 · 10 · 60 % · 100 · 99% (z = 2.576))

Confidence interval for the mean47.42 to 52.58
Margin of error±2.58
Standard error1.00

The formula, for means and proportions

The formula, for means and proportions

A confidence interval is estimate plus or minus margin of error, where the margin of error is z x standard error. The standard error depends on what you are estimating. For a mean, the standard error is SD / sqrt(n); for a proportion it is sqrt( p x (1 - p) / n ). The z value comes from the normal distribution and is set by your chosen confidence level: 1.645 for 90% confidence, 1.960 for 95%, and 2.576 for 99%. A confidence interval calculator applies these formulas behind the scenes, but seeing them spelled out helps you understand the result.

Consider a mean of 100, SD 15, n = 36 at 95% confidence. The standard error is 15 / sqrt(36) = 2.50. Multiply by z = 1.960 and the margin of error is 4.90, giving the interval 95.10 to 104.90. Now consider a proportion of 60% from n = 400 at 95% confidence. The standard error is sqrt( 0.60 x 0.40 / 400 ) = 0.0245, and the margin of error is 1.960 x 0.0245 = 0.0480, or 4.80%. The interval runs 55.20% to 64.80%. Notice how the proportion formula uses p both in p x (1 - p) and in the denominator through n, linking the estimate itself to its own uncertainty.

Raising the confidence level widens the interval because z grows. A mean of 50, SD 10, n = 100 at 99% confidence uses z = 2.576, yielding the interval 47.42 to 52.58 — wider than the 95% interval for the same data. You trade precision for certainty. Going from 95% to 99% does not shrink the range; it expands it, because you are demanding more coverage from the method.

Sample size matters too. Quadrupling the sample size halves the interval width; the square-root law is why precision gets expensive. Because n sits under a square root, each doubling of n shrinks the margin of error by a factor of sqrt(2), not by half. To halve the width you must multiply n by four, which often means far more time, money, or data collection effort for a modest gain in tightness.

Strictly, a 95% interval is a property of the method: 95% of intervals built this way capture the true value. In the frequentist reading it is not a 95% probability that this particular interval contains it. That distinction matters when you interpret results. Also note the limits of the z form. The normal (z) form assumes a large sample or roughly normal data; small samples should use the t distribution, and proportions near 0 or 1 need Wilson or exact intervals. Using z when t is appropriate understates your uncertainty, and using the normal approximation for extreme proportions can produce nonsensical boundaries.

The worked examples

A confidence interval is the estimate plus or minus the margin of error, where the margin of error is z times the standard error. This confidence interval calculator shows the standard error first, then the margin, so you can see where each number comes from.

First worked example: a mean of 100, SD 15, n = 36, at 95% confidence. The standard error for a mean is SD / sqrt(n), so 15 / sqrt(36) = 15 / 6 = 2.50. The z value for 95% confidence is 1.96, so the margin of error is 1.96 x 2.50 = 4.90. The interval is the estimate plus or minus that margin: 100 minus 4.90 = 95.10, and 100 plus 4.90 = 104.90. So the 95% confidence interval runs from 95.10 to 104.90.

Second worked example: a proportion of 60% from n = 400, at 95% confidence. The standard error for a proportion is sqrt(p x (1 - p) / n), so sqrt(0.60 x 0.40 / 400) = sqrt(0.24 / 400) = sqrt(0.0006) = 0.0245, or 2.45%. The margin of error is 1.96 x 2.45% = 4.80%. The interval is 60% minus 4.80% = 55.20%, and 60% plus 4.80% = 64.80%. So the 95% confidence interval runs from 55.20% to 64.80%.

Third worked example: a mean of 50, SD 10, n = 100, at 99% confidence, where z = 2.576. The standard error is 10 / sqrt(100) = 10 / 10 = 1.00. The margin of error is 2.576 x 1.00 = 2.58 (rounded). The interval is 50 minus 2.58 = 47.42, and 50 plus 2.58 = 52.58. So the 99% confidence interval runs from 47.42 to 52.58 — wider than the 95% interval for the same data, because a higher confidence level demands a larger margin of error.

  • Quadrupling the sample size halves the interval width; the square-root law is why precision gets expensive.
  • Strictly, a 95% interval is a property of the method: 95% of intervals built this way capture the true value. In the frequentist reading it is not a 95% probability that this particular interval contains it.
  • The normal (z) form assumes a large sample or roughly normal data; small samples should use the t distribution, and proportions near 0 or 1 need Wilson or exact intervals.

Interpreting the interval correctly

A confidence interval is estimate plus or minus margin of error, where the margin of error is z times the standard error. For a mean, the standard error is SD divided by the square root of n; for a proportion it is the square root of p times (1 minus p) divided by n. When you use a confidence interval calculator, you are applying a method whose long-run behavior is known, not producing a statement of probability about one specific interval.

The repeated-sampling meaning is what the word "confidence" refers to. Strictly, a 95% interval is a property of the method: 95% of intervals built this way capture the true value. In the frequentist reading it is not a 95% probability that this particular interval contains it. That distinction matters because once the interval is computed, it either does or does not contain the true value — there is no lingering probability. The common misreading is to say there is a 95% chance the true mean lies in 95.10 to 104.90. The correct statement is that the method produces intervals that cover the true value 95% of the time over many repetitions. The worked example of a mean of 100, SD of 15, and n of 36 at 95% confidence gives a standard error of 2.50, a margin of error of 4.90, and the interval 95.10 to 104.90. Another worked example: a proportion of 60% from n of 400 at 95% confidence gives a margin of error of 4.80% and the interval 55.20% to 64.80%.

The confidence level is a choice, and that choice has a price. A higher level produces a wider interval, because a larger z value widens the margin of error. The worked example of a mean of 50, SD of 10, and n of 100 at 99% confidence, where z equals 2.576, gives the interval 47.42 to 52.58 — wider than the 95% interval for the same data. You gain coverage by giving up precision. You can also narrow the interval by collecting more data, but the square-root law is why precision gets expensive: quadrupling the sample size halves the interval width. To cut the width in half again, you must quadruple once more.

The normal, or z, form used above assumes a large sample or roughly normal data. Small samples should use the t distribution, and proportions near 0 or 1 need Wilson or exact intervals. These refinements keep the repeated-sampling guarantee intact when the basic form would not.

A 95% interval is not a 95% probability that this one interval contains the true value. It means the method captures the true value in 95% of repeated uses.

When the z form is not enough

The normal (z) form assumes a large sample or roughly normal data, so it breaks down in three common situations. A confidence interval calculator that only applies the z form will give misleading results in each of these cases, so it is important to know when to switch to a different method.

First, small samples should use the t distribution instead of z. The t distribution is wider than the normal distribution, reflecting the extra uncertainty that comes from estimating the standard deviation from few observations. The worked example of a mean of 100, SD of 15, n = 36 at 95% confidence gives a standard error of 2.50, a margin of error of 4.90, and the interval 95.10 to 104.90. That example relies on the z form, but with smaller samples the t distribution produces wider intervals that better reflect the true uncertainty. As a practical matter, the t distribution approaches the normal distribution as the sample size grows, so the two methods converge for large samples.

Second, proportions near 0 or 1 need Wilson or exact intervals. The standard error for a proportion is the square root of p times (1 minus p) divided by n. When the sample proportion is close to 0 or 1, this standard error shrinks toward zero and the normal approximation becomes unreliable. A proportion of 60% from n = 400 at 95% confidence gives a margin of error of 4.80% and the interval 55.20% to 64.80%, which works well because 60% sits safely away from the edges. But a proportion of 2% from the same sample size would not work well with the z form, because the resulting interval could extend below zero, which is impossible for a proportion. Wilson intervals solve this by adjusting the center and width to stay within valid bounds.

Third, non-normal data can distort the results even with a reasonably large sample. The z form and the t form both assume the sampling distribution of the estimate is roughly normal. Heavily skewed data or data with extreme outliers may violate that assumption. In those cases, a transformation, a nonparametric method such as a bootstrap interval, or a larger sample may be needed before the interval can be trusted.

These limitations do not change what a confidence interval means. Strictly, a 95% interval is a property of the method: 95% of intervals built this way capture the true value. In the frequentist reading it is not a 95% probability that this particular interval contains it. Choosing the right method is what keeps that coverage claim honest.

FAQs

What is a confidence interval?

A confidence interval is an estimate plus or minus a margin of error, giving the range of values consistent with the sample at a chosen confidence level. It provides a bounded range that is likely to contain the true population parameter, rather than a single point estimate, helping you express the uncertainty in your sampling result.

What does 95% confidence actually mean?

95% confidence means that 95% of intervals constructed this way, over repeated samples, would contain the true value. It is a claim about the method, not about any single interval. If you repeated the same sampling process many times, roughly 95 out of 100 resulting intervals would capture the true population parameter.

Margin of error vs standard error — what is the difference?

The standard error measures sampling spread, reflecting how much your estimate varies from sample to sample. The margin of error is the standard error scaled by the z value for your confidence level. So the margin of error translates the standard error into a concrete range around your estimate, widening as you demand higher confidence.

Why is the 99% interval wider than the 95% one?

More confidence demands more room. The z value rises from 1.96 to 2.576 when moving from 95% to 99% confidence, so the same data supports a wider net. You are trading precision for certainty: the interval must expand to ensure that it captures the true value in a higher proportion of repeated samples.

When should I use t instead of z?

Use the t distribution for means from small samples, roughly under 30, when the standard deviation is estimated from the sample rather than known in advance. The t distribution accounts for the extra uncertainty introduced by estimating variability from limited data, producing wider and more accurate intervals than z would give.

How does sample size change the interval?

Width shrinks with 1 / sqrt(n), meaning increasing your sample size reduces the interval, but at a diminishing rate. Four times the data halves the width. This relationship shows that large gains in precision require disproportionately larger samples, so doubling your data does not halve the interval, only a fourfold increase does.

Sources

Related calculators

Sample Size Calculator (Surveys & Proportions)
How many responses a survey or A/B readout needs for a target margin of error — with the finite population correction when the audience is small.
Standard Deviation Calculator
Mean, sample and population standard deviation and variance for up to eight numbers — with the n versus n−1 difference explained.
Z-Score Calculator
The z-score of any value in a normal distribution, its percentile, and the share of values above and below it — the standardisation behind test scores and quality control.
Percentile Calculator
The percentile rank of a score in a normally distributed group — with the z-score and the share of the group scoring above you.