Confidence Interval & Margin of Error Calculator

Compute 95% or custom-Z confidence interval bounds around a sample mean.

Margin of Error (±MoE) 1.607
Lower Confidence Bound 50.793
Upper Confidence Bound 54.007
Standard Error (SE) 0.82
Inputs
Try:
Observed sample mean (x̄).
Sample standard deviation (s).
Sample size (n).
Critical Z-value (1.645 for 90%, 1.96 for 95%, 2.576 for 99%).
Results & Graph
Margin of Error (±MoE)
1.607
Lower Confidence Bound
50.793
Upper Confidence Bound
54.007
Standard Error (SE)
0.82

Margin of Error (±MoE)

Graph 1 • How the inputs feed Confidence Interval
Confidence Interval & Margin of Error Calculator • Custom Domain Schematic (Inferential Statistics) Confidence Interval Response Sample Mean: 52.40 • Sample Std Dev: 8.20 MARGIN OF ERROR (±MOE) 1.607 • Lower Confidence Bound: 50.793 • Upper Confidence Bound: 54.007 Eq: CI = x̄ ± z × (s / √n)
Graph 2 • Margin of Error (±MoE) as Sample Mean changes (40% to 160% of current)
0 0.884 1.77 1.61 20.96 1.61 31.44 1.61 41.92 1.61 52.40 1.61 62.88 1.61 73.36 1.61 83.84
Graph 3 • Sample Mean and Sample Std Dev together Compares Margin of Error (±MoE) when Sample Std Dev is shifted +25% (solid) vs. −25% (dashed).
0 1.10 2.21 --- Sample Std Dev @ 75% 2.01 -30% 2.01 -15% 2.01 +0% 2.01 +15% 2.01 +30%
Summary: Confidence interval is [50.793, 54.007] with Standard Error = 0.82.
Summary: Confidence interval is [50.793, 54.007] with Standard Error = 0.82.
Interactive chart & math engine powered by CalculatorGraph

Formula: Confidence Interval Mathematical Identity

CI = x̄ ± z × (s / √n)
CI = x̄ ± z × (s / √n)
  • sampleMean: Sample Mean (numeric parameter)
  • sampleStdDev: Sample Std Dev (numeric parameter)
  • sampleSize: Sample Size (numeric parameter)
  • zCritical: Z Critical (numeric parameter)

Frequently Asked Questions

Why did doubling my sample size not halve the margin of error?

Because sample size sits under a square root. Doubling n divides the margin by about 1.41, not by 2. With the default SD of 8.2, going from 50 to 100 observations moves the margin from 2.273 to 1.607. To halve it you need four times the sample, which is why going from 25 to 100 cut the margin from 3.214 to 1.607.

Can I type a t critical value into the Z Critical box?

Yes, and for small samples you should. The box accepts any positive number and uses it as the multiplier. Look up the two-sided t value for n minus 1 degrees of freedom at your confidence level, such as 2.262 for 10 observations at 95 %, and type it in. The label still says Z, but the arithmetic is exactly the t interval.

What should go in the standard deviation box if I only have a standard error?

Multiply the standard error by the square root of the sample size to recover the standard deviation, then enter that. If you enter the standard error itself, the calculator divides it again and the margin comes out far too small. Setting the sample size to 1 is not a workaround here, because the calculator requires at least 2 observations.

Does the interval assume my data are normally distributed?

Not strictly. For large samples, the sample mean is close to normal even when individual values are skewed, so the interval works reasonably well. With small samples and strongly skewed data, such as incomes or waiting times, the interval can be misleading in either direction. In that case a transformation or a resampling method is safer than this formula.

Why are my lower and upper bounds not symmetric after rounding?

They are symmetric before rounding. The page subtracts and adds the same margin to the mean, then rounds each bound to three decimals. Occasionally the last digit differs by one because of that rounding. With the default inputs the bounds are 50.793 and 54.007, each exactly 1.607 from 52.4, so the symmetry shows cleanly.

What confidence level does 2.576 correspond to?

It is the two-sided 99 % level for the normal distribution. On the default sample it gives a margin of 2.112 and an interval of 50.288 to 54.512, wider than the 95 % result. Other common values are 1.645 for 90 % and 1.96 for 95 %. For small samples, swap these for the matching t values.

