Browser-only calculator
Margin of error calculator
Estimate a survey percentage’s margin of error or work out a target sample size. Enter your assumptions below, then follow the example to see how the calculation works.
Model: z × √(p × (1 − p) × design effect ÷ n), multiplied by the finite-population correction √((N − n) ÷ (N − 1)) when a population is supplied. This estimates sampling variation; it does not correct selection bias, nonresponse, weighting instability, clustering not captured by the chosen design effect, multiple comparisons, or poor questions.
Calculator inputs remain in page memory and are not sent or written to site storage by this application. Ordinary page-request and security data are described in the Privacy notice.
The margin of error formula
For a proportion from a simple random sample, the approximate margin of error is z × √(p × (1 − p) / n). Here, p is the estimated proportion as a decimal, n is the number of completed responses, and z is the value for your chosen confidence level. Multiply by 100 to express the answer in percentage points. This formula assumes design effect 1 and no finite-population correction.
How to calculate margin of error, step by step
- Write the percentage as a decimal: 50% becomes 0.50.
- Multiply that proportion by one minus itself, divide by the sample size, and take the square root.
- Multiply by the confidence value, approximately 1.96 for 95%, then by 100 to get percentage points.
Worked example: with 400 responses, p = 0.50 and 95% confidence, calculate √(0.50 × 0.50 / 400) = 0.025. Multiply by approximately 1.96 to get 0.049, or ±4.9 percentage points. The calculator applies the selected population and design-effect adjustments when supplied; this example is a calculation, not collected survey data.
What changes when you increase the sample?
These calculated scenarios all use a 50% proportion, 95% confidence and no finite-population correction. They are planning examples, not observed survey results.
| Completed responses | Design effect | Effective sample | Margin in percentage points |
|---|---|---|---|
| 100 | 1 | 100 | ±9.80 |
| 400 | 1 | 400 | ±4.90 |
| 1,600 | 1 | 1600 | ±2.45 |
| 400 | 2 | 200 | ±6.93 |
Moving from 100 to 400 responses halves the modeled margin, from about 9.8 to 4.9 points. Halving it again requires 1,600 responses under the same assumptions. A design effect of 2 widens the margin for 400 responses to about 6.93 points. Recruiting more people does not remove a biased question or make an opt-in sample representative.
Is that enough precision for your decision?
If the decision depends on whether one message improves an outcome by three points, a ±4.9-point margin for one percentage does not settle it. Define the minimum worthwhile difference and use an analysis for the actual comparison. Do not subtract two separately reported margins or use the sample-size target here as a two-group power calculation.
Standard error versus margin of error
Standard error describes the modeled sampling variability of an estimate. Margin of error multiplies that standard error by a critical value for a chosen confidence level. In the example, the standard error is 2.5 percentage points and the 95% margin is approximately 4.9 points. Increasing confidence widens the margin for the same data. Neither quantity measures selection bias or proves a volunteer sample represents the population.
How to read the result
A result of ±4.9 points means an observed 50% share would have an approximate 95% interval from 45.1% to 54.9% under the stated model assumptions. It is not a guarantee that the true population value lies there, and it does not make a nonprobability sample representative.
How to estimate a target sample size
Enter the desired margin in percentage points, the confidence level, and your assumed proportion. With 95% confidence, a 50% planning proportion, a five-point margin, no finite population supplied, and design effect 1, the target is 385 completed responses. This rounds the normal-approximation result upward.
This target estimates precision for one proportion under the selected assumptions. It is not the sample size needed to detect a difference between two message versions. A comparison needs a separate power calculation using the expected baseline, minimum meaningful difference, allocation, and statistical test. Invitations and exclusions also require a separate recruitment allowance.
Why population and design effect matter
Sampling every member of a finite population leaves no sampling margin under this formula. Sampling only part of a population applies a finite-population correction when the population size is supplied. A design effect changes the nominal sample into an effective sample for the variance calculation; use a value other than one only when the actual design supports it.
Choose the next step
Need to budget invitations and exclusions? Use the survey sample recruitment planner. Comparing two independent groups? Use the message comparison calculator. For an opt-in sample, read sampling uncertainty and representativeness before reporting a population margin of error.
What it cannot repair
Margin of error describes modeled random sampling variation. It does not measure coverage error, nonresponse, panel conditioning, fraudulent respondents, biased wording, weighting instability, multiple testing, or the gap between a convenience sample and the intended population.