HomeDescriptive StatisticsMargin of Error Calculator - Survey, Mean & Sample Size

Margin of Error Calculator – Survey, Mean & Sample Size

Margin of Error Calculator - Survey, Mean & Sample Size

Margin of Error Calculator

Work out the margin of error for a survey percentage or a mean, run it backwards from a confidence interval, or find the sample size you need to hit a target. Includes the finite population correction, the Wilson interval for small percentages, and the design effect for cluster samples.

0. Quick Answer

The margin of error is half the width of a confidence interval. It is the plus-or-minus figure you see after a poll result, and it answers one question: how far from the true value could this estimate plausibly be, given that you surveyed a sample rather than everybody?

📊 For a percentage (surveys, polls)

MOE = z × √[ p(1−p) / n ]

A poll of 1,000 people showing 50% support has a margin of error of ±3.10 percentage points at 95% confidence. That is where the familiar "plus or minus three points" comes from.

📏 For an average (measurements)

MOE = t × (s / √n)

Use t rather than z because you estimated the standard deviation from your data. A sample of 12 with a mean of 53.17 and an SD of 5.67 gives a margin of error of ±3.60.

Already have a confidence interval? Then the margin of error is simply half its width: MOE = (upper − lower) ÷ 2. An interval of 49.56 to 56.77 has a margin of error of 3.60. The From a confidence interval tab does this and recovers the standard error and sample size too.

Key takeaways

  • Margin of error scales with the square root of n. To halve it you must quadruple your sample. Going from 1,000 to 2,000 respondents only improves ±3.10 to ±2.19.
  • Population size barely matters. A sample of 1,000 gives roughly ±3% whether the population is 50,000 or 50 million. This surprises almost everyone, and it is why national polls are not enormous.
  • Use p = 0.5 when you do not know the proportion. That is the worst case and gives the widest margin, which is why survey firms quote it before fieldwork begins.
  • The three numbers worth memorising: at 95% confidence you need about 385 people for ±5%, 1,068 for ±3% and 9,604 for ±1%.
  • The quoted margin of error covers sampling error only. It says nothing about biased question wording, people who refused to answer, or a sampling frame that missed part of the population. Those are usually the larger problems.
  • For percentages near 0% or 100% the standard formula breaks. At 2 out of 100 it produces a negative lower bound. Use the Wilson interval instead, which this calculator reports automatically.

📚 1. What Is the Margin of Error?

1.1 The idea in one paragraph

You want to know what a whole population thinks, but you can only afford to ask some of them. Whatever number your sample returns will be a little off, purely because you happened to ask these particular people rather than a different set. The margin of error quantifies how far off it could plausibly be. Ask more people and it shrinks; ask fewer and it grows.

1.2 Its exact relationship to the confidence interval

The margin of error and the confidence interval are the same information written two ways:

confidence interval = estimate ± margin of error

So if a poll reports 52% with a margin of error of 3 points, the 95% confidence interval is 49% to 55%. Going the other way, if a paper reports an interval of 49% to 55%, the margin of error is (55 − 49) ÷ 2 = 3 points. Neither contains information the other lacks, which is why you can always convert between them.

1.3 What "95% confidence" actually means

It does not mean there is a 95% probability that the true value lies in this particular interval. The true value is a fixed number; it is either in there or it is not. What it means is that the procedure works 95% of the time: if you repeated the whole survey many times and built an interval each time, about 95 out of every 100 of those intervals would contain the true value.

In practice most people treat it as "we are fairly confident the truth is in this range", which is close enough for everyday use. The distinction matters when you start making probability statements about a specific interval, which is a Bayesian claim requiring different machinery.

1.4 The three levers

What you changeEffect on the margin of errorHow much
Increase the sample sizeShrinks itBy the square root. Quadrupling n halves the margin
Raise the confidence levelWidens it90% uses z = 1.645, 95% uses 1.960, 99% uses 2.576
Move the proportion away from 50%Shrinks itp = 0.5 is the worst case. At p = 0.1 the margin is 40% smaller
Increase the population sizeAlmost nothingOnly matters when your sample is a large fraction of the population

That last row is the counterintuitive one. Once the population is large relative to the sample, its exact size drops out of the arithmetic almost entirely. A sample of 1,000 gives a margin of about 3.1 points whether you are surveying a city of 50,000 or a country of 50 million. What matters is how many people you asked, not what fraction of the population they represent.

1.5 When population size does matter

If your sample is more than about 5% of the population, the finite population correction kicks in and shrinks the margin, because you are getting closer to a census. Surveying 1,000 people out of 5,000 gives ±2.77% rather than ±3.10%. Surveying 4,900 out of 5,000 gives a margin near zero, which is correct: you have nearly asked everybody.

FPC = √[ (N − n) / (N − 1) ]

This is why an internal survey of a 200-person company needs far fewer responses than a national poll to reach the same precision.

1.6 What the margin of error does not cover

This is the most important paragraph on the page. The quoted margin of error accounts for random sampling error only. It assumes you drew a genuine random sample from exactly the population you meant to study, that everyone responded, and that they answered honestly and understood the question.

In real surveys the larger errors are usually elsewhere: people who could not be reached, people who refused, a sampling frame that excluded part of the population, leading question wording, and the choices made when weighting the data. None of these appear in the ± figure. A poll with a stated margin of ±3 points can easily be off by considerably more, and historically most large polling misses have come from these sources rather than from sampling error.

🧮 2. Set Up Your Calculation

One column is loaded by default. Press Add cluster to compare groups.
Applies the finite population correction when your sample is a large share of it.
📁 Or upload a CSV / Excel file
Supports .csv, .txt, .xlsx and .xls. Every column you click becomes its own cluster.

The classic survey case. Enter the percentage your sample reported and how many people you asked.

Enter 52 or 0.52, both work. Leave at 50 for the worst case if you do not know it yet.
The number of people who actually answered, not the number invited.
Only matters if your sample is more than about 5% of the population.
1 for simple random sampling. Cluster or multistage designs typically run 1.5 to 3.

If you only have the published summary statistics, enter them here. This is the usual situation when checking a figure in a paper or a report.

Use t unless you truly know the population standard deviation. Below n = 30 the difference is substantial.

Work backwards from a published interval. The margin of error is half its width, and the calculator also recovers the point estimate, the standard error and the sample size that must have produced it.

Supply n and the calculator works back to the standard error and standard deviation.

The planning calculation. Tell it how precise you need to be, and it tells you how many responses to collect.

In percentage points. Enter 3 for ±3%.
Leave at 50 for the safest, largest estimate.
The tool will tell you how many people to invite to end up with enough responses.

📊 3. Results

Enter your numbers above and press Calculate Margin of Error. The margin, the confidence interval, the sample size trade-off, charts and reporting sentences will appear here.

🧠 4. Interpretation of Results, In Detail

Run the calculator to fill this section with your own numbers. The ten sub-sections below explain every part of the output.

4.1 What the plus-or-minus figure is claiming

When a poll reports 52% with a margin of error of 3 points, it is saying that the procedure used would capture the true population figure about 95 times out of 100, and that on this occasion it produced the range 49% to 55%. The true value is a fixed number, not a random one; what varies from survey to survey is the interval.

The practical reading is: the truth is plausibly anywhere between 49% and 55%, and values near the middle are more likely than values near the edges. That last point is often forgotten. The interval is not a uniform band where every value is equally credible; the estimate at the centre is the single most likely value and the plausibility falls away towards the limits.

4.2 The square root law, and why precision is expensive

The margin of error is proportional to one over the square root of n. This has consequences that surprise people who expect a linear relationship:

  • Doubling your sample improves the margin by only about 29%, not 50%.
  • To halve the margin you must quadruple the sample.
  • Going from 1,000 to 2,000 respondents takes you from ±3.10% to ±2.19%. Going from 1,000 to 4,000 takes you to ±1.55%.
  • The first few hundred responses buy you enormous precision; the next few thousand buy comparatively little.

This is why professional surveys cluster around 1,000 to 1,500 respondents. That is roughly where the curve flattens and additional fieldwork stops being worth the money.

4.3 Why the population size hardly matters

Almost everyone assumes a bigger population needs a bigger sample. It does not. A sample of 1,000 gives a margin of about ±3.1 points whether the population is 50,000 or 50 million, and the formula shows why: N does not appear in it at all unless the sample is a large fraction of the population.

The intuition is that you are measuring the composition of the population, not counting it. A well-stirred pot needs one spoonful to taste, whether the pot holds a litre or a hundred litres. What matters is that the stirring was thorough, which in survey terms means the sample was genuinely random.

The exception is when your sample is a meaningful share of the population, say above 5%. Then the finite population correction reduces the margin, because each person you sample removes some of the remaining uncertainty. Survey 1,000 out of 5,000 and the margin falls from 3.10% to 2.77%. Survey 4,900 out of 5,000 and it collapses to almost nothing, correctly: you have nearly conducted a census.

4.4 Why p = 0.5 is the worst case

The quantity p(1 − p) is largest at p = 0.5, where it equals 0.25, and it falls away symmetrically towards both extremes. At p = 0.1 it is 0.09, and the margin is about 40% smaller than at 50%.

This is why survey firms quote their headline margin at 50%: it is the widest the margin can be, so no result in the survey can be less precise than the quoted figure. It also means the margin reported for a whole survey applies exactly only to questions where the split is near even. A question where 90% agreed has a substantially tighter margin than the headline suggests.

4.5 Comparing two numbers, and the mistake journalists make

Suppose a poll with a margin of ±3 points shows Candidate A on 48% and Candidate B on 45%. Is A ahead? Almost certainly not in any statistically meaningful sense.

The margin applies to each estimate separately, and the difference between two estimates carries more uncertainty than either one alone. As a rough rule, the gap must exceed about twice the margin of error before you can be reasonably confident it is real. With a ±3 point margin, a 3-point lead is well inside the noise. Describing it as a lead, or worse as a "narrowing" lead compared with last month, is reading structure into randomness.

For proportions from the same survey the correct calculation is slightly more forgiving than doubling, because the two shares are negatively correlated, but doubling is a safe and simple heuristic that will keep you out of trouble.

4.6 When the standard formula breaks down

The usual formula is a normal approximation, and it fails when the percentage is close to 0% or 100%. Take 2 out of 100: the formula gives a margin of 2.74 points and an interval of −0.74% to 4.74%. A negative percentage is impossible, which tells you the method has broken.

Worse, at exactly 0 out of 50 the formula gives a margin of exactly zero, implying perfect certainty that nobody in the entire population holds that view, on the basis of 50 interviews. That is obviously absurd.

The Wilson score interval solves both problems. It is derived by inverting the test rather than approximating the estimate, cannot produce impossible values, and performs better than the standard interval at essentially all sample sizes. For 2 out of 100 it gives 0.55% to 7.00%, which is both possible and sensible. This calculator reports it alongside the standard interval every time, and where the two disagree you should use Wilson.

4.7 t or z, and why it matters for means

For a percentage the calculator uses z, the normal critical value. For a mean it uses t, because you almost always estimated the standard deviation from the same sample you are describing, and that estimate carries its own uncertainty.

