Statistics & Probability Confidence Intervals, Margin of Error & Sample Size Normal approximation with finite population correction

Margin of Error Calculator

The margin of error is the “plus or minus” attached to a survey result: the half-width of the confidence interval around your estimate. Enter your sample size, the percentage you measured (or the standard deviation, if you are estimating an average) and a confidence level, and this calculator returns the margin of error in percentage points, the critical z value, the standard error and both interval limits. Give it a population size as well and it applies the finite population correction, which matters whenever you have sampled more than about 5% of the people you care about.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
What are you estimating?Percentages use p(1−p) for the variance; averages use the standard deviation you supply.A percentage or proportion
Sample size (n)The number of completed responses or measurements, not the number of invitations sent.1000
Confidence level95% is the reporting convention for published polls.95%
Observed percentage (p)The share who answered the way you are reporting. Use 50% for the worst case if you do not know it yet.50 %
Standard deviation (σ or s)The spread of individual responses, in the units you measured. Not the standard error.15
Observed meanThe average you measured. It only shifts the interval limits; it does not change the margin of error.100
Population size (N)How many people or items the sample was drawn from. Leave at 0 to skip the finite population correction.0

It returns

  • Margin of error (±) — In percentage points when you are estimating a percentage; in your measurement units when estimating a mean.
  • Lower limit of the interval
  • Upper limit of the interval
  • Critical z value
  • Standard error (after correction)
  • Finite population correction factor — 1.000000 when no population size is supplied.

The formula

E=zp(1p)nNnN1
E=zσn

In plain text: E = z · √(p(1−p)/n) · √((N−n)/(N−1))

  • EMargin of error, in percentage points for a proportion
  • zNormal critical value for the confidence level (1.959964 at 95%)
  • pObserved proportion, as a decimal (decimal)
  • nSample size (count)
  • NPopulation size; the correction is omitted when N is unknown (count)

For a mean, replace √(p(1−p)/n) with σ/√n. The finite population correction factor equals 1 when the population is very large relative to the sample.

Updated Category Confidence Intervals, Margin of Error & Sample Size Verified against published test cases Reading time 9 min

What the margin of error measures, and what it ignores

The margin of error quantifies one thing only: the random variation that comes from surveying a sample instead of everyone. Draw a different random 1,000 people and you would get a different percentage. The margin of error says how far apart those percentages would typically land.

It says nothing about the other ways a survey goes wrong. A question worded to lead the respondent, a sampling frame that excludes people without landlines, a 4% response rate where the people who answered differ systematically from the people who did not — none of that appears in the formula. Those are non-sampling errors, they are usually larger than the sampling error in modern polling, and no amount of sample size reduces them. When a published poll says “±3 points”, that number is a floor on the uncertainty, not a bound on it.

The margin of error is also always attached to a confidence level. “±3.1 points” on its own is incomplete; “±3.1 points at 95% confidence” is the full statement. Raising the confidence level widens the margin, because you are demanding that the interval succeed more often. At the same sample size, moving from 95% to 99% multiplies the margin by 2.575829/1.959964 = 1.314.

Where the formula comes from

Every margin of error has the same shape: a critical value times a standard error. The critical value comes from the normal distribution and depends only on the confidence level. The standard error depends on how variable the thing you measured is, and on how many observations you took.

For a percentage, each respondent contributes a 0 or a 1, and the variance of that Bernoulli variable is p(1−p). Divide by n and take the square root and you have the standard error of the proportion. That product is largest at p = 0.5, where it equals 0.25, and it falls away symmetrically towards either boundary: at p = 0.1 it is 0.09, so the standard error is √(0.09/0.25) = 0.6 times its value at 50%. This is why survey planners who do not yet know the answer assume 50% — it is the worst case, and any other true value gives a narrower interval than promised.

For a mean, the variance you divide by n is the variance of the measurement itself, σ², so the standard error is σ/√n. The rest of the machinery is identical. If σ was estimated from the same sample rather than known, the strictly correct critical value comes from the t distribution rather than the normal; the confidence interval calculator handles that case, and the difference is negligible above a few hundred responses.