Can two overlapping intervals still mean a real difference?

Yes. Two 95 % intervals can overlap slightly and the difference between the means can still be statistically significant, because the uncertainty of a difference is not the sum of the two margins. This calculator handles one mean at a time. To compare two groups properly, build an interval for the difference itself using both standard errors combined.

How do I pick a sample size for a target margin of error?

Rearrange the formula: n equals the critical value times the standard deviation divided by the target margin, all squared. With an SD of 8.2, a critical value of 1.96 and a target of about 1.6, that gives roughly 100, which matches the default. You need a guess at the SD before collecting data, usually from a pilot or earlier study.

Why does a sample size of 0 or 1 give an error?

Because an interval needs real data. A sample size of 0, 1, a negative number or a fraction returns an error asking for a whole number of 2 or more. No real interval can be built from fewer than two observations, because the sample standard deviation needs at least two values to measure any spread. Fix the count and the interval appears.

Is the margin of error the same as the standard error?

No. The standard error is the typical sampling wobble of the mean, 0.82 on the default inputs. The margin of error is that standard error multiplied by the critical value, 1.607 at 95 %. Some reports quote plus or minus one standard error, which is a much narrower band of roughly 68 % confidence, so always check which one is meant.

Reading the default interval of 50.793 to 54.007

The loaded example is a sample of 100 observations with a mean of 52.4 and a sample standard deviation of 8.2. With the critical value set to 1.96, the calculator returns a margin of error of 1.607 and a 95 % confidence interval running from 50.793 to 54.007.

There are three steps, and the page shows each one. First it divides the standard deviation by the square root of the sample size. The square root of 100 is 10, so the standard error is 8.2 divided by 10, which is 0.82. Then it multiplies that standard error by the critical value: 0.82 times 1.96 gives 1.607. Finally it subtracts and adds that margin to the sample mean.

The standard error is the line most people skip, and it is the most informative one. It tells you how much the sample mean itself would be expected to wobble if you drew a fresh sample of the same size from the same population. The margin of error is just that wobble stretched out to the confidence level you chose.

Why moving the mean leaves the margin untouched

Try the sample mean at 31, then at 79. The interval slides to 29.393 to 32.607 and then to 77.393 to 80.607, but the margin of error stays at 1.607 in both cases and the standard error stays at 0.82.

That is correct behaviour, not a bug. The width of the interval depends only on the spread of the data, the sample size and the confidence level. The mean decides where the interval sits, not how wide it is. If you are planning a study and want a particular precision, you can ignore the mean entirely and work with the other three inputs.

This also means a narrow interval says nothing about whether the mean is right. A biased sample with little spread gives a tight interval around the wrong value. The calculator measures random sampling error only. It cannot see a survey that only reached one kind of customer, or a scale that reads two grams heavy.

Sample size and the square-root penalty

Sample size enters under a square root, and that shapes every planning decision. Keep the default standard deviation of 8.2 and the critical value of 1.96, and change only n.

At 100 observations the margin is 1.607, as loaded. Drop to 50 and the standard error rises to 1.16 with a margin of 2.273. At 25 the standard error is 1.64 and the margin is 3.214, exactly twice the default. At 10 the standard error is 2.593 and the margin reaches 5.082.

The pattern is that halving the margin of error costs four times as many observations. Going from 25 to 100 halved it. Halving it again would need four times 100. Each extra observation buys less precision than the one before, which is why surveys and experiments tend to settle on sample sizes where the next improvement is no longer worth paying for.

Sample size must be a whole number of at least 2, and the calculator checks this. Enter 0, 1, a negative number or a fraction such as 2.5 and it asks for a whole-number sample size of 2 or more instead of producing an interval. Two is the floor because a sample standard deviation cannot be computed from a single observation.

Choosing the critical value for 90, 95 or 99 percent

The critical value box is where you choose the confidence level. The help text lists the three common choices, and it is worth seeing what each does to the default sample.