The difference is largest at small n. At n = 5 the t critical value is 2.776 against the normal 1.960, so the margin is 42% wider. At n = 30 it is 2.045, only 4% wider. By n = 100 the gap is under 1%. Using z with a small sample understates your uncertainty, which is the more dangerous direction to err.

4.8 The design effect, for anything other than simple random sampling

The standard formula assumes every member of the population had an equal, independent chance of selection. Real surveys rarely work that way. They cluster by household, school, village or postcode, because sending an interviewer to one street is far cheaper than sending them to thirty scattered addresses.

Clustering costs precision, because people in the same cluster resemble each other, so each additional interview within a cluster adds less new information. The design effect quantifies that loss. A design effect of 2 means your survey carries the same sampling error as a simple random sample of half the size, so 1,000 clustered interviews behave like 500 independent ones. Typical values run from 1.5 to 3. Ignoring it will make your reported margin look considerably better than it is.

4.9 Reading the four charts

Chart 1 draws your interval with the estimate marked, which is the quickest way to see whether it crosses a threshold you care about. Chart 2 plots the margin against sample size and shows the square root law directly: the curve is steep at the left and almost flat by the right. Chart 3 shows how the margin varies with the percentage, peaking at 50%. Chart 4 shows what raising your confidence level costs you in precision.

Chart 2 is the one worth showing a client who is asking for a tighter number. It makes the cost of precision visible in a way that a table of figures does not.

4.10 The limitation that matters most

Everything on this page addresses random sampling error: the fact that you asked some people rather than all of them. It assumes you drew a genuine random sample from exactly the population you meant to study, that everybody responded, and that they understood and answered honestly.

Real surveys fail these assumptions routinely. Response rates for telephone polling have fallen into the single digits in many countries, and the people who still answer are not a random subset of those who do not. Online panels over-represent the engaged. Question wording nudges answers. Weighting corrects some of this and introduces assumptions of its own.

None of that appears in the ± figure. The margin of error is a statement about arithmetic under ideal conditions, and it should be read as a lower bound on your total uncertainty rather than a full accounting of it. When large surveys have been badly wrong, the failure has almost always been here rather than in the sampling error.

5. How to Write Your Results in Research

▶ Run the analysis above to auto-fill all five examples with your results.

Example 1, Full Sentence for a Report
Run the calculator to generate this sentence from your data.
📌 Key conventions for this style
  • Always state the confidence level. A margin of error without one is meaningless.
  • Give the sample size, because readers cannot judge precision without it.
  • Use "percentage points" not "percent" for a margin on a percentage. A 3-point margin on 52% is not 3% of 52.
  • Report the interval as well as the margin. They carry the same information but readers differ in which they find clearer.
Example 2, Compact Inline Format
Run the calculator to generate this snippet.
📌 Key conventions for this style
  • For tables, figure captions and parenthetical use.
  • Keep the confidence level and n even when compressing.
  • Define the format once in a footnote and use it consistently throughout.
Example 3, Plain-Language Summary
Run the calculator to generate this summary.
📌 Key conventions for this style
  • Avoid "margin of error", "confidence interval" and "statistically significant" entirely.
  • "Probably between X and Y" is honest and understood by everyone.
  • Never present a single number as if it were exact.
  • Resist describing differences smaller than twice the margin as real.
Example 4, Methods Note
Run the calculator to generate this methods note.
📌 Key conventions for this style
  • State the formula, the critical value and any corrections applied.
  • Declare the design effect if the sample was not a simple random sample.
  • Say explicitly that the margin excludes non-sampling error. Reviewers and standards bodies expect this.
  • The AAPOR transparency initiative asks for the sampling frame, the response rate and the weighting scheme alongside the margin.
Example 5, Precision and Trade-Off Statement
Run the calculator to generate this statement.
📌 Key conventions for this style
  • Useful in a proposal, where the client wants to know what more money would buy.
  • Quantify the square root law rather than describing it: give the actual n for a halved margin.
  • Note that reducing the standard deviation through better measurement is often cheaper than increasing n.
  • For subgroup analysis, warn that a subgroup of a quarter the size has double the margin.

6. Formulas Used

Margin of Error for a Proportion
MOE = z × √[ p(1 − p) / n ]
pThe sample proportion, as a decimal. 52% becomes 0.52
nThe number of completed responses, not the number invited
z1.645 at 90%, 1.960 at 95%, 2.576 at 99% confidence
Worst casep = 0.5 maximises p(1−p) at 0.25 and gives the widest margin
NoteThe population size does not appear. This is not an oversight
Margin of Error for a Mean
MOE = tα/2, n−1 × (s / √n)
s / √nThe standard error of the mean
tUse t, not z, because s was estimated from the sample
dfn − 1 degrees of freedom
n = 5t = 2.776, which is 42% wider than the normal 1.960
n = 100t = 1.984, essentially the same as z
Margin of Error from a Confidence Interval
MOE = (upper − lower) ÷ 2  ·  estimate = (upper + lower) ÷ 2
WhyA symmetric interval is by construction estimate ± margin
Example49.564 to 56.769 gives a margin of 3.603 around 53.167
Recovering SESE = MOE ÷ critical value, if you know n
Recovering ss = SE × √n
Fails forAsymmetric intervals: Wilson, bootstrap, odds ratios
Finite Population Correction
FPC = √[ (N − n) / (N − 1) ]  ·  MOEadj = MOE × FPC
NThe population size
Apply whenn is more than about 5% of N. Below that it barely changes anything
n = 1000, N = 5000FPC = 0.8945, cutting the margin from 3.10% to 2.77%
n = NFPC = 0. A census has no sampling error
Sample Size for a Target Margin
n = z² × p(1 − p) ÷ MOE²  ·  n = z² × s² ÷ MOE²
First formFor a proportion. Second form for a mean
±5%n = 385 at 95% confidence with p = 0.5
±3%n = 1,068
±1%n = 9,604
Finite populationnadj = n / [1 + (n − 1)/N]
AlwaysRound up. You cannot interview 0.7 of a person
Wilson Score Interval, for Percentages Near 0 or 100
centre = (p + z²/2n) ÷ (1 + z²/n)
half-width = z√[ p(1−p)/n + z²/4n² ] ÷ (1 + z²/n)
WhyThe standard interval can run below 0% or above 100%. Wilson cannot
2 out of 100Standard gives −0.74% to 4.74%. Wilson gives 0.55% to 7.00%
0 out of 50Standard gives zero width. Wilson gives 0% to 7.13%
AsymmetricNot centred on p, so it has no single margin of error
Use it whenn is small, or p is below about 10% or above 90%
Design Effect, for Cluster and Multistage Samples
MOEadj = MOE × √DEFF  ·  neffective = n ÷ DEFF
DEFF = 1Simple random sampling. The standard formula applies unchanged
DEFF = 21,000 clustered interviews behave like 500 independent ones
Typical1.5 to 3 for household cluster surveys
DEFF = 1 + (m−1)ρm is the cluster size, ρ the intraclass correlation
Sample sizeMultiply the required n by DEFF
Margin of Error for a Difference Between Two Groups
MOEdiff = z × √[ p₁(1−p₁)/n₁ + p₂(1−p₂)/n₂ ]
Why it mattersThe difference between two estimates is less precise than either one
Rule of thumbA gap must exceed roughly twice the individual margin to be meaningful
Same surveyShares of the same total are negatively correlated, so the true margin is a little smaller than this
Common errorCalling a 3-point lead real when the margin is ±3 points

📝 7. How to Use This Calculator

  1. Paste your numbers into the data column. Mean from raw data opens first, with one column ready to go. Enter your values comma-separated exactly as the placeholder shows, and the calculator works out the mean, standard deviation, standard error and degrees of freedom, then applies the t critical value because your SD was estimated.
  2. Or switch tab if you have something else. Survey percentage is the classic poll case. Mean from summary stats is for when you only have a published mean, SD and n. From a confidence interval works backwards from an interval you already have. Sample size I need is the planning calculation to run before collecting anything.
  3. Load a sample dataset to see how it behaves. Eight are built in, including a skewed income set that triggers the normality warning and a set of very tight measurements where the margin is tiny. Selecting one replaces the data column immediately.
  4. Add clusters to compare groups. Each gets its own margin of error and confidence interval. Every column has its own Clear and Remove button, and Remove is disabled on the last remaining column. You can also upload a CSV or Excel file and click the columns you want.
  5. For a survey percentage, enter the result and the sample size. You can type 52 or 0.52, both are understood. If you do not yet know the percentage, leave it at 50, which is the worst case and gives the widest, safest margin.
  6. Add clusters to compare groups. Each gets its own margin of error and interval. Every column has its own Clear and Remove button, and Remove is disabled on the last remaining column. You can also upload a CSV or Excel file and click the columns you want.
  7. To reverse-engineer a published result, use the confidence interval tab. Enter the two limits and the calculator returns the margin, the point estimate, and, if you supply the sample size, the standard error and standard deviation behind them.
  8. To plan a study, use the sample size tab. Tell it the margin you need and it tells you how many responses to collect, adjusted for the design effect, the population size and your expected response rate.
  9. Choose your confidence level deliberately. 95% is the convention, but it is only a convention. Higher confidence always means a wider margin, and chart 4 shows exactly what it costs you.
  10. Read the warnings before the numbers. They will tell you if your percentage is too close to 0 or 100 for the standard formula, if the interval has run outside the possible range, or if your sample is too small for the normal approximation. Where the Wilson interval is reported and differs, use it.

📊 8. How to Calculate Margin of Error in Excel

Excel handles every part of this, though the one-call function CONFIDENCE.T only works for means. For proportions you assemble it from three functions. Below is the whole workflow in ten steps, each with a picture of what your sheet should look like.

The functions that matter. NORM.S.INV for the z critical value, SQRT for the standard error, T.INV.2T for a mean's critical value, CONFIDENCE.T to do a mean in one call, and ROUNDUP for sample size planning.
Xmargin-of-error.xlsx - ExcelB2fx0.52AB1InputValue2Sample percentage (p)0.523Sample size (n)10004Confidence level0.955z critical value6Standard error7Margin of error8Lower limit9Upper limit

Step 1. Lay out the three inputs you actually have: the percentage as a decimal, the sample size, and the confidence level.

Xmargin-of-error.xlsx - ExcelB5fx=NORM.S.INV(1-(1-B4)/2)AB1InputValue2Sample percentage (p)0.523Sample size (n)10004Confidence level0.955z critical value1.9599646Standard error7Margin of error8Lower limit9Upper limit

Step 2. NORM.S.INV converts the confidence level into the z critical value. At 95% it returns 1.959964, which is where the familiar 1.96 comes from.

Xmargin-of-error.xlsx - ExcelB6fx=SQRT(B2*(1-B2)/B3)AB1InputValue2Sample percentage (p)0.523Sample size (n)10004Confidence level0.955z critical value1.9599646Standard error0.0157997Margin of error8Lower limit9Upper limit

Step 3. The standard error of a proportion. Note SQRT wraps the whole expression, not just n.

Xmargin-of-error.xlsx - ExcelB7fx=B5*B6AB1InputValue2Sample percentage (p)0.523Sample size (n)10004Confidence level0.955z critical value1.9599646Standard error0.0157997Margin of error0.0309658Lower limit9Upper limit

