Sampling Error Calculator
Enter your sample size, confidence level, and either a proportion or a standard deviation to get the sampling error (margin of error) instantly. The calculator handles both proportion surveys and mean estimates, applies the t-distribution for small samples, and can correct for finite populations. Your confidence interval updates as you type.
Formula
Worked example
A poll of 400 people finds that 60% (p = 0.60) support a policy. At 95% confidence (z = 1.96): SE = sqrt(0.60 x 0.40 / 400) = 0.0245. Sampling error = 1.96 x 0.0245 = 4.80%. The 95% confidence interval is 55.2% to 64.8%.
What is sampling error?
Sampling error is the difference between a statistic calculated from a sample and the true value of the parameter in the whole population. Because we survey or measure only a subset of the population, our estimate will rarely hit the true value exactly. Sampling error quantifies how far off we might be: a sampling error of 3% means that, at the chosen confidence level, the true population value is likely within 3 percentage points of the sample estimate. It is sometimes called the margin of error, especially in survey reporting. Crucially, sampling error does not capture mistakes in data collection, question wording bias, or non-response bias. It captures only the randomness inherent in drawing a sample.
Proportion vs. mean: which formula to use?
Use the proportion formula when your outcome is categorical, such as the share of voters who prefer a candidate, the fraction of products that are defective, or the proportion of respondents who agree with a statement. The standard error is sqrt(p*(1-p)/n), and the worst case occurs at p = 0.5. Use the mean formula when your outcome is continuous, such as average income, blood pressure, or test scores. If you know the population standard deviation (sigma), use z; if you only have the sample standard deviation (s), use the t-distribution, especially for small samples. The t-distribution has heavier tails than the normal distribution, so it produces a larger (more conservative) margin of error when the sample is small.
How to reduce sampling error
Sampling error shrinks as sample size grows, but with diminishing returns: doubling n reduces the error by a factor of sqrt(2) - about 29%. To halve the error you need to quadruple the sample. A higher confidence level widens the interval (more certainty requires a wider net), while a lower one narrows it. If the population is small and you have measured a large fraction of it, the finite population correction (FPC) can substantially reduce the error, because you have already captured most of the variability that exists. The FPC factor is sqrt((N - n)/(N - 1)), which approaches 1 when N is large relative to n, and approaches 0 when n is close to N.
Sampling error vs. standard error vs. margin of error
These three terms are closely related but not identical. The standard error is the standard deviation of the sampling distribution, that is, the spread of estimates you would get if you repeated the sampling process many times. It equals sigma/sqrt(n) for means, or sqrt(p*(1-p)/n) for proportions. The margin of error is the standard error multiplied by the critical value (z or t), so it incorporates both the spread of the sampling distribution and the required confidence level. Sampling error is often used interchangeably with margin of error in survey contexts, though strictly it can also refer to any error arising from observing a sample rather than the whole population. In this calculator, "sampling error" and "margin of error" refer to the same quantity: critical value multiplied by standard error.
Common z-scores and confidence levels
| Confidence level | z-score | Interpretation |
|---|---|---|
| 80% | 1.282 | 1 in 5 intervals miss the true value |
| 85% | 1.440 | 15 in 100 intervals miss the true value |
| 90% | 1.645 | 1 in 10 intervals miss the true value |
| 95% | 1.960 | Standard for most published research |
| 99% | 2.576 | High-stakes or medical research |
| 99.9% | 3.291 | Near-certainty; used in quality control |
Critical values (z-scores) used to compute the sampling error for different confidence levels. For small samples use the t-table instead.
Frequently asked questions
What is a good sampling error?
In most survey and market-research contexts, a margin of error of 5% or less at 95% confidence is considered acceptable. Polls and political surveys typically target 3%, requiring roughly 1,067 respondents with p = 0.5. Academic and medical research may require 1% or tighter, while internal quick-polls may tolerate 10%. The "right" level depends on the stakes of the decision and the cost of collecting more data.
Why does using p = 0.5 give the largest margin of error?
The variance of a proportion is p*(1 - p), which is maximised at p = 0.5 (giving 0.25) and decreases symmetrically toward 0 and 1. When you do not yet know the true proportion, setting p = 0.5 gives a conservative (worst-case) estimate that guarantees the sample will be large enough regardless of what the true value turns out to be. This is the standard practice for pre-survey sample size planning.
When should I use the t-distribution instead of z?
Use the t-distribution when you do not know the population standard deviation and are estimating it from the sample, especially when n is below 30. As degrees of freedom (n - 1) grow, the t-distribution approaches the normal distribution, so at n >= 120 the difference is negligible. The t-distribution always gives a wider (more conservative) interval than z for the same confidence level, which is correct because you are carrying additional uncertainty about the population spread.
What is the finite population correction (FPC)?
The FPC adjusts the margin of error downward when your sample is a meaningful fraction of the population. The standard formula assumes the population is effectively infinite. If you survey 400 out of a population of 600, for example, you have covered two-thirds of everyone, so the uncertainty is much lower than the standard formula suggests. The FPC factor is sqrt((N - n)/(N - 1)). It approaches 1 when N is large relative to n (no meaningful correction), and approaches 0 as n approaches N (near-census). A rule of thumb is to apply it when n exceeds 5% of N.
How do I calculate a confidence interval from the sampling error?
The confidence interval is simply: [sample estimate - sampling error, sample estimate + sampling error]. For a proportion of 0.60 with a sampling error of 0.04, the 95% confidence interval is [0.56, 0.64], or 56% to 64%. The interval captures the range of population values consistent with your sample data at the chosen confidence level.
Does a larger confidence level give a smaller sampling error?
No, it is the opposite. A higher confidence level requires a larger critical value (e.g. z = 2.576 at 99% vs. 1.960 at 95%), which multiplies the standard error and produces a wider interval. Choosing 99% confidence instead of 95% increases the margin of error by about 31%. Higher confidence = wider net.
How many people do I need to survey for a 3% margin of error?
Using p = 0.5 (worst case) and 95% confidence: n = (1.96 / 0.03)^2 * 0.25 = 1,068. For a 5% margin the same formula gives n = 385. For a 1% margin you would need about 9,604 respondents. These are minimum sizes for an infinite population; the FPC can reduce them when the population is small.