Go to app
GuidesSurveysHow to calculate the margin of error for your survey (free tool)

How to calculate the margin of error for your survey (free tool)

Last updated

12 May 2023


Dovetail Editorial Team

Surveys provide a telling glimpse of the mindset generally shared by a group, but it won't be a perfect match. Survey results produce what's called "random sampling error," and with a margin of error calculator, it's possible to gauge how accurate survey results really are. Used well, it can reduce guesswork by thinning the gap between survey sample data and the wider population it's meant to represent.

What is the margin of error in a survey?

Surveying a limited sample is usually the only feasible way to infer something about the whole, which begs the question: how accurately do survey results reflect the group? This is what the margin of error calculates, using the confidence interval to arrive at a range of likelihoods within a statistical probability.

A confidence interval is simply a percentage showing how statistically accurate a sample measurement likely is. Together, the margin of error and confidence interval show how reliable survey results are to truly reflect the wider population.

Mathematically speaking, the margin of error calculation uses a confidence interval to determine how closely a sample's observed score matches the true score of the population it was taken from.

Unless you survey the entire population, you can't obtain the true score. The closest you'll get is to run survey results through a margin of error calculator, which shows the lower and/or upper limits of a measurement (e.g., + or - 2%), based on a predetermined confidence level (e.g., 95%).

How do you calculate the margin of error?

As powerful as it can be, only a few measurements and variables go into a margin of error calculator. 

Physics, medicine, and other scientific fields often use margin of error when they don't have empirical data but still need to know how closely their more limited data approximates the real thing. In some cases, researchers can check the margin of error's accuracy against empirical data when it becomes available.

If it's good enough for astronomers and particle physicists, it's good enough for us! The margin of error calculator we've included crunches all the data for you. We'll also break the formula down, so you know exactly how it works and can create one yourself.

Margin of error calculator

Optimize your research’s impact when you improve the margin of error.


Margin of error

The total number of people whose opinion or behavior your sample will represent.

The probability that your sample accurately reflects the attitudes of your population. The industry standard is 95%.

The number of people who took your survey.


Margin of error

The margin of error formula

MOE = z × ( σ / √ n )

MOE = margin of error

z = z-score | σ = population standard deviation | n = sample size

Z, or the z-score, is another way of representing confidence level, which relates to the confidence interval—a range of expected answers that narrows with higher confidence levels (and vice versa). In this context, confidence basically means accuracy. It enables the researcher to say, "Our survey results were calculated with 90% accuracy."

The confidence level is expressed as a percentage, but for this equation, it must be written as a numeral/decimal. Use the table below to select the z-score that represents the desired confidence level.

Desired confidence level












Next, find out the population standard deviation, σ (the lowercase Greek letter "sigma"). Population standard deviation is itself a formula used to average multiple data sets and determine the data's variance (how widely the data is distributed—which gives a sense of how random the sample data is).

The σ calculation is as follows:

  1. Start by finding the mean of all values in your data set. Imagine we have four measurements of 3, 6, 9, and 12 inches. The mean is: (3 + 6 + 9 + 12) / 4  =  30 / 4  =  7.5

  2. Subtract the mean from each value: 7.5 - 3   =   4.5 7.5 - 6   =   1.5 7.5 - 9   =  -1.5 7.5 - 12 =  -4.5

  3. Square each of the above answers, resulting in 20.25, 2.25, 2.25, and 20.25.

  4. Sum these numbers together, which gets us 45.

  5. Next, divide by the number of values minus one—so 45 / (4-1) = 15. This is the "data variance."

  6. The square root of this number is the population standard deviation:   √15 = 3.873

How to calculate margin of error with your survey data

Let's put it all together. A 95% confidence level is the most common standard, so we'll use a z-score of 1.96. In our example above, σ was 3.873, and our sample size (n) was 4. The margin of error calculation would be:

MOE  =  1.96 × (3.873 / √4) 

                                  =  1.96 × 7.746 

                                  =  15.18 (or about 15%)

What we have is a key indication of how accurate our sample measurements were. In our example, we can say, with 95% confidence, that our four survey measurements have a margin of error of 15%. The population's true value has a 95% chance of falling within 15% more or less of the sample's observed mean value.

Our mean value was 7.5, and since 15% of 7.5 is 1.125, the margin of error is between:

7.5 ± 1.125  =  6.375 and 8.625

How sample size affects margin of error

A 15% allowance for error is quite high. It's largely because our survey only had four data points (and wide data variance), which isn't very good. For better results, we need more sample data.

A larger sample size results in higher accuracy and a lower margin of error. The sample can then be considered more representative of the larger group—or, said mathematically, the observed score would be more likely to match the true score (and within a narrower range).

Calculate your ideal sample size

How to reduce the margin of error in your survey results

Armed with your knowledge of the margin of error, you'll be able to design surveys for more reliable results. To achieve the slimmest margins of error and maximum accuracy, adjust your surveys and margin of error calculation in the following ways:

  • Reduce the variables

  • Increase total sample size

  • Use a lower confidence level

  • Use a one-sided confidence interval

The standard confidence interval is two-sided, meaning it uses a range with lower and upper values. If either of those limits is irrelevant, it's possible to use only the upper or lower value. The sample mean becomes the new opposite limit, essentially halving the margin of error.


How do you calculate sampling error?

While often used interchangeably, random sampling error is technically the known score minus the margin of error.

The difference between the terms "margin of error" and "random sampling error" is a matter of certainty. Margin of error is the statistic used to estimate the maximum possible sampling error, while random sampling error refers to the actual difference between the observed data and true data once it's known.

If you see the latter term when true data isn't available, it's likely a reference to the margin of error.

How to calculate standard error

The standard error is similar to the standard deviation, but it calculates how accurate the sample mean likely is rather than the full data set. The standard error formula is:

SE = σ / √ n

You'll notice that this is simply the part of the margin of error calculation not yet multiplied by the z-score.

How do you find a 95% margin of error?

When you talk about finding a "95% margin of error," what's usually meant is a "margin of error with 95% confidence." This is how we calculated the example above, which used a 95% confidence level (or 1.96 z-score).

A confidence level of 95% is a standard convention—but the beauty of the margin of error calculation is that you can easily adjust it to reflect higher or lower confidence levels.

Should you be using a customer insights hub?

Do you want to discover previous survey findings faster?

Do you share your survey findings with others?

Do you analyze survey data?

Start for free today, add your research, and get to key insights faster

Get Dovetail free

Editor’s picks

The ultimate 2024 guide to questionnaires (with example questions)

Last updated: 4 March 2023

12 survey question types with examples

Last updated: 22 February 2024

Survey analysis templates

Last updated: 13 May 2024

How to code & analyze open-ended questions

Last updated: 30 January 2024

Related topics

User experience (UX)Market researchPatient experienceCustomer researchSurveysResearch methodsEmployee experienceProduct development

Decide what to build next

Decide what to build next

Get Dovetail free


OverviewAnalysisInsightsIntegrationsEnterpriseChannelsMagicPricingLog in


About us
© Dovetail Research Pty. Ltd.
TermsPrivacy Policy

Log in or sign up

Get started for free


By clicking “Continue with Google / Email” you agree to our User Terms of Service and Privacy Policy