Step 4. Margin of error = z times the standard error. 0.030965 as a decimal, which is 3.0965 percentage points.

Xmargin-of-error.xlsx - ExcelB8fx=B2-B7AB1InputValue2Sample percentage (p)0.523Sample size (n)10004Confidence level0.955z critical value1.9599646Standard error0.0157997Margin of error0.0309658Lower limit0.4890359Upper limit0.550965

Step 5. The confidence interval is the estimate plus and minus the margin: 48.90% to 55.10%. Format these cells as percentages to read them directly.

Xmargin-of-error.xlsx - ExcelB3fx=SQRT((B2-1000)/(B2-1))AB1AdjustmentValue2Population size (N)50003FPC0.8945174Adjusted MOE5Design effect6MOE with DEFF

Step 6. The finite population correction, for when your sample is a large share of the population. At n=1000 out of N=5000 it is 0.8945.

Xmargin-of-error.xlsx - ExcelB6fx=0.030965*SQRT(B5)AB1AdjustmentValue2Population size (N)50003FPC0.8945174Adjusted MOE0.0276995Design effect26MOE with DEFF0.043791

Step 7. The design effect widens the margin by its square root. A DEFF of 2 turns 3.10 points into 4.38.

Xmargin-of-error.xlsx - ExcelB6fx=T.INV.2T(0.05,B4-1)AB1QuantityValue2Mean53.16673Standard deviation5.67024Sample size125Standard error1.6369026t critical value2.2009857Margin of error

Step 8. For a MEAN use T.INV.2T, not NORM.S.INV. At n=12 it gives 2.201 rather than 1.960, because the SD was estimated from the sample.

Xmargin-of-error.xlsx - ExcelB7fx=CONFIDENCE.T(0.05,B3,B4)AB1QuantityValue2Mean53.16673Standard deviation5.67024Sample size125Standard error1.6369026t critical value2.2009857Margin of error3.602693

Step 9. CONFIDENCE.T does the whole thing in one call and returns 3.6027. Do NOT use CONFIDENCE.NORM, which assumes you know the population SD and gives too narrow a margin.

Xmargin-of-error.xlsx - ExcelB6fx=ROUNDUP(B5,0)AB1PlanningValue2Target margin0.033Assumed p0.54z1.9599645Sample size needed1067.0726Rounded up1068

Step 10. Sample size for a target margin: =B4^2*B3*(1-B3)/B2^2 gives 1067.07, and ROUNDUP makes it 1068. Always round up, never down.

The formula cheat sheet

What you wantExcel formulaResult for the worked example
z critical value=NORM.S.INV(1-(1-0.95)/2)1.959964
z, the shortcut=NORM.S.INV(0.975)1.959964, same thing
Standard error of a proportion=SQRT(p*(1-p)/n)0.015799
MOE for a proportion=NORM.S.INV(0.975)*SQRT(p*(1-p)/n)0.030965, so ±3.0965 points
MOE at the worst case=NORM.S.INV(0.975)*SQRT(0.25/n)±3.0990 points at n = 1000
Standard error of a mean=STDEV.S(range)/SQRT(COUNT(range))1.636902
t critical value=T.INV.2T(0.05,n-1)2.200985 at n = 12
MOE for a mean=CONFIDENCE.T(0.05,sd,n)3.602693
MOE for a mean, long form=T.INV.2T(0.05,n-1)*sd/SQRT(n)3.602693, identical
Lower limit=estimate-MOE49.5640
Upper limit=estimate+MOE56.7694
MOE from a confidence interval=(upper-lower)/23.6027
Estimate from an interval=(upper+lower)/253.1667
Finite population correction=SQRT((N-n)/(N-1))0.894517 at n = 1000, N = 5000
Design effect adjustment=MOE*SQRT(deff)0.043791 at DEFF = 2
Sample size for a proportion=ROUNDUP(NORM.S.INV(0.975)^2*0.25/target^2,0)1068 for ±3%
Sample size for a mean=ROUNDUP(NORM.S.INV(0.975)^2*sd^2/target^2,0)124 for ±1 with sd 5.67
Sample size, finite population=ROUNDUP(n/(1+(n-1)/N),0)880 for ±3% within N = 5000
Wilson lower limit=(p+z^2/(2*n)-z*SQRT(p*(1-p)/n+z^2/(4*n^2)))/(1+z^2/n)0.005502 for 2 out of 100
Wilson upper limit=(p+z^2/(2*n)+z*SQRT(p*(1-p)/n+z^2/(4*n^2)))/(1+z^2/n)0.070012 for 2 out of 100

Six mistakes that catch people out

  • Using CONFIDENCE.NORM instead of CONFIDENCE.T. The NORM version assumes the population standard deviation is known and gives a margin that is too narrow. At n = 12 it returns 3.208 rather than the correct 3.603, understating your uncertainty by 11%.
  • Putting SQRT in the wrong place. It must wrap the whole fraction: SQRT(p*(1-p)/n), not SQRT(p*(1-p))/n. The second gives a completely different and much smaller number.
  • Feeding NORM.S.INV the confidence level directly. NORM.S.INV(0.95) returns 1.645, the one-tailed value. For a two-sided margin you need NORM.S.INV(0.975).
  • Entering the percentage as 52 instead of 0.52. The formula needs a decimal. Using 52 gives a nonsensical negative value under the square root.
  • Rounding sample size down. 1067.07 becomes 1068, not 1067. Use ROUNDUP, not ROUND, or you will fall just short of your target precision.
  • Applying the FPC when it does not apply. If your sample is under about 5% of the population the correction is nearly 1 and adds nothing but a chance to make an error.
Google Sheets. Every formula above works unchanged. Sheets also accepts the legacy NORMSINV, TINV and CONFIDENCE names. Note that legacy CONFIDENCE is the NORM version, so prefer CONFIDENCE.T explicitly.
A note on percentage formatting. If you format the margin cell as a percentage, Excel will display 0.030965 as 3.10%. That is 3.10 percentage points, not 3.10% of your estimate. The distinction matters: a 3-point margin on a 52% result means 49% to 55%, not 50.4% to 53.6%.

📈 9. How to Calculate Margin of Error in R

Base R does all of this with qnorm(), qt() and arithmetic. No packages are needed. The script below covers proportions, means, the reverse calculation from a confidence interval, sample size planning and the Wilson interval, then draws one figure.

The one trap in R. prop.test() returns a Wilson interval with a continuity correction by default, not the textbook interval, so its limits will not equal p ± MOE. That is a feature rather than a bug, but it means you cannot read a margin of error straight off it. Use binom.test() for an exact Clopper-Pearson interval, or compute the standard margin yourself as shown below.
R, base packages only
# Margin of Error Calculator in R (base R, no packages)

conf <- 0.95
z    <- qnorm(1 - (1 - conf)/2)          # 1.959964 at 95%

# ---- 1. Margin of error for a survey percentage -----------------------
p <- 0.52; n <- 1000
se_p  <- sqrt(p * (1 - p) / n)
moe_p <- z * se_p

# Finite population correction, only matters if n is a big share of N
N   <- 5000
fpc <- sqrt((N - n) / (N - 1))
moe_fpc <- moe_p * fpc

# Design effect, for cluster or multistage samples
deff <- 2
moe_deff <- moe_p * sqrt(deff)

# ---- 2. Margin of error for a mean ------------------------------------
x     <- c(52,48,55,61,47,58,50,63,45,56,54,49)
nm    <- length(x)
m     <- mean(x)
s     <- sd(x)                            # sd() always divides by n - 1
se_m  <- s / sqrt(nm)
tcrit <- qt(1 - (1 - conf)/2, nm - 1)     # t, not z: s was estimated
moe_m <- tcrit * se_m

# t.test() gives the same interval, which is a useful cross-check
ci <- t.test(x, conf.level = conf)$conf.int

# ---- 3. Margin of error FROM a confidence interval --------------------
lo <- 49.5640; hi <- 56.7694
moe_ci  <- (hi - lo) / 2
est_ci  <- (hi + lo) / 2
se_back <- moe_ci / tcrit                 # recover SE, if you know n
sd_back <- se_back * sqrt(nm)             # recover SD

# ---- 4. Sample size for a target margin -------------------------------
n_for_moe <- function(target, p = 0.5, conf = 0.95, N = NULL, deff = 1) {
  z <- qnorm(1 - (1 - conf)/2)
  n <- z^2 * p * (1 - p) / target^2
  n <- n * deff
  if (!is.null(N)) n <- n / (1 + (n - 1) / N)   # finite population
  ceiling(n)
}

# ---- 5. Wilson interval, for percentages near 0 or 100 ----------------
wilson <- function(k, n, conf = 0.95) {
  z <- qnorm(1 - (1 - conf)/2)
  p <- k / n
  d <- 1 + z^2 / n
  c <- (p + z^2 / (2*n)) / d
  h <- z * sqrt(p*(1-p)/n + z^2/(4*n^2)) / d
  c(max(0, c - h), min(1, c + h))
}

cat(sprintf("PROPORTION   %.0f%% of n=%d: MOE = +/- %.4f pp\n", p*100, n, moe_p*100))
cat(sprintf("             interval %.2f%% to %.2f%%\n", (p-moe_p)*100, (p+moe_p)*100))
cat(sprintf("  with FPC   N=%d: MOE = +/- %.4f pp  (fpc %.6f)\n", N, moe_fpc*100, fpc))
cat(sprintf("  with DEFF  deff=%g: MOE = +/- %.4f pp\n", deff, moe_deff*100))
cat(sprintf("MEAN         n=%d, mean=%.4f, s=%.4f, SE=%.4f\n", nm, m, s, se_m))
cat(sprintf("             t(%d) = %.6f, MOE = +/- %.4f\n", nm-1, tcrit, moe_m))
cat(sprintf("             interval %.4f to %.4f\n", m-moe_m, m+moe_m))
cat(sprintf("FROM CI      [%g, %g] -> MOE = +/- %.4f, estimate %.4f\n",
            lo, hi, moe_ci, est_ci))
cat(sprintf("             recovered SE %.6f, SD %.6f\n", se_back, sd_back))
cat(sprintf("SAMPLE SIZE  +/-5%%: %d   +/-3%%: %d   +/-1%%: %d\n",
            n_for_moe(0.05), n_for_moe(0.03), n_for_moe(0.01)))
cat(sprintf("             +/-3%% within a population of 5000: %d\n",
            n_for_moe(0.03, N = 5000)))
w <- wilson(2, 100)
cat(sprintf("WILSON       2/100: %.4f%% to %.4f%%\n", w[1]*100, w[2]*100))
cat(sprintf("  standard   2/100: %.4f%% to %.4f%%  <- impossible lower bound\n",
            (0.02 - z*sqrt(.02*.98/100))*100, (0.02 + z*sqrt(.02*.98/100))*100))

# ---- 6. One figure ----------------------------------------------------
ns <- seq(50, 5000, by = 10)
plot(ns, z*sqrt(0.5*0.5/ns)*100, type = "l", lwd = 2, col = "#0369a1",
     ylim = c(0, 8), bty = "n", xlab = "sample size",
     ylab = "margin of error (percentage points)",
     main = sprintf("Margin of Error vs Sample Size at %.0f%% Confidence", conf*100))
