Free tool
Margin of error calculator
Convertica's free margin of error calculator gives the margin of error of a survey or poll percentage, the margin of error of a mean, and the sample size you need for a margin you choose. Each of the three shows the formula and the critical value it used.
Short answer
A margin of error calculator turns a sample size, a confidence level and a result into the plus or minus figure reported beside a survey number. Convertica's free margin of error calculator covers a percentage, a mean and the sample size for a target margin. For example, 1,000 responses give ±3.10 percentage points at 95% confidence.
- The margin of error is a critical value times a standard error: z × √(p(1 - p) / n) for a percentage, t × s / √n for a mean.
- Use 50% when you do not know the percentage. It gives the widest margin, so the figure is safe for every answer in the survey.
- Four times the sample halves the margin of error.
- Population size matters only when the sample is a noticeable share of the population.
- The margin of error measures random sampling error only. It says nothing about who was asked or how the question was worded.
Margin of error for a percentage
For a survey or poll answer, or a conversion rate. Free, no sign-up. The result updates as you type.
Margin of error at 95% confidence
±4.90 points
50% ± 4.90 percentage points is a range of 45.10% to 54.90%.
Critical value z = 1.9600 × standard error 2.50 points = 4.90 points.
50% is the widest case: every other result from this sample has a smaller margin of error.
To halve the margin to ±2.45 points you would need 1,600 responses.
Formula
E = z * sqrt(p(1 - p) / n)
E = z * sqrt(p(1 - p) / n) * sqrt((N - n) / (N - 1)) with a population of N
Margin of error for a mean
For an average: a rating, an order value, a time on task. From the standard deviation and the sample size.
Margin of error for the mean at 95% confidence
±0.417
Add it to and subtract it from your sample mean to get the 95% confidence interval. It is in the same units as your data.
Standard error: 2.100 ÷ √100 = 0.2100. Critical value: t = 1.9842 with 99 degrees of freedom.
Formula
E = t * s / sqrt(n) t from Student's t, n - 1 degrees of freedom
E = z * sigma / sqrt(n) when the population standard deviation is known
Sample size for a margin of error
The reverse calculation: how many responses a target margin of error needs, and how many people to invite.
Sample size for ±5 points at 95% confidence
385 responses
n = z² × p(1 - p) ÷ E² = 1.9600² × 0.2500 ÷ 0.05² = 384.15, rounded up to 385.
With 385 responses the margin of error is ±4.99 points.
Formula
n0 = z^2 * p(1 - p) / E^2 large population, rounded up
n = n0 * N / (n0 + N - 1) population of N, rounded up
invitations = n / response rate rounded up
How to use the margin of error calculator
Pick the calculator that matches what you have. A share of people who gave one answer is a percentage. A number averaged over people or orders is a mean. If the survey has not run yet and you know how precise it must be, start from the sample size calculator.
| You have | Example | Use |
|---|---|---|
| A percentage and the number of responses behind it | 62% said yes, a poll result, a conversion rate | Margin of error for a percentage |
| An average, its standard deviation and the sample size | A mean rating, average order value, time on task | Margin of error for a mean |
| A margin of error you want to reach | Planning a survey to within 5 points | Sample size for a margin of error |
- Enter the sample size. Count completed responses, not invitations sent.
- Enter the result, or leave 50% in place to get the widest margin the sample can have.
- Set the confidence level. 95% is the convention. Any level above 0% and below 100% works.
- Add the population size only if the sample is a noticeable share of it, such as 400 people from a list of 2,000.
- Read the margin, then the range, the critical value and the standard error in the lines under it.
What is the margin of error?
The margin of error is the plus or minus figure attached to a result from a sample. It says how far the result could sit from the true figure for the whole population, through the luck of who was sampled. A result of 50% with a margin of error of 4.90 points means a range of 45.10% to 54.90%.
It always comes with a confidence level. At 95%, ranges built this way contain the true figure in about 95% of repeated samples. It is a statement about the method, not a promise about one survey: about one sample in twenty lands outside its own margin.
What is the margin of error formula?
The margin of error formula is a critical value multiplied by the standard error. For a percentage that is z × √(p(1 - p) / n), where p is the proportion, n is the sample size and z comes from the confidence level: 1.9600 at 95%. For a mean it is t × s / √n.
margin of error = critical value * standard error
percentage E = z * sqrt(p(1 - p) / n)
mean E = t * s / sqrt(n) t with n - 1 degrees of freedom
population multiply either by sqrt((N - n) / (N - 1)) when the sample is a large share of N
Worked example: 400 survey responses
400 people answer a yes or no question. These are the default values in the first calculator, made up to show the arithmetic.
- Take p as 0.50. Then p(1 - p) / n = 0.50 × 0.50 / 400 = 0.000625.
- The square root is the standard error: 0.0250.
- The critical value for 95% confidence is z = 1.9600.
- Margin of error: 1.9600 × 0.0250 = 0.0490, or 4.90 percentage points.
A higher confidence level needs a larger critical value, so the same sample gives a wider margin:
| Confidence level | z | 400 responses | 1,000 responses |
|---|---|---|---|
| 80% | 1.2816 | ±3.20 points | ±2.03 points |
| 90% | 1.6449 | ±4.11 points | ±2.60 points |
| 95% | 1.9600 | ±4.90 points | ±3.10 points |
| 98% | 2.3263 | ±5.82 points | ±3.68 points |
| 99% | 2.5758 | ±6.44 points | ±4.07 points |
| 99.9% | 3.2905 | ±8.23 points | ±5.20 points |
Why use 50% when you do not know the percentage?
Use 50% because it gives the largest margin of error a sample can have. The formula depends on p(1 - p), which peaks at 0.25 when p is 50% and shrinks toward either end. A margin calculated at 50% is therefore safe for every question in the survey, whatever the answers turn out to be.
| Result | p(1 - p) | Margin of error |
|---|---|---|
| 50% | 0.2500 | ±4.90 points |
| 40% or 60% | 0.2400 | ±4.80 points |
| 30% or 70% | 0.2100 | ±4.49 points |
| 20% or 80% | 0.1600 | ±3.92 points |
| 10% or 90% | 0.0900 | ±2.94 points |
| 5% or 95% | 0.0475 | ±2.14 points |
This is why a poll reports one margin for the whole survey: it is the 50% figure. Once you have a result, enter it to get the margin for that question. Near 0% or 100% the formula stops being reliable, and the first calculator says so when fewer than 10 answers are expected on one side.
Does population size change the margin of error?
Population size changes the margin of error only when the sample is a noticeable share of the population. The margin depends on how many people answered, not on how many exist: 400 responses give ±4.90 points for a city or a country. Sampling a large part of a small group shrinks it, through the finite population correction.
The correction is √((N - n) / (N - 1)), where N is the population. Say the 400 responses came from a customer list of 2,000: √(1,600 / 1,999) = 0.8947, and the margin falls from ±4.90 to ±4.38 points.
| Population | Share sampled | Correction | Margin of error |
|---|---|---|---|
| 500 | 80% | 0.4477 | ±2.19 points |
| 1,000 | 40% | 0.7750 | ±3.80 points |
| 2,000 | 20% | 0.8947 | ±4.38 points |
| 5,000 | 8% | 0.9593 | ±4.70 points |
| 20,000 | 2% | 0.9900 | ±4.85 points |
| 1,000,000 | 0.04% | 0.9998 | ±4.90 points |
The correction assumes each person can be sampled only once. It suits a survey of a fixed list: customers, employees, members. It does not suit website visitors, where the population keeps arriving.
How do you calculate the margin of error for a mean?
To calculate the margin of error for a mean, divide the standard deviation by the square root of the sample size to get the standard error, then multiply by the t critical value for n - 1 degrees of freedom. The result is in the same units as the data: points on a rating scale, dollars, seconds.
Worked example: a rating question
100 people rate a checkout from 1 to 10 in a survey after their order. The mean is 7.4 and the standard deviation is 2.1. These are example values.
- Standard error: 2.1 / √100 = 2.1 / 10 = 0.21.
- Degrees of freedom: 100 - 1 = 99. The t critical value for 95% is 1.9842.
- Margin of error: 1.9842 × 0.21 = 0.417.
- Report the mean as 7.4 ± 0.42, a range of 6.98 to 7.82.
With z (1.9600) the margin would be 0.412: nearly the same, because 100 is a fair sample. The gap opens with small samples. With 10 responses and the same standard deviation, t is 2.262 and the margin is 1.50. The z formula would report 1.30, which understates the uncertainty, because it ignores that the standard deviation is itself an estimate.
The method assumes a random sample and a sample mean that is close to normally distributed. Skewed data, such as order values with a few very large orders, need a larger sample before the margin can be trusted.
What sample size do you need for a given margin of error?
The sample size for a margin of error is z² × p(1 - p) / E², rounded up, where E is the margin you want as a fraction. For 5 percentage points at 95% confidence, with p at 50%, that is 385 responses. Halving the margin takes four times as many.
Worked example: a survey to within 5 points
- z for 95% is 1.9600, so z² = 3.8415.
- With p at 0.5, p(1 - p) = 0.25. E is 0.05, so E² = 0.0025.
- 3.8415 × 0.25 / 0.0025 = 384.15. Round up: 385 responses. Always round up, or the margin is slightly missed.
- If the population is only 2,000: 384.15 × 2,000 / (384.15 + 1,999) = 322.39, so 323 responses.
- If about 20% of the people you invite answer, 323 responses need 323 / 0.2 = 1,615 invitations.
| Margin of error | 90% confidence | 95% confidence | 99% confidence |
|---|---|---|---|
| ±10 points | 68 | 97 | 166 |
| ±5 points | 271 | 385 | 664 |
| ±4 points | 423 | 601 | 1,037 |
| ±3 points | 752 | 1,068 | 1,844 |
| ±2 points | 1,691 | 2,401 | 4,147 |
| ±1 point | 6,764 | 9,604 | 16,588 |
The response rate in step 5 is an example. Use the rate your own past surveys reached, not one from a report. For a mean, the same idea gives n = (z × s / E)²: to pin the rating above down to ±0.25 with a standard deviation of 2.1, that is 271.05, so 272 responses.
This is the sample size for describing one group. A test that compares two versions of a page needs a different calculation, because it must also have the power to detect a difference: use the A/B test sample size calculator for that.
How large is the margin of error on a conversion rate?
The margin of error on a conversion rate is larger than it looks, because the rate itself is small. A 3% rate from 1,000 visitors has a margin of ±1.06 percentage points at 95% confidence: a range of 1.94% to 4.06%. Measured against the rate, that is about ±35%.
So the useful question for a conversion rate is the relative one: how many visitors before the rate is known to within a share of itself? The table answers it for three example rates. They illustrate the arithmetic. They are not benchmarks.
| Conversion rate | Within ±50% of the rate | Within ±25% of the rate | Within ±10% of the rate |
|---|---|---|---|
| 1% | 1,522 | 6,085 | 38,031 |
| 3% | 497 | 1,988 | 12,421 |
| 10% | 139 | 554 | 3,458 |
The lower the rate, the more visitors it takes. A rate read off a slow week, a small segment or a new landing page can easily sit in the left-hand column or worse.
Why an early A/B test reading misleads
Take a test with 500 visitors in each version: 15 conversions on the control (3.0%) and 20 on the variant (4.0%). The dashboard shows the variant 33% ahead. The margins of error are ±1.50 and ±1.72 points, each wider than the 1.0 point gap between the two.
The margin of error on the difference itself is ±2.28 points, so the data fit anything from the variant being 1.3 points worse to 3.3 points better. That is not a result yet. Do not judge a test by comparing two margins by eye either: the statistical significance calculator tests the difference directly, and the A/B test sample size calculator tells you before you start how many visitors the test needs.
For a rate built on few conversions, the formula on this page is rough. The confidence interval calculator uses the Wilson interval for a proportion, which stays reliable with small counts.
How many responses does an on-site poll need?
An on-site poll needs enough responses for its margin of error to be smaller than the difference you care about. With 50 responses the margin is ±13.9 points, so a two-way split must pass 63.9% before it can be told from an even one. With 400 responses, 54.9% is enough.
| Responses | Margin of error | Share needed |
|---|---|---|
| 25 | ±19.6 points | More than 69.6% |
| 50 | ±13.9 points | More than 63.9% |
| 100 | ±9.8 points | More than 59.8% |
| 200 | ±6.9 points | More than 56.9% |
| 400 | ±4.9 points | More than 54.9% |
| 1,000 | ±3.1 points | More than 53.1% |
An exit survey or a one-question poll on a page can close with only a few dozen answers. The table shows what that buys: a clear majority is readable, a close call is not. At the smallest sizes the formula is itself approximate, so treat the first rows as a guide.
The lead between two answers has its own, larger margin
When a poll has several options, the question is usually whether one is ahead of another. Both shares come from the same people, so when one is too high by chance the other tends to be too low. The margin of error on the lead is √((p1 + p2 - (p1 - p2)²) / n) times the critical value.
- 400 visitors answer. Option A gets 46% and option B gets 40%: a lead of 6 points. The margin on A alone is ±4.88 points.
- p1 + p2 - (p1 - p2)² = 0.86 - 0.0036 = 0.8564. Divided by 400, its square root is 0.0463.
- Margin on the lead: 1.9600 × 0.0463 = ±9.07 points, so the true gap could be anywhere from B ahead by 3.1 points to A ahead by 15.1.
A 6 point lead that looked safely outside a 4.88 point margin is well inside the margin that applies to it. Pew Research Center makes the same point about election polls in its guide to the margin of error: the margin for the gap between two candidates is about twice the margin for one.
A Net Promoter Score is a lead of exactly this kind, promoters minus detractors from one sample, so it carries the larger margin too. The NPS calculator works out the score and that margin.
What does the margin of error leave out?
The margin of error covers random sampling error only: the luck of who happened to be in the sample. It assumes a simple random sample. It does not measure who was never asked, who chose not to answer, or how the question was worded. Those errors do not shrink with a bigger sample.
- Who answers. A poll on a pricing page hears from visitors who reached that page and chose to reply. The margin describes how well the poll measures people like them, not all customers.
- Subgroups. The headline margin belongs to the whole sample. A segment of 80 within a survey of 400 has a margin of ±10.96 points, not ±4.90. Run the calculator again with the segment's own size.
- Weighting. A survey that weights its responses to match a population usually has a larger margin than this formula gives.
- One in twenty. At 95% confidence, about 5% of samples miss by more than their margin. A surprising result is worth repeating before acting on it.
Margin of error vs confidence interval
The margin of error is half the width of a confidence interval. The confidence interval is the range, such as 45.10% to 54.90%. The margin of error is the distance from the middle of that range to either end, here 4.90 points. Both come from the same critical value and standard error, so one gives you the other.
The plus or minus form assumes the range is symmetric around the result. For a percentage near 0% or 100%, or one built on few responses, a better interval is not symmetric. Convertica's confidence interval calculator gives the full interval for a mean and a Wilson interval for a proportion from the raw counts.
How to calculate the margin of error in Excel or Google Sheets
To calculate the margin of error in Excel or Google Sheets, multiply NORM.S.INV, which returns the z critical value, by the standard error typed out as a formula. For a mean, CONFIDENCE.T returns the margin of error directly. With the sample size in A1, the proportion in B1 as a decimal and the confidence level in C1 as a decimal, these work in both.
| You want | Formula |
|---|---|
| z critical value | =NORM.S.INV(1-(1-C1)/2) |
| Margin of error for a percentage | =NORM.S.INV(1-(1-C1)/2)*SQRT(B1*(1-B1)/A1) |
| The same, with a population size | =NORM.S.INV(1-(1-C1)/2)*SQRT(B1*(1-B1)/A1)*SQRT((D1-A1)/(D1-1)) |
| Margin of error for a mean, using t | =CONFIDENCE.T(1-C1,E1,A1) |
| Margin of error for a mean, using z | =CONFIDENCE.NORM(1-C1,E1,A1) |
| Sample size for a target margin | =ROUNDUP(NORM.S.INV(1-(1-C1)/2)^2*B1*(1-B1)/F1^2,0) |
The percentage formulas return a fraction: 0.049 is 4.9 percentage points. Format the cell as a percentage to read it that way.
Related calculators
A margin of error says how precise one number is. These tools cover the questions next to it.
A margin of error tells you how well a number is measured, not why it is what it is. Convertica's free CRO audit looks at the page behind the number: eight checks, each scored out of 100, and three fixes to make first. See all free tools and how they fit together.
Margin of error calculator FAQ
What does a margin of error calculator do?
A margin of error calculator works out how far a result from a sample could plausibly be from the true figure for the whole population, at a confidence level you choose. This one gives the margin for a survey percentage, the margin for a mean, and the sample size needed to reach a margin you set, and shows the formula and critical value each time.
What is the margin of error for a sample of 1,000?
A sample of 1,000 has a margin of error of ±3.10 percentage points at 95% confidence, taking the percentage as 50%, the widest case. At 90% confidence it is ±2.60 points and at 99% it is ±4.07 points. This assumes a simple random sample from a large population.
How many responses do I need for a 5% margin of error?
385 responses give a margin of error of 5 percentage points at 95% confidence, with the percentage taken as 50% and a large population. A margin of 3 points needs 1,068 responses and 1 point needs 9,604. A small population needs fewer: 323 for 5 points from a population of 2,000.
What is a good margin of error?
There is no figure that is good for every survey. A margin of error is small enough when it is smaller than the smallest difference that would change your decision. If a result of 55% and a result of 45% would lead to the same action, a wide margin is fine. If two points matter, you need a margin under two points.
Is the margin of error the same as the standard error?
No. The standard error is the typical distance between a sample result and the true figure. The margin of error is the standard error multiplied by a critical value, 1.96 for 95% confidence, so that the range covers the true figure in about 95% of samples. At 95% confidence the margin of error is about twice the standard error.
When should I use t instead of z for the margin of error of a mean?
Use t whenever the standard deviation was calculated from the sample, which is nearly always. Use z only when the population standard deviation is known in advance. The difference matters for small samples: with 10 observations the 95% t value is 2.262, not 1.96. Percentages use z.
Can I put a margin of error on a conversion rate?
Yes. A conversion rate is a percentage of visitors, so the same formula applies. A 3% rate measured on 1,000 visitors has a margin of error of ±1.06 percentage points at 95% confidence, which is about 35% of the rate itself. For rates built on only a handful of conversions, use a Wilson interval on the counts.