The finite population correction, √((N−n)/(N−1)), handles sampling without replacement from a population that is not effectively infinite. Sample everyone and it becomes zero: a census has no sampling error. Sample 5% of the population and it is √(0.95) ≈ 0.975, a 2.5% reduction that is usually not worth mentioning. Sample half and it is about 0.707, which cuts the margin of error by nearly a third — far too large to ignore.

Worked example: 1,000 respondents, 52% support

A national poll of 1,000 adults finds 52% support for a proposal, and you want the 95% margin of error. The population is 40 million, so the finite population correction is irrelevant.

  1. Convert the percentage. p = 0.52, so p(1−p) = 0.52 × 0.48 = 0.2496.
  2. Standard error. √(0.2496 / 1000) = √0.0002496 = 0.0157988, or 1.5799 percentage points.
  3. Critical value. At 95%, z = 1.959964.
  4. Margin of error. 1.959964 × 1.5799 = 3.0966 percentage points.
  5. Interval. 52 − 3.10 = 48.90% to 52 + 3.10 = 55.10%.

Report it as “52%, ±3.1 points at 95% confidence”. Note that the interval contains 50%, so this poll does not establish majority support.

Now change one thing: suppose the population is a professional body of 4,000 members rather than the whole country. The correction is √((4000−1000)/(4000−1)) = √(3000/3999) = √0.750188 = 0.866134, and the margin of error falls to 3.0966 × 0.866134 = 2.682 percentage points. Sampling a quarter of a population buys you a genuinely tighter estimate, and ignoring the correction here would overstate your uncertainty by 15%.

Reading a margin of error correctly

Apply it to each candidate or category separately, not to the gap between them. A 3-point margin on 52% and a 3-point margin on 48% does not mean the 4-point lead is “within the margin of error” in any simple sense. The margin of error on a difference between two shares of the same sample is roughly twice the margin on either one, because the two percentages move in opposite directions as the sample changes. Poll reporting gets this wrong constantly.

Watch for subgroup margins. A national poll of 1,000 that reports on 180 voters under 30 carries a margin of error on that subgroup of 1.959964 × √(0.25/180) × 100 = 7.30 points, not 3.10. Any crosstab shrinks n, and the margin grows as 1/√n.

Remember that halving the margin costs four times the sample. Going from ±3.1 to ±1.55 points at 95% means moving from 1,000 respondents to 4,000. That square-root relationship is the reason national polls cluster around 1,000 to 1,500 completes: it is the point where further spending buys very little precision.

Finally, a margin of error assumes a probability sample. Opt-in web panels, river samples and convenience samples do not satisfy that assumption, and reputable pollsters using them report a “credibility interval” or a modelled error estimate rather than a classical margin of error.

Margin of error at 95% confidence, by sample size and observed percentage

Values are z × √(p(1−p)/n) × 100 with z = 1.959964, in percentage points, with no finite population correction. The 50% column is the worst case for any n.
Sample sizep = 50%p = 30%p = 10%
1009.808.985.88
2506.205.683.72
3845.004.583.00
5004.384.022.63
1,0003.102.841.86
2,0002.192.011.31
5,0001.391.270.83
10,0000.980.900.59

At p = 50% the margin passes 5.00 points between n = 384 (5.0010) and n = 385 (4.9944). Cochran's formula solves to 384.15, so survey plans specify 385 respondents — the first sample size that is genuinely inside a 5-point target.

Common mistakes

  • Applying the whole-sample margin to a subgroup. The margin depends on the number of people in the cell being reported, not on the size of the survey.
  • Treating the margin as covering every kind of error. It covers random sampling variation only. Non-response bias, question wording and frame coverage sit entirely outside it.
  • Comparing two candidates by checking whether the gap exceeds one margin. The margin on a difference is larger than the margin on either share.
  • Forgetting the finite population correction on internal surveys. Surveying 200 of a company's 600 employees without correcting overstates the margin by a factor of 1/√(400/599) = 1.22.
  • Using the observed percentage when planning, then reporting as if 50% had been assumed. Plan with 50% for the worst case, but report with the percentage you actually observed.
  • Quoting a margin of error for a non-probability panel. The formula assumes every member of the population had a known, non-zero chance of selection.