lines(ns, z*sqrt(0.3*0.7/ns)*100, lwd = 2, col = "#0f766e")
lines(ns, z*sqrt(0.1*0.9/ns)*100, lwd = 2, col = "#b45309")
abline(v = c(385, 1068), col = "#94a3b8", lty = 3)
text(385,  7.6, " n=385\n +/-5%", pos = 4, cex = 0.75, col = "#64748b")
text(1068, 7.6, " n=1068\n +/-3%", pos = 4, cex = 0.75, col = "#64748b")
points(n, moe_p*100, pch = 19, cex = 1.4, col = "#be185d")
legend("topright", bty = "n", cex = 0.85,
       legend = c("p = 50%", "p = 30%", "p = 10%",
                  sprintf("your survey: n=%d, +/-%.2f pp", n, moe_p*100)),
       col = c("#0369a1", "#0f766e", "#b45309", "#be185d"),
       lwd = c(2, 2, 2, NA), pch = c(NA, NA, NA, 19))

What the script prints

PROPORTION   52% of n=1000: MOE = +/- 3.0965 pp
             interval 48.90% to 55.10%
  with FPC   N=5000: MOE = +/- 2.7699 pp  (fpc 0.894517)
  with DEFF  deff=2: MOE = +/- 4.3791 pp
MEAN         n=12, mean=53.1667, s=5.6702, SE=1.6369
             t(11) = 2.200985, MOE = +/- 3.6027
             interval 49.5640 to 56.7694
FROM CI      [49.564, 56.7694] -> MOE = +/- 3.6027, estimate 53.1667
             recovered SE 1.636858, SD 5.670242
SAMPLE SIZE  +/-5%: 385   +/-3%: 1068   +/-1%: 9604
             +/-3% within a population of 5000: 880
WILSON       2/100: 0.5502% to 7.0012%
  standard   2/100: -0.7439% to 4.7439%  <- impossible lower bound

These are the same numbers the Python script produces and the same numbers the calculator at the top of this page produces.

Line-by-line explanation

  • Block 1 computes the proportion margin from first principles, then shows both adjustments. Notice the finite population correction pulls the margin down while the design effect pushes it up: they work in opposite directions and both are commonly forgotten.
  • Block 2 uses qt() rather than qnorm() because the standard deviation came from the sample. The t.test() call is there as a cross-check: its confidence interval should match your hand calculation exactly, and if it does not you have made an arithmetic error.
  • Block 3 is the reverse direction, and it is two lines of arithmetic. The recovery of the standard deviation only works if you know n and the confidence level the original authors used.
  • Block 4 is written as a reusable function because you will want it repeatedly. Note the ceiling(): sample sizes always round up.
  • Block 5 implements Wilson directly rather than calling prop.test(), so you can see the arithmetic and control the continuity correction yourself.
  • Block 6 draws the single most useful figure in survey planning: the margin against sample size for three different proportions, with the ±5% and ±3% landmarks marked. The flatness of the curve past about n = 1,500 is the whole argument for why polls are the size they are.

Useful one-liners

TaskR
z critical valueqnorm(0.975)
t critical valueqt(0.975, df)
MOE for a proportionqnorm(0.975)*sqrt(p*(1-p)/n)
MOE for a meanqt(0.975,n-1)*sd(x)/sqrt(n)
Confidence interval for a meant.test(x)$conf.int
MOE from a t.test resultdiff(t.test(x)$conf.int)/2
Wilson interval (with correction)prop.test(52,100)$conf.int
Wilson without the correctionprop.test(52,100,correct=FALSE)$conf.int
Exact Clopper-Pearson intervalbinom.test(52,100)$conf.int
Sample size for ±3%ceiling(qnorm(0.975)^2*0.25/0.03^2)
Finite population correctionsqrt((N-n)/(N-1))
Survey package, design-based SEsurvey::svymean(~x, design)
Bootstrap intervalboot::boot.ci(boot(x, mean_fn, 2000))

🐍 10. How to Calculate Margin of Error in Python

NumPy and SciPy cover everything here. The script below was run before being published, so the output shown underneath is the real console output, not typed by hand.

The two traps in Python. First, np.std() defaults to ddof=0, the population divisor. Write ddof=1 for a sample standard deviation, or your margin will be slightly too narrow. Second, statsmodels.stats.proportion.proportion_confint defaults to method='normal', the textbook interval that fails near 0% and 100%. Pass method='wilson' instead.
Python 3, NumPy + SciPy + Matplotlib
# Margin of Error Calculator in Python
# Proportions, means, reverse from a confidence interval, and sample size.
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from scipy import stats

conf  = 0.95
z     = stats.norm.ppf(1 - (1 - conf)/2)     # 1.959964 at 95%

# ---- 1. Margin of error for a survey percentage -----------------------
p, n = 0.52, 1000
se_p  = np.sqrt(p * (1 - p) / n)
moe_p = z * se_p

# Finite population correction, only matters if n is a big share of N
N     = 5000
fpc   = np.sqrt((N - n) / (N - 1))
moe_fpc = moe_p * fpc

# Design effect, for cluster or multistage samples
deff  = 2.0
moe_deff = moe_p * np.sqrt(deff)

# ---- 2. Margin of error for a mean ------------------------------------
x     = np.array([52,48,55,61,47,58,50,63,45,56,54,49], dtype=float)
nm    = x.size
mean  = x.mean()
s     = x.std(ddof=1)                         # ddof=1: sample SD
se_m  = s / np.sqrt(nm)
tcrit = stats.t.ppf(1 - (1 - conf)/2, nm - 1) # t, not z: s was estimated
moe_m = tcrit * se_m

# ---- 3. Margin of error FROM a confidence interval --------------------
lo, hi   = 49.5640, 56.7694
moe_ci   = (hi - lo) / 2
est_ci   = (hi + lo) / 2
se_back  = moe_ci / tcrit                     # recover SE, if you know n
sd_back  = se_back * np.sqrt(nm)              # recover SD

# ---- 4. Sample size for a target margin -------------------------------
def n_for_moe(target, p=0.5, conf=0.95, N=None, deff=1.0):
    z = stats.norm.ppf(1 - (1 - conf)/2)
    n = z**2 * p * (1 - p) / target**2
    n *= deff
    if N:                                     # finite population correction
        n = n / (1 + (n - 1) / N)
    return int(np.ceil(n))

# ---- 5. Wilson interval, for percentages near 0 or 100 ----------------
def wilson(k, n, conf=0.95):
    z = stats.norm.ppf(1 - (1 - conf)/2)
    p = k / n
    d = 1 + z**2 / n
    c = (p + z**2 / (2*n)) / d
    h = z * np.sqrt(p*(1-p)/n + z**2/(4*n**2)) / d
    return max(0.0, c - h), min(1.0, c + h)

print(f"PROPORTION   {p:.0%} of n={n}: MOE = +/- {moe_p*100:.4f} pp")
print(f"             interval {(p-moe_p)*100:.2f}% to {(p+moe_p)*100:.2f}%")
print(f"  with FPC   N={N}: MOE = +/- {moe_fpc*100:.4f} pp  (fpc {fpc:.6f})")
print(f"  with DEFF  deff={deff}: MOE = +/- {moe_deff*100:.4f} pp")
print(f"MEAN         n={nm}, mean={mean:.4f}, s={s:.4f}, SE={se_m:.4f}")
print(f"             t({nm-1}) = {tcrit:.6f}, MOE = +/- {moe_m:.4f}")
print(f"             interval {mean-moe_m:.4f} to {mean+moe_m:.4f}")
print(f"FROM CI      [{lo}, {hi}] -> MOE = +/- {moe_ci:.4f}, estimate {est_ci:.4f}")
print(f"             recovered SE {se_back:.6f}, SD {sd_back:.6f}")
print(f"SAMPLE SIZE  +/-5%: {n_for_moe(0.05)}   +/-3%: {n_for_moe(0.03)}   "
      f"+/-1%: {n_for_moe(0.01)}")
print(f"             +/-3% within a population of 5000: {n_for_moe(0.03, N=5000)}")
print(f"WILSON       2/100: {wilson(2,100)[0]*100:.4f}% to {wilson(2,100)[1]*100:.4f}%")
print(f"  standard   2/100: {(0.02-z*np.sqrt(.02*.98/100))*100:.4f}% to "
      f"{(0.02+z*np.sqrt(.02*.98/100))*100:.4f}%  <- impossible lower bound")

# ---- 6. One figure ----------------------------------------------------
fig, ax = plt.subplots(figsize=(9, 5))
ns = np.arange(50, 5001, 10)
for pp, col in [(0.5, "#0369a1"), (0.3, "#0f766e"), (0.1, "#b45309")]:
    ax.plot(ns, z*np.sqrt(pp*(1-pp)/ns)*100, color=col, lw=2,
            label=f"p = {pp:.0%}")
ax.scatter([n], [moe_p*100], s=90, color="#be185d", zorder=5,
           label=f"your survey: n={n}, +/-{moe_p*100:.2f} pp")
for mk, lbl in [(385, "+/-5%"), (1068, "+/-3%")]:
    ax.axvline(mk, color="#94a3b8", ls=":", lw=1.2)
    ax.text(mk, 7.6, f" n={mk}\n {lbl}", fontsize=8, color="#64748b")
ax.set_xlabel("sample size")
ax.set_ylabel("margin of error (percentage points)")
ax.set_title(f"Margin of Error vs Sample Size at {conf:.0%} Confidence")
ax.set_ylim(0, 8)
ax.legend(frameon=False, fontsize=9)
ax.spines[["top", "right"]].set_visible(False)
fig.tight_layout()
fig.savefig("margin_of_error.png", dpi=150)
print("saved margin_of_error.png")

Actual output from running the script

PROPORTION   52% of n=1000: MOE = +/- 3.0965 pp
             interval 48.90% to 55.10%
  with FPC   N=5000: MOE = +/- 2.7699 pp  (fpc 0.894517)
  with DEFF  deff=2.0: MOE = +/- 4.3791 pp
MEAN         n=12, mean=53.1667, s=5.6702, SE=1.6369
             t(11) = 2.200985, MOE = +/- 3.6027
             interval 49.5640 to 56.7694
FROM CI      [49.564, 56.7694] -> MOE = +/- 3.6027, estimate 53.1667
             recovered SE 1.636858, SD 5.670242
SAMPLE SIZE  +/-5%: 385   +/-3%: 1068   +/-1%: 9604
             +/-3% within a population of 5000: 880
WILSON       2/100: 0.5502% to 7.0012%
  standard   2/100: -0.7439% to 4.7439%  <- impossible lower bound

Line-by-line explanation

  • Block 1 computes the proportion margin, then shows both adjustments separately. The finite population correction multiplies the margin by 0.8945 and the design effect multiplies it by the square root of 2. They pull in opposite directions, and real surveys often need both.
  • Block 2 uses stats.t.ppf rather than stats.norm.ppf because the standard deviation was estimated. At n = 12 that is 2.201 rather than 1.960, a 12% wider margin.
  • Block 3 is the reverse direction and it is two lines of arithmetic: half the width, and the midpoint. The recovery of the standard error and standard deviation requires knowing n and assuming the original authors used the same confidence level and distribution.
  • Block 4 wraps the sample size calculation in a function with optional finite population and design effect arguments. Note np.ceil: always round up.
  • Block 5 implements Wilson directly. The printed comparison makes the failure of the standard method obvious: for 2 out of 100 it produces a lower bound of −0.74%, a negative percentage.
  • Block 6 draws the margin against sample size for three proportions, with the ±5% and ±3% landmarks marked. This is the figure to show anyone asking why the survey cannot simply be made more precise.

Useful one-liners

TaskPython
z critical valuestats.norm.ppf(0.975)
t critical valuestats.t.ppf(0.975, df)
MOE for a proportionstats.norm.ppf(.975)*np.sqrt(p*(1-p)/n)
MOE for a meanstats.t.ppf(.975,n-1)*x.std(ddof=1)/np.sqrt(n)
Confidence interval for a meanstats.t.interval(.95, n-1, mean, sem)
Standard error of the meanstats.sem(x)
Wilson intervalproportion_confint(k, n, method='wilson')
Standard (Wald) intervalproportion_confint(k, n, method='normal')
Exact Clopper-Pearsonproportion_confint(k, n, method='beta')
Sample size for a proportionsamplesize_confint_proportion(p, half_length)
MOE from an interval(hi - lo) / 2
Bootstrap intervalstats.bootstrap((x,), np.mean).confidence_interval
Complex survey designsamplics or statsmodels survey tools
Cross-checking. stats.t.interval(0.95, 11, 53.1667, 1.6369) returns (49.5640, 56.7694), the same interval the hand calculation gives. If your manual arithmetic disagrees with SciPy, the usual culprit is ddof or using z where t belongs.

📋 11. Reference Tables

11.1 Margin of error by sample size and confidence level

Computed at p = 50%, the worst case, so no result in a survey of that size can be less precise than the figure shown. This is the table survey firms use to quote a headline margin.

Sample size90%95%99%99.9%
1026.01%30.99%40.73%52.03%
2516.45%19.60%25.76%32.91%
5011.63%13.86%18.21%23.27%
759.50%11.32%14.87%19.00%
1008.22%9.80%12.88%16.45%
1506.72%8.00%10.52%13.43%
2005.82%6.93%9.11%11.63%
2505.20%6.20%8.15%10.41%
3004.75%5.66%7.44%9.50%
3844.20%5.00%6.57%8.40%
4004.11%4.90%6.44%8.23%
5003.68%4.38%5.76%7.36%
6003.36%4.00%5.26%6.72%
7503.00%3.58%4.70%6.01%
1,0002.60%3.10%4.07%5.20%
1,0682.52%3.00%3.94%5.03%
1,2002.37%2.83%3.72%4.75%
1,5002.12%2.53%3.33%4.25%
2,0001.84%2.19%2.88%3.68%
2,5001.64%1.96%2.58%3.29%
3,0001.50%1.79%2.35%3.00%
4,0001.30%1.55%2.04%2.60%
5,0001.16%1.39%1.82%2.33%
10,0000.82%0.98%1.29%1.65%
The three landmarks. n = 384 gives ±5.00%, n = 1,068 gives ±3.00% and n = 9,604 gives ±1.00%, all at 95% confidence. Almost every commercial poll sits between 1,000 and 1,500 because that is where the curve flattens.

11.2 Margin of error by sample size and the percentage itself

The margin is widest at 50% and narrows towards both extremes. A question where 90% agreed is considerably more precise than the survey's headline margin suggests.

Sample sizep = 5%p = 10%p = 20%p = 30%p = 40%p = 50%
1013.51%18.59%24.79%28.40%30.36%30.99%
258.54%11.76%15.68%17.96%19.20%19.60%
506.04%8.32%11.09%12.70%13.58%13.86%
754.93%6.79%9.05%10.37%11.09%11.32%
1004.27%5.88%7.84%8.98%9.60%9.80%
1503.49%4.80%6.40%7.33%7.84%8.00%
2003.02%4.16%5.54%6.35%6.79%6.93%
2502.70%3.72%4.96%5.68%6.07%6.20%
3002.47%3.39%4.53%5.19%5.54%5.66%
3842.18%3.00%4.00%4.58%4.90%5.00%
4002.14%2.94%3.92%4.49%4.80%4.90%
5001.91%2.63%3.51%4.02%4.29%4.38%
6001.74%2.40%3.20%3.67%3.92%4.00%
7501.56%2.15%2.86%3.28%3.51%3.58%
1,0001.35%1.86%2.48%2.84%3.04%3.10%
1,0681.31%1.80%2.40%2.75%2.94%3.00%
1,2001.23%1.70%2.26%2.59%2.77%2.83%
1,5001.10%1.52%2.02%2.32%2.48%2.53%
2,0000.96%1.31%1.75%2.01%2.15%2.19%
2,5000.85%1.18%1.57%1.80%1.92%1.96%
3,0000.78%1.07%1.43%1.64%1.75%1.79%
4,0000.68%0.93%1.24%1.42%1.52%1.55%
5,0000.60%0.83%1.11%1.27%1.36%1.39%
10,0000.43%0.59%0.78%0.90%0.96%0.98%

11.3 Sample size needed for a target margin of error

The planning table. Read down to the precision you need and across to your confidence level. Assumes p = 50% and a very large population.

Target margin90% confidence95% confidence99% confidence
±10%6897166
±7%139196339
±5%271385664
±4%4236011,037
±3%7521,0681,844
±2.5%1,0831,5372,654
±2%1,6912,4014,147
±1.5%3,0074,2697,373
±1%6,7649,60416,588
±0.5%27,05638,41566,349
Look at what precision costs. Going from ±5% to ±3% roughly triples the sample. Going from ±3% to ±1% multiplies it by nine. If a client asks for ±1% they may not realise they are asking for a survey ten times the size.

11.4 Sample size needed, by population size

This is the table that demonstrates how little population size matters. Look along the ±3% column: a population of 100,000 needs 1,056 responses and a population of 10 million needs 1,068. Twelve more people for a hundredfold larger population.

Population size±10%±5%±3%±1%
5034454850
10050809299
25070152203244
50081218341476
1,00088278517906
2,500933347491,984
5,000953578803,289
10,000963709654,900
50,000963821,0458,057
100,000963831,0568,763
1,000,000973841,0669,513
10,000,000973851,0679,595
Infinite973851,0689,604

Population size only bites when it is small. A 500-person organisation needs 218 responses for ±5%, not 385, because the finite population correction is doing real work at that scale.

11.5 The square root law, made concrete

What you actually get for your money. All figures at p = 50% and 95% confidence.

Sample sizeRelative to 1,000Margin of errorMargin as % of the n = 1,000 margin
2500.25x6.198%200.0%
5000.5x4.383%141.4%
1,0001x3.099%100.0%
2,0002x2.191%70.7%
4,0004x1.549%50.0%
9,0009x1.033%33.3%
16,00016x0.775%25.0%

Read the last row: to reach a quarter of the margin you need sixteen times the sample. This relationship is fixed by the mathematics and no amount of budget changes it.

11.6 When the finite population correction matters

A fixed sample of 200 drawn from populations of different sizes. The correction is substantial when your sample is a large share of the population and negligible otherwise.

Population (N)n = 200 is this % of NFPCMargin without FPCMargin with FPC
200100.0%0.0000006.930%0.000%
50040.0%0.7753726.930%5.373%
1,00020.0%0.8948756.930%6.201%
2,00010.0%0.9489216.930%6.576%
5,0004.0%0.9798946.930%6.790%
10,0002.0%0.9899996.930%6.860%
50,0000.4%0.9980086.930%6.916%

Below about 5% sampling fraction the correction changes the margin by under 3% of its own value, which is why it is usually ignored for national surveys and always applied for organisational ones.

11.7 Where the standard formula fails, and Wilson rescues it

All at n = 100 except the first row, at 95% confidence. The highlighted rows are where the standard interval produces something impossible.

ResultpStandard (Wald) intervalWilson intervalVerdict
0/500.0%0.00% to 0.00%0.00% to 7.13%Standard fails
1/1001.0%-0.95% to 2.95%0.18% to 5.45%Standard fails
2/1002.0%-0.74% to 4.74%0.55% to 7.00%Standard fails
5/1005.0%0.73% to 9.27%2.15% to 11.18%Both fine
10/10010.0%4.12% to 15.88%5.52% to 17.44%Both fine
25/10025.0%16.51% to 33.49%17.55% to 34.30%Both fine
50/10050.0%40.20% to 59.80%40.38% to 59.62%Both fine
90/10090.0%84.12% to 95.88%82.56% to 94.48%Both fine
98/10098.0%95.26% to 100.74%93.00% to 99.45%Standard fails
100/100100.0%100.00% to 100.00%96.30% to 100.00%Standard fails

Note the first and last rows especially. At 0 out of 50 the standard formula reports a margin of exactly zero, claiming certainty that nobody in the population holds that view on the basis of 50 interviews. Wilson correctly returns 0% to 7.13%.

11.8 Critical values by confidence level

Confidence levelAlphaz (two-sided)Margin at n = 1,000, p = 50%n needed for ±3%
80%0.201.2816±2.03%456
85%0.151.4395±2.28%576
90%0.101.6449±2.60%752
95%0.051.9600±3.10%1,068
98%0.022.3263±3.68%1,504
99%0.012.5758±4.07%1,844
99.9%0.0013.2905±5.20%3,008

11.9 t versus z for means, and the small-sample penalty

ndft at 95%z at 95%t is wider by
324.30271.9600119.5%
542.77641.960041.7%
1092.26221.960015.4%
12112.20101.960012.3%
20192.09301.96006.8%
30292.04521.96004.3%
50492.00961.96002.5%
100991.98421.96001.2%
5004991.96471.96000.2%
1,0009991.96231.96000.1%

Using z instead of t on a sample of 10 understates your margin by 15%. Above about n = 50 the difference stops mattering in practice, but there is never a penalty for using t.

11.10 Design effects you might encounter

DesignTypical DEFFEffective n from 1,000 interviewsMargin (p = 50%)
Simple random sample1.01,000±3.10%
Stratified, proportionate0.9 to 1.01,000 to 1,111±2.94% to 3.10%
Systematic from an ordered list1.0 to 1.2833 to 1,000±3.10% to 3.39%
Household cluster sample1.5 to 2.5400 to 667±3.79% to 4.90%
Two-stage cluster, large clusters2.0 to 4.0250 to 500±4.38% to 6.20%
Weighted online panel1.3 to 2.0500 to 769±3.53% to 4.38%

A stratified sample can have a design effect below 1, which means it is more efficient than simple random sampling. Every other design listed here costs you precision.

11.11 The same calculation in five packages