At 1.645, the 90 % level, the margin shrinks to 1.349 and the interval runs from 51.051 to 53.749. At 1.96, the 95 % level, it is the default 1.607 from the loaded example. At 2.576, the 99 % level, the margin grows to 2.112 and the interval widens to 50.288 to 54.512.

Higher confidence always costs width. A 99 % interval is about a third wider than a 95 % one on the same data, and a 90 % interval is about a sixth narrower. Pick the level before you see the data, based on how costly it would be to be wrong, and report it alongside the interval. An interval quoted without its confidence level is impossible to interpret.

The critical value must be positive, and a negative entry such as minus 1.96 is rejected with a reminder to use 1.96 for 95 % or the t value for small samples. If a negative number arrived from a lookup table or software, it is usually a left-tail value copied by mistake. Use its absolute size.

Small samples need a t value, not 1.96

The formula on this page is the z interval, and it quietly assumes the standard deviation is known or the sample is large. With a small sample, the sample standard deviation is itself uncertain, and the honest interval is wider. The fix is to replace the Z critical value with a value from the t distribution with n minus 1 degrees of freedom.

The calculator has no t option, but the box accepts any number, so you can type the t value in yourself. For a 95 % interval the two-sided t value is 2.776 at 4 degrees of freedom, 2.262 at 9, 2.064 at 24, and about 1.984 at 99.

The difference is large when the sample is small. With 10 observations and the default mean and SD, entering 1.96 gives a margin of 5.082. Entering the correct 2.262 gives 5.866 and an interval from 46.535 to 58.266. With only 5 observations, 1.96 gives 7.188 while the correct 2.776 gives 10.18. The honest margin there is about 40 % wider than the z version suggests.

At larger sizes the gap fades. With 25 observations the t version gives 3.385 against 3.214, and with 100 it gives 1.627 against the default 1.607 from the z value. A common rule of thumb is that from around 30 observations upward the z interval is close enough, though the t value is never wrong to use.

What a 95 percent interval does and does not promise

A 95 % confidence interval is a statement about the method. If you repeated the sampling many times and built an interval each time, about 95 out of every 100 of those intervals would contain the true population mean. Any single interval either contains it or does not.

It is not the range where 95 % of individual values fall. The default interval, 50.793 to 54.007, is barely three units wide, but individual observations are spread with an SD of 8.2. About 95 % of individuals would sit within roughly 16 units either side of the mean. Confusing the two is the most common reporting mistake with this kind of result.

There is a neat way to see the difference. Multiply the full standard deviation of 8.2 by 1.96 and you get about 16.07, the half-width that covers roughly 95 % of single values. Compare that with the margin of 1.607 for the mean of 100 observations, exactly one tenth as wide. Every observation you add narrows the uncertainty about the mean, but it does nothing to narrow the spread of individuals.

Using the page for a survey percentage

The calculator is built for means, but it can handle a simple proportion if you enter it the right way. Write the proportion as a decimal in the sample mean box. For the standard deviation, use the square root of p times one minus p.

For a poll where half of 100 respondents said yes, enter 0.5 as the mean, 0.5 as the standard deviation and 100 as the sample size. The result is a standard error of 0.05 and a margin of 0.098, so the interval runs from 0.402 to 0.598, or roughly plus or minus 10 percentage points.

This shortcut works when the sample is reasonably large and the proportion is not close to 0 or 1. For rare events, small samples or results near the extremes, a dedicated proportion interval will behave better. The page also applies no finite population correction, so if your sample covers a large share of a small population, the true margin is somewhat smaller than shown.

Checking inputs before you report the interval

Most wrong answers on this page come from the standard deviation box. Make sure it holds the standard deviation of individual observations, not a standard error copied from software output. If you paste in a standard error, the calculator divides it by the square root of n a second time and the interval comes out ten times too narrow at a sample of 100.

A standard deviation of zero returns a margin of 0 and an interval that collapses to the mean itself. That only happens if every observation is identical, which in real data usually means a column was filled with a constant by accident.

When you write the result up, give the mean, the interval, the confidence level and the sample size together, for example 52.4 with a 95 % interval of 50.793 to 54.007 from 100 observations. Say whether you used a z or a t critical value. A reader can then rebuild every number on this page from your sentence.