Where this fits with sample size and interval calculators

The margin of error, the confidence interval and the required sample size are three views of one equation. This page fixes n and solves for E. The survey sample size calculator fixes E and solves for n, using Cochran's rearrangement of the same expression. The confidence interval for a proportion reports the same arithmetic as a pair of limits and offers the Wilson interval, which behaves far better than this normal approximation when p is close to 0 or 1.

For averages rather than percentages, use the confidence interval calculator for a mean, which applies the t distribution when your standard deviation is a sample estimate. If you are comparing two survey percentages — this month against last month, treatment against control — the right tool is the two-proportion z-test, which builds a standard error for the difference rather than for either share.

The finite population correction and the p(1−p) variance term both come from classical survey sampling theory as set out by Cochran; the American Association for Public Opinion Research publishes the disclosure standards that govern how a margin of error should be reported alongside a poll.

Frequently asked questions

What margin of error should I aim for?

Most published polls target about 3 percentage points at 95% confidence, which needs roughly 1,000 completed responses at p = 50%. Market research often accepts 5 points (about 385 responses), and internal pulse surveys frequently live with 8 to 10 points. Choose by asking what size of shift would change your decision, then make the margin smaller than that shift.

Why is 50% used as the default percentage?

Because p(1−p) is largest there, so it produces the widest margin of error for any given sample size. Planning with 50% guarantees your survey will meet or beat the precision you promised, whatever the answer turns out to be. Once you have data, use the percentage you actually observed — at p = 10% the margin is only 0.6 times the p = 50% figure.

Does population size affect the margin of error?

Barely, unless your sample is a large fraction of it. The finite population correction is √((N−n)/(N−1)), which is 0.9975 when you sample 0.5% of a population and 0.975 when you sample 5%. That is why a poll of 1,000 works about as well for a country of 5 million as for one of 300 million. The correction only becomes important above roughly 5% coverage, and it matters a great deal for internal surveys of small populations.

How do I get the margin of error on the difference between two candidates?

Not by doubling the individual margin, though that is a workable rule of thumb. For two shares of the same sample the standard error of the difference is √((p₁ + p₂ − (p₁−p₂)²)/n), which for two shares near 50% works out close to twice the individual standard error. For two independent samples, use the two-proportion z-test calculator instead.

Can the margin of error be zero?

Only in two situations, and one of them is an artefact. If you surveyed the entire population, the finite population correction is exactly zero and there is genuinely no sampling error left. If the observed percentage is exactly 0% or 100%, the estimated variance p(1−p) is zero and this formula returns zero — but that is a failure of the normal approximation, not a real result. Use an exact Clopper-Pearson binomial interval at the boundaries.

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

No. The standard error is the standard deviation of the sampling distribution; the margin of error is the standard error multiplied by a critical value chosen for your confidence level. At 95% the multiplier is 1.959964, so the margin is nearly twice the standard error. Quoting one when you mean the other understates or overstates the uncertainty by that factor.

Does a higher response rate reduce the margin of error?

Only through the number of completed responses that end up in the denominator. A survey with 1,000 completes has the same margin of error whether those came from 2,000 invitations or 50,000. What a low response rate threatens is bias, not sampling variance: if the people who responded differ systematically from those who did not, the estimate is off centre and the margin of error will not tell you.

Why do subgroup results have bigger margins?

Because the margin depends on the number of respondents in that subgroup, and it grows as 1 over the square root of that count. In a 1,000-person poll, a subgroup of 180 carries a 95% margin of 1.959964 × √(0.25/180) × 100 = 7.30 points instead of 3.10. Crosstabs with a few dozen respondents are usually too imprecise to support any claim at all.

References