TaskExcelRPythonSPSSStata
z critical valueNORM.S.INV(0.975)qnorm(.975)stats.norm.ppf(.975)IDF.NORMAL(.975,0,1)invnormal(.975)
t critical valueT.INV.2T(0.05,df)qt(.975,df)stats.t.ppf(.975,df)IDF.T(.975,df)invttail(df,.025)
MOE for a meanCONFIDENCE.T(.05,sd,n)qt(.975,n-1)*sd/sqrt(n)stats.t.ppf(.975,n-1)*semEXAMINE /CINTERVALci means x
CI for a proportionbuild it manuallyprop.test(k,n)proportion_confint(k,n)CTABLESci proportions x
Wilson intervalbuild it manuallyprop.test(k,n,correct=FALSE)proportion_confint(k,n,method='wilson')not built inci proportions x, wilson
Sample sizeROUNDUP(z^2*.25/t^2,0)ceiling(qnorm(.975)^2*.25/t^2)samplesize_confint_proportionnot built inpower oneproportion
Proportion CI defaultnoneWilson + correctionWald (normal)WaldWald
Read the last row. R's prop.test() gives a Wilson interval with a continuity correction, while Python's proportion_confint defaults to the plain Wald interval. The same data will give visibly different limits in the two languages, and R's are the better ones.

💡 12. Eight Worked Examples

Every number below was computed with the calculator on this page and cross-checked against SciPy. Each example has its own colour and its own figure. Together they cover the five things people actually need: a poll, a mean, a reverse calculation, the cases where the standard formula fails, and the planning calculation.

1📊 Example 1, The Classic Opinion Poll

Setup: A poll of 1,000 people finds 52% support. 95% confidence.

48.90%55.10%52.00%±3.10 pp50.00%result52% support from 1,000 respondents95% confidence
Figure 1. The point estimate with its margin either side, drawn to scale.
Sample percentage52.00%
Sample size1,000
z at 95% confidence1.959964
Standard error0.015799
Margin of error±3.0965 percentage points
Confidence interval48.90% to 55.10%
Wilson interval48.90% to 55.08%
Margin at the worst case, p = 50%±3.0990 points

Reading it: This is the familiar "plus or minus three points". The interval runs from 48.90% to 55.10%, which straddles the 50% line marked in the figure. So this poll cannot establish that support is above half, even though the headline number is 52%. The Wilson interval agrees closely here because 52% is nowhere near an extreme.

2📏 Example 2, A Mean from Raw Data

Setup: 52, 48, 55, 61, 47, 58, 50, 63, 45, 56, 54, 49

49.56456.76953.167±3.603if you used zresultMean of 12 measurementst(11) = 2.201, not z = 1.960
Figure 2. The point estimate with its margin either side, drawn to scale.
n12
Mean53.1667
Standard deviation5.6702
Standard error1.636855
t critical value at 95% confidence2.200985
z for comparison1.959964
Margin of error±3.6027
Confidence interval49.5640 to 56.7694
Margin if you wrongly used z±3.2082
Relative margin6.78% of the estimate

Reading it: For a mean you use t, not z, because the standard deviation was estimated from the same 12 numbers. At df = 11 that means 2.201 rather than 1.960, widening the margin from 3.208 to 3.603, a difference of 12%. The grey bar in the figure shows the too-narrow interval you would have got with z. On small samples that understatement is the more dangerous direction to err.

3🔄 Example 3, Working Backwards from a Published Interval

Setup: A paper reports a 95% confidence interval of 49.564 to 56.769 from a sample of 12.

49.56456.76953.167±3.603resultRecovering the margin from an intervalmargin = width divided by 2
Figure 3. The point estimate with its margin either side, drawn to scale.
Lower limit49.5640
Upper limit56.7694
Interval width7.2054
Margin of error±3.6027
Point estimate, the midpoint53.1667
t critical value at n = 122.200985
Recovered standard error1.636858
Recovered standard deviation5.670242
n needed to halve this margin48

Reading it: This is two lines of arithmetic: the margin is half the width, and the estimate is the midpoint. What makes it useful is the recovery. Knowing n = 12, the critical value must have been 2.201, so the standard error was 1.6369 and the standard deviation 5.6702. You have just reconstructed the original analysis from a published interval, which is exactly what a meta-analysis needs. The caveat is that it only works for symmetric intervals.

4🚨 Example 4, Where the Standard Formula Breaks

Setup: A survey of 100 people finds 2 who report the outcome, so p = 2%.

-0.74%4.74%2.00%±2.74 pp0.00%Wilsonresult2 out of 100, standard versus Wilsonthe standard lower bound is negative
Figure 4. The point estimate with its margin either side, drawn to scale.
Result2 out of 100
Sample percentage2.00%
Standard margin of error±2.7439 percentage points
Standard interval-0.7439% to 4.7439%
The problema negative percentage is impossible
Wilson interval0.5502% to 7.0012%
n × p2.0, well below the rule-of-thumb minimum of 10
n × (1 − p)98.0

Reading it: The standard formula gives a lower bound of minus 0.74%, which cannot happen. The normal approximation behind it assumes the sampling distribution is symmetric, and near a boundary it simply is not. The Wilson interval, shown as the second bar, returns 0.55% to 7.00%: possible, asymmetric and correct. The usual rule of thumb is that n times p and n times (1 minus p) should both exceed 10, and here the first is only 2. Whenever your percentage is below about 10% or above 90%, report Wilson.

5🏢 Example 5, An Internal Survey Where Population Size Matters

Setup: A company with 500 employees gets 200 responses, split 50/50.

44.63%55.37%50.00%±5.37 ppwithout the FPCresult200 responses from a 500-person companyfinite population correction 0.7756
Figure 5. The point estimate with its margin either side, drawn to scale.
Sample size200
Population size500
Sampling fraction40.0%
Margin without the correction±6.9295 points
Finite population correction0.775372
Margin with the correction±5.3730 points
Reduction22.5% narrower
n needed for a 5-point margin, ignoring N385
n needed for a 5-point margin within N = 500218

Reading it: Here the population is small enough that the correction does real work. Surveying 200 of 500 people is a 40% sampling fraction, and the correction cuts the margin from 6.93 to 5.37 points, a 22% improvement for free. The grey bar shows what you would have reported by ignoring it. This is the one situation where population size genuinely matters, and it is exactly the situation most online calculators handle badly by omitting the field entirely.

6👥 Example 6, Is a 3-Point Lead Real?

Setup: A poll of 1,000 shows Candidate A on 48% and Candidate B on 45%.

44.90%51.10%48.00%±3.10 ppCandidate BresultCandidate A on 48%, Candidate B on 45%the intervals overlap heavily
Figure 6. The point estimate with its margin either side, drawn to scale.
Candidate A48.00% ± 3.10 points
Candidate B45.00% ± 3.08 points
Observed gap3.00 percentage points
Margin on the difference±4.3699 percentage points
Gap needed before it means anythingabout 4.4 points
Verdictthe lead is inside the noise
Rule of thumba gap must exceed roughly twice the individual margin

Reading it: The two intervals overlap across almost their whole length, as the figure shows. The margin on a difference is larger than the margin on either estimate, here about 4.37 points, so a 3-point gap establishes nothing. Reporting this as a lead, or comparing it with last month's 2-point gap and calling it momentum, is reading structure into randomness. The practical rule is that a gap must exceed roughly twice the individual margin before you should describe it as real.

7🧭 Example 7, Planning a Survey Before You Start

Setup: You need a margin of 3 percentage points at 95% confidence. How many people must you survey?

0%2%4%6%8%p=50%p=30%p=10%n=385n=1068501002005001,0002,0005,000n=1,068, ±3.00ppMargin of error against sample size at 95% confidencethe curve flattens past about 1,500
Figure 7. Margin of error against sample size for three different proportions, with the landmark sample sizes marked.
Target margin3.00 percentage points
Confidence level95%
Assumed proportion50%, the worst case
Calculation1.959964 squared × 0.25 ÷ 0.03 squared
Unrounded result1067.072
Sample size needed1,068
For a 5-point margin instead385
For a 1-point margin instead9,604
At a 30% response rateinvite 3,560 people
With a design effect of 22,136

Reading it: The three landmark numbers are worth memorising: 385 for a 5-point margin, 1,068 for 3 points and 9,604 for 1 point. The figure shows why almost every commercial poll lands between 1,000 and 1,500. The curve is steep on the left, where each extra respondent buys real precision, and nearly flat on the right, where thousands more buy very little. Tightening from 3 points to 1 point requires nine times the sample and is rarely worth the cost.

8📈 Example 8, A Cluster Sample and the Design Effect

Setup: A household cluster survey collects 1,000 interviews with a design effect of 2.0.

45.62%54.38%50.00%±4.38 ppif simple randomresult1,000 clustered interviews with a design effect of 2behaves like 500 independent ones
Figure 8. The point estimate with its margin either side, drawn to scale.
Nominal sample size1,000
Design effect2.0
Effective sample size500
Margin assuming simple random sampling±3.0990 points
Margin with the design effect±4.3826 points
Understatement if you ignore it41.4%
n needed for a 3-point margin with DEFF = 22,136
Typical DEFF for household clusters1.5 to 3

Reading it: Clustering saves money and costs precision. Interviewing thirty households on one street is far cheaper than thirty scattered addresses, but neighbours resemble each other, so each extra interview within a cluster adds less new information. A design effect of 2 means these 1,000 interviews carry the same sampling error as 500 independent ones, widening the margin from 3.10 to 4.38 points. The grey bar is the figure you would have wrongly reported. Any survey that is not a simple random sample needs this adjustment, and omitting it is one of the most common errors in published survey work.

📋 13. Survey Design Protocol

The margin of error is the last thing you calculate and the first thing people quote. Everything that determines whether it means anything happens before a single response arrives.

  1. Define the target population precisely before anything else. "Adults in the region" is not a definition. Which adults, at what age boundary, resident how long, reachable by what means? The margin of error describes your uncertainty about this population, so if it is vague your result is vague.
  2. Choose the sample size in advance and write it down. Use the sample size tab. Collecting until the result looks convincing is the survey equivalent of optional stopping and destroys the meaning of the margin.
  3. Assume p = 0.5 when planning unless you have solid prior information. It is the worst case, so your realised margin can only be better than planned. Assuming 20% and finding 45% leaves you less precise than you promised.
  4. Build the sampling frame and document what it excludes. A telephone frame misses people without phones. An email list misses people who never signed up. These exclusions do not appear in the margin of error and are usually the larger problem.
  5. Randomise selection properly. The formula assumes every member of the population had a known, non-zero chance of selection. Convenience samples, self-selecting web polls and "whoever answered" have no defensible margin of error at all, however large they are.
  6. Record the design effect if you cluster. Sampling by household, school or postcode is cheaper and less precise. Estimate the design effect from a pilot or from comparable published surveys, and apply it to both your planning and your reporting.
  7. Plan for non-response and inflate the invitation list. A 30% response rate means inviting more than three times your target. Then record the actual rate, because it is a stronger signal of quality than the margin of error is.
  8. Pilot the questionnaire. Ambiguous wording produces measurement error that no sample size can fix. A pilot of thirty people will catch most of it.
  9. Decide the confidence level in advance and use the same one throughout. Reporting some results at 95% and others at 90% because it makes them look better is indefensible.
  10. Work out the margin for your smallest subgroup, not just the total. A survey of 1,000 with a 3-point margin gives a 6-point margin on a quarter of the sample and a 10-point margin on a tenth of it. Subgroup findings are far less precise than the headline, and this is the single most common way survey results are oversold.
  11. Keep the raw response file untouched. Do weighting and cleaning in a script so that every published figure can be traced back.
  12. Report the margin alongside the response rate, the frame and the weighting. The AAPOR transparency standards ask for all of these. A margin of error quoted alone is close to meaningless.
The failure that has caused the most public embarrassment. Quoting a margin of error for a sample that was not random. Web polls, opt-in panels and social media surveys can have enormous n and no defensible margin whatsoever, because the formula assumes random selection and they have none. Large n does not rescue a biased frame; it just makes you confidently wrong.

🎯 14. When to Use a Margin of Error, and When Not To

Use it when

  • You have a genuine probability sample and want to express how precise your estimate is.
  • You are reporting a survey percentage or a mean to an audience who will otherwise read the point estimate as exact.
  • You are planning a study and need to justify a sample size to a client, a funder or an ethics committee.
  • You want to know whether two numbers differ meaningfully. Compare the gap against roughly twice the margin.
  • You are checking somebody else's work. A published interval yields the margin, and with n it yields the standard deviation too.

Do not use it when

  • The sample was not random. Opt-in web polls, convenience samples and self-selected respondents have no valid margin of error. Reputable pollsters explicitly decline to quote one for non-probability panels.
  • You measured the entire population. A census has no sampling error. If you surveyed all 40 employees, the answer is the answer.
  • The interval is asymmetric. Wilson intervals, bootstrap intervals, and intervals for ratios, odds ratios or skewed quantities are deliberately not centred on the estimate. Report the limits instead.
  • Your outcome is a median, a maximum or a rank. These have sampling distributions that are not symmetric or normal. Use a bootstrap.
  • The percentage is very close to 0% or 100%. The standard formula gives impossible values. Use Wilson or an exact Clopper-Pearson interval.
  • The main problem is bias, not sampling error. A margin of ±3 points on a survey with a 4% response rate is a precise measurement of a possibly unrepresentative group.
  • You are comparing more than two groups. Looking at whether many pairs of intervals overlap inflates your error rate. Use a proper multiple comparison procedure.

What to use instead

SituationBetter choiceWhy
Percentage near 0 or 100Wilson score intervalCannot produce impossible values
Very small countsClopper-Pearson exact intervalGuaranteed coverage, though conservative
Skewed data or a medianBootstrap percentile intervalMakes no distributional assumption
Cluster or stratified designDesign-based standard errorsR's survey package, Stata's svy commands
Non-probability panelA credibility interval, clearly labelledHonest about the modelling assumptions involved
Comparing two groupsMargin on the differenceLarger than either individual margin
Many subgroupsSimultaneous confidence intervalsControls the family-wise error rate
A rate or a countPoisson confidence intervalCorrect distribution for count data
Testing a specific hypothesisA t-test or z-testGives a p-value, which an interval does not directly

🔧 15. Troubleshooting

SymptomCauseFix
The interval runs below 0% or above 100%Normal approximation failing near a boundaryUse the Wilson interval, which this calculator always reports
The margin came out as exactly zeroYour result was 0% or 100%The standard formula is wrong here. Wilson gives a sensible interval
Your margin looks far too smallEntered the percentage as 52 rather than 0.52 in a formulaThe formula needs a decimal. This calculator accepts either
Excel's answer is narrower than expectedUsed CONFIDENCE.NORM instead of CONFIDENCE.TThe T version accounts for an estimated standard deviation
R and Python give different intervals for a proportionR's prop.test uses Wilson with a correction; Python defaults to WaldPass method='wilson' in Python, or correct=FALSE in R
The margin barely changed when you doubled nThe square root lawCorrect behaviour. Doubling n improves the margin by only 29%
Adding the population size did nothingYour sample is under 5% of the populationAlso correct. The FPC only matters at larger sampling fractions
Your subgroup result looks implausibly preciseApplied the whole-survey margin to a subgroupRecompute using the subgroup's own n. A quarter of the sample doubles the margin
Two overlapping intervals were called significantly differentCompared the intervals rather than the differenceCompute the margin on the difference, or use a two-sample test
SQRT is giving an error or a strange resultBrackets in the wrong placeIt is SQRT(p*(1-p)/n), with the whole fraction inside
NORM.S.INV returned 1.645 instead of 1.96Passed 0.95 rather than 0.975For a two-sided margin use NORM.S.INV(1-(1-conf)/2)
The reported margin seems too good for a cluster surveyDesign effect ignoredSet it to 1.5 to 3 for a household cluster design
Your poll was outside its own margin of errorNon-sampling error: frame, non-response or wordingThe margin never covered these. Report the response rate too
Sample size came out fractionalNormal, the formula is continuousAlways round up, never down
Reverse calculation gives an odd standard deviationThe source used a different confidence level or an asymmetric intervalCheck the methods section before trusting the recovery
A 3% margin was described as "3% of the result"Confusing percentage points with percent±3 points on 52% means 49% to 55%, not 50.4% to 53.6%

16. Assumptions and Limitations

What the margin of error assumes, ranked by how much it matters

AssumptionHow much it mattersWhat happens if it failsHow to check
Genuine random samplingCriticalThe margin becomes meaningless. No sample size repairs itNot testable from the data. It is a property of the design
Everyone selected respondedCritical in practiceRespondents may differ systematically from non-respondentsReport the response rate and compare respondents against known population figures
The frame covers the populationCriticalWhole groups excluded, and no amount of data reveals itDocument what the frame excludes
Independent observationsHighClustering makes the true margin wider than reportedEstimate the design effect
n×p and n×(1−p) both above 10ModerateThe normal approximation fails and the interval can go outside 0 to 100%Multiply and check. The calculator warns you
Approximate normality (for means)Moderate, falling as n growsInaccurate coverage below about n = 15Histogram, Q-Q plot, or use a bootstrap
The correct critical valueModerate at small nUsing z instead of t understates the margin by 15% at n = 10Use t whenever the SD was estimated
Honest, consistent answersVariesMeasurement error that the margin does not capturePilot the questionnaire

Limitations worth stating whenever you publish a margin

  • It covers sampling error only. This is the limitation that matters most and the one most often omitted. Non-response, coverage gaps, question wording and weighting decisions are all outside it, and in modern surveys they are usually larger.
  • It assumes a probability sample. Opt-in panels and web polls have no valid margin of error regardless of size. Some organisations report a "credibility interval" instead, which is honest about the modelling assumptions involved.
  • It applies to the whole sample, not to subgroups. A survey of 1,000 with ±3 points gives about ±6 points on a subgroup of 250 and ±10 on a subgroup of 100. Reporting subgroup findings under the headline margin is the most common way survey results get oversold.
  • The quoted figure is usually the worst case. Computed at p = 50%, it overstates the margin for questions with lopsided answers.
  • Comparing two estimates needs a different, larger margin. A gap must exceed roughly twice the individual margin before it is worth discussing.
  • The confidence level is a convention. 95% has no special mathematical status. It was a convenience Fisher suggested and it stuck.
  • The interval is not uniform. Values near the centre are considerably more plausible than values at the edges, which the flat ± notation hides.
  • Repeated polling guarantees apparent movement. If you run twenty polls at 95% confidence, one will fall outside its interval by chance. Tracking studies routinely report this noise as a trend.

🏁 17. Conclusion

The margin of error is half the width of a confidence interval, and it exists because you asked some people rather than all of them. For a percentage it is z times the square root of p(1 − p) over n. For a mean it is t times the standard error. If you already have an interval, it is simply half the width, and if you also know the sample size you can work back to the standard error and the standard deviation behind it. That is the entire arithmetic, and it fits in a paragraph.

Three properties of that arithmetic surprise almost everyone. The first is the square root law: the margin falls with the square root of n, so doubling your sample improves precision by only 29% and halving the margin costs four times the sample. This is why commercial polls cluster between 1,000 and 1,500 respondents, and why a client asking to go from ±3 points to ±1 point is asking for a survey nine times the size.

The second is that population size barely matters. A sample of 1,000 gives about ±3.1 points whether the population is 50,000 or 50 million; the reference table shows a hundredfold increase in population changing the required sample by twelve people. What you are measuring is the composition of the population, not counting it, and a well-stirred pot needs one spoonful whatever its size. The exception is when your sample is a large share of the population, which is precisely the situation an internal company survey is in, and there the finite population correction does real work.

The third is that p = 0.5 is the worst case. That is why survey firms quote their headline margin at fifty per cent before fieldwork begins: nothing in the survey can turn out less precise than the number they promised.

Two failure modes are worth memorising. When a percentage sits close to 0% or 100%, the standard formula produces impossible results, including a negative lower bound for 2 out of 100 and a margin of exactly zero for 0 out of 50. The Wilson score interval fixes both and is never worse, so this calculator reports it every time. And when a survey is not a simple random sample, the design effect widens the margin: a household cluster design with a design effect of 2 means your thousand interviews carry the same sampling error as five hundred independent ones. Omitting it is one of the commonest errors in published survey work.

The most consequential limitation is not mathematical at all. The margin of error accounts for random sampling error and nothing else. It assumes a genuine random sample from exactly the population you meant to study, that everybody responded, and that they understood and answered honestly. Real surveys fail these assumptions routinely, response rates for telephone polling have collapsed into single digits in many countries, and the people who still answer are not a random subset of those who do not. None of that appears in the plus-or-minus figure. Treat it as a lower bound on your total uncertainty rather than a full accounting of it, and report the response rate, the sampling frame and the weighting scheme alongside it.

Finally, resist the most common misreading of all. Two estimates whose intervals overlap are not distinguishable, and a gap must exceed roughly twice the individual margin before it is worth discussing. A three-point lead in a poll with a three-point margin is not a lead. It is noise with a headline attached.

18. Frequently Asked Questions

What is the margin of error in simple terms?
It is the plus-or-minus figure that tells you how far your sample result could plausibly be from the true value for the whole population. If a poll says 52% with a margin of error of 3 points, the real figure is probably somewhere between 49% and 55%. It exists because you asked a sample rather than everybody.
How do you calculate margin of error?
For a percentage: MOE = z × √[p(1−p)/n], where p is the proportion as a decimal, n is the sample size, and z is 1.96 at 95% confidence. For a mean: MOE = t × (s/√n), using the t distribution because you estimated the standard deviation from your data. If you already have a confidence interval, the margin is simply half its width.
How do I calculate margin of error from a confidence interval?
Subtract the lower limit from the upper limit and divide by two. An interval of 49.564 to 56.769 has a width of 7.205, so the margin of error is 3.603. The point estimate is the midpoint, (upper + lower) ÷ 2 = 53.167. If you also know the sample size you can recover the standard error by dividing the margin by the critical value, and the standard deviation by multiplying that by the square root of n. This only works for symmetric intervals.
How is margin of error calculated in Excel?
For a mean, use =CONFIDENCE.T(0.05, standard_deviation, sample_size), which does the whole thing in one call. For a percentage there is no single function, so build it: =NORM.S.INV(0.975)*SQRT(p*(1-p)/n). Do not use CONFIDENCE.NORM for a mean, because it assumes the population standard deviation is known and gives a margin that is too narrow.
What is a good margin of error?
It depends entirely on the decision you are making. National polls typically run at 3 to 4 percentage points. Market research often accepts 5. Medical and regulatory work may demand 1 or better. The honest test is whether the interval is narrow enough to distinguish between the options you actually care about. A margin of ±10 points is fine if you only need to know whether support is nearer 20% or 80%.
What sample size do I need for a 5% margin of error?
385 people at 95% confidence, assuming the worst case of p = 50% and a large population. For a 3% margin you need 1,068 and for 1% you need 9,604. If your population is small the requirement drops: within a population of 500, a 5% margin needs only 218 responses.
Does the population size affect the margin of error?
Hardly at all, unless your sample is a large share of it. A sample of 1,000 gives roughly ±3.1 points whether the population is 50,000 or 50 million. Population size only matters once you are sampling more than about 5% of it, at which point the finite population correction narrows the margin. This is why an internal survey of a 200-person company needs far fewer responses than a national poll for the same precision.
Why does the margin of error use 50% when the result is different?
Because p(1−p) is largest at p = 0.5, making it the worst case. Quoting the margin at 50% guarantees that no question in the survey is less precise than the figure advertised. A question where 90% agreed actually has a margin about 40% narrower than the headline suggests.
Does doubling my sample size halve the margin of error?
No. The margin falls with the square root of n, so doubling the sample improves it by only about 29%. To halve the margin you must quadruple the sample. Going from 1,000 to 2,000 respondents takes you from ±3.10% to ±2.19%; reaching ±1.55% requires 4,000.
What is the difference between margin of error and standard error?
The standard error is the standard deviation of the sampling distribution: how much your estimate would bounce around across repeated samples. The margin of error is the standard error multiplied by a critical value, usually 1.96, to give a range with a stated confidence level. So the margin is the standard error scaled up to the confidence you want. Divide a margin by 1.96 and you recover the standard error.
Should I use z or t for the margin of error?
Use z for a proportion. Use t for a mean, because you almost certainly estimated the standard deviation from the same sample. At n = 10 the t value is 2.262 against z at 1.960, so using z would understate your margin by 15%. Above about n = 50 the difference stops mattering, but there is never a penalty for using t.
Can the margin of error be larger than the result itself?
Yes, and it is a clear signal that the sample is too small to have established anything. If 5% of a sample of 30 report something, the margin is about 7.8 points, which is larger than the estimate. The standard formula would even give a negative lower bound. Use the Wilson interval, and treat the result as indicating only that the true value is low.
What is the Wilson interval and when should I use it?
An alternative interval for proportions that is derived by inverting the test rather than approximating the estimate. It cannot produce impossible values below 0% or above 100%, and it performs better than the standard interval at essentially all sample sizes. Use it whenever your percentage is below about 10% or above 90%, or whenever n is small. This calculator reports it alongside the standard interval every time.
Two poll results overlap. Are they different?
Probably not. The margin on a difference is larger than the margin on either estimate, so a gap must exceed roughly twice the individual margin before it is worth calling real. With a ±3 point margin, a 3-point lead is well inside the noise. Describing it as a lead, or comparing it against last month's gap and calling it momentum, is reading structure into randomness.
What is a design effect and do I need one?
A multiplier that accounts for sampling designs more complex than simple random sampling. Clustering by household, school or postcode is cheaper but less precise, because people in the same cluster resemble each other. A design effect of 2 means 1,000 clustered interviews carry the same sampling error as 500 independent ones. Typical values run from 1.5 to 3. If your sample was clustered and you ignore it, your reported margin will be too optimistic.
Does the margin of error account for people who did not respond?
No, and this is the most important limitation. The margin covers random sampling error only. It assumes everyone you selected responded and answered honestly. With response rates for telephone polling in single digits in many countries, non-response bias is usually a larger source of error than sampling. Always report the response rate alongside the margin.
Can I quote a margin of error for an online or opt-in poll?
Not legitimately. The formula assumes every member of the population had a known, non-zero chance of selection, and self-selected respondents have nothing of the sort. Reputable organisations decline to quote a margin of error for non-probability panels, sometimes reporting a "credibility interval" instead, which is explicit about the modelling assumptions involved. A large n does not fix a biased frame.
How does the confidence level change the margin?
Higher confidence always means a wider margin. At n = 1,000 with p = 50%, the margin is ±2.60 points at 90% confidence, ±3.10 at 95% and ±4.07 at 99%. Ninety-five per cent is a convention rather than a law, but changing it after seeing your results is indefensible.
Does the margin of error apply to subgroups too?
No, and this is the most common way survey findings get oversold. The quoted margin applies to the full sample. A subgroup of a quarter the size has roughly double the margin, and a tenth of the sample has more than triple. A survey of 1,000 with ±3 points gives about ±10 points on a subgroup of 100. Always recompute using the subgroup's own n.
Is a margin of error of 3% the same as 3% of my result?
No. A margin of 3 percentage points on a result of 52% means 49% to 55%. Three per cent of 52 would be 1.56, giving 50.4% to 53.6%, which is a completely different and much narrower claim. This is why the correct unit is "percentage points", and why formatting the margin cell as a percentage in Excel invites misreading.

🔖 19. Cite This Tool

APA 7th
StatsUnlock. (2026). Margin of Error Calculator [Online tool]. https://statsunlock.com/margin-of-error-calculator/
MLA 9th
"Margin of Error Calculator." StatsUnlock, 2026, statsunlock.com/margin-of-error-calculator/.
Chicago
StatsUnlock. "Margin of Error Calculator." Accessed 2026. https://statsunlock.com/margin-of-error-calculator/.
BibTeX
@misc{statsunlock_moe, title={Margin of Error Calculator}, author={{StatsUnlock}}, year={2026}, url={https://statsunlock.com/margin-of-error-calculator/}}

🔗 20. Related Calculators

📖 21. Glossary

TermMeaning
Margin of errorHalf the width of a confidence interval. The plus-or-minus figure after an estimate.
Confidence intervalThe estimate plus and minus the margin of error. Carries exactly the same information.
Confidence levelHow often the procedure captures the true value across repeated samples. Conventionally 95%.
Standard errorThe standard deviation of the sampling distribution. The margin before the critical value is applied.
Critical valueThe multiplier, 1.96 for z at 95%, or a t value for a mean.
Sampling errorThe variation that arises purely from surveying a sample rather than everybody. The only thing the margin covers.
Non-sampling errorEverything else: non-response, coverage gaps, question wording, measurement error. Not in the margin.
Coverage errorError arising when the sampling frame does not include the whole target population.
Non-response biasError arising when the people who answer differ systematically from those who do not.
Sampling frameThe list from which the sample is actually drawn.
Probability sampleA sample where every member had a known, non-zero chance of selection. Required for a valid margin.
Convenience sampleA non-probability sample. Has no defensible margin of error at any size.
Finite population correction (FPC)√[(N−n)/(N−1)]. Narrows the margin when the sample is a large share of the population.
Sampling fractionn divided by N. The FPC matters once this exceeds about 5%.
Design effect (DEFF)How much a complex design inflates the variance relative to simple random sampling.
Effective sample sizen divided by the design effect. What your clustered sample is really worth.
Cluster samplingSampling groups such as households or schools rather than individuals. Cheaper and less precise.
Stratified samplingDividing the population into strata and sampling within each. Can be more efficient than simple random sampling.
Wald intervalThe standard textbook interval for a proportion. Fails near 0% and 100%.
Wilson score intervalA better interval for proportions that cannot produce impossible values. Asymmetric.
Clopper-Pearson intervalAn exact interval for a proportion. Guaranteed coverage but conservative.
Credibility intervalThe label used by some pollsters for non-probability panels, where a margin of error is not defensible.
Percentage pointThe unit of a margin on a percentage. ±3 points on 52% means 49% to 55%.
Point estimateThe single best estimate, at the centre of a symmetric interval.
WeightingAdjusting responses so the sample matches known population characteristics. Adds its own uncertainty.
Response rateThe proportion of those selected who provided a usable response. Often more informative about quality than the margin.
Bootstrap intervalAn interval built by resampling. Useful for medians and skewed data where a symmetric margin is wrong.

📚 22. References

  1. Wilson, E. B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158), 209-212. doi.org/10.1080/01621459.1927.10502953
  2. Brown, L. D., Cai, T. T., & DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101-133. doi.org/10.1214/ss/1009213286
  3. Agresti, A., & Coull, B. A. (1998). Approximate is better than "exact" for interval estimation of binomial proportions. The American Statistician, 52(2), 119-126. doi.org/10.1080/00031305.1998.10480550
  4. Newcombe, R. G. (1998). Two-sided confidence intervals for the single proportion: comparison of seven methods. Statistics in Medicine, 17(8), 857-872. doi.org/10.1002/(SICI)1097-0258
  5. Clopper, C. J., & Pearson, E. S. (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26(4), 404-413. doi.org/10.1093/biomet/26.4.404
  6. Cochran, W. G. (1977). Sampling Techniques (3rd ed.). Wiley. wiley.com
  7. Kish, L. (1965). Survey Sampling. Wiley. wiley.com
  8. Lohr, S. L. (2021). Sampling: Design and Analysis (3rd ed.). CRC Press. doi.org/10.1201/9780429298899
  9. Groves, R. M., et al. (2009). Survey Methodology (2nd ed.). Wiley. wiley.com
  10. Groves, R. M., & Peytcheva, E. (2008). The impact of nonresponse rates on nonresponse bias: A meta-analysis. Public Opinion Quarterly, 72(2), 167-189. doi.org/10.1093/poq/nfn011
  11. American Association for Public Opinion Research (2023). Standard Definitions: Final Dispositions of Case Codes and Outcome Rates for Surveys (10th ed.). aapor.org
  12. AAPOR Task Force (2013). Report on Non-Probability Sampling. American Association for Public Opinion Research. aapor.org
  13. Kennedy, C., et al. (2018). An Evaluation of the 2016 Election Polls in the United States. Public Opinion Quarterly, 82(1), 1-33. doi.org/10.1093/poq/nfx047
  14. Sturgis, P., et al. (2018). An assessment of the causes of the errors in the 2015 UK general election opinion polls. Journal of the Royal Statistical Society Series A, 181(3), 757-781. doi.org/10.1111/rssa.12329
  15. Cumming, G., & Finch, S. (2005). Inference by eye: Confidence intervals and how to read pictures of data. American Psychologist, 60(2), 170-180. doi.org/10.1037/0003-066X.60.2.170
  16. Greenland, S., et al. (2016). Statistical tests, p-values, confidence intervals, and power: A guide to misinterpretations. European Journal of Epidemiology, 31, 337-350. doi.org/10.1007/s10654-016-0149-3
  17. Neyman, J. (1937). Outline of a theory of statistical estimation based on the classical theory of probability. Philosophical Transactions of the Royal Society A, 236(767), 333-380. doi.org/10.1098/rsta.1937.0005
  18. Krejcie, R. V., & Morgan, D. W. (1970). Determining sample size for research activities. Educational and Psychological Measurement, 30(3), 607-610. doi.org/10.1177/001316447003000308
  19. Virtanen, P., et al. (2020). SciPy 1.0: Fundamental algorithms for scientific computing in Python. Nature Methods, 17, 261-272. doi.org/10.1038/s41592-019-0686-2
  20. Lumley, T. (2010). Complex Surveys: A Guide to Analysis Using R. Wiley. doi.org/10.1002/9780470580066
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Important Plots & Charts

Most Popular