HomeStatistics & Probability › Margin of Error Calculator

Margin of Error Calculator

Computes the margin of error (half-width of the confidence interval) of a sample proportion from the sample size, confidence level and observed percentage, with an optional finite population correction.

When to use

You have poll or survey results (n respondents, x % answering a certain way) and need the ± margin at a confidence level.

Do not use when: You are still planning the survey and need the required sample size (use sample-size), or the statistic is a mean rather than a percentage (use confidence-interval).

Formula

margin = z · √(p (1 − p) / sample_size) × 100, with p = proportion_percent/100; with population_size N the margin is multiplied by √((N − sample_size) / (N − 1))

Normal (Wald) approximation to the binomial, standard in survey reporting; it is inaccurate when n·p or n·(1 − p) is below about 10 (very small samples or extreme percentages), where a Wilson interval should be used.

Inputs

ParameterTypeUnitRequiredDescription
sample_sizeintegeryesNumber of respondents or observations. Range: ≥ 1
confidence_level_percentnumber%default 95Confidence level in percent (commonly 90, 95 or 99). Determines the critical z value. Range: > 0
proportion_percentnumber%default 50Percentage of the sample with the attribute. 50 % gives the largest (most conservative) margin. Range: ≥ 0, ≤ 100
population_sizeintegernoOptional total population size N. When given, the finite population correction is applied; omit for large or unknown populations. Range: ≥ 2

Outputs

OutputTypeUnitDescription
z_valuenumberTwo-sided normal critical value for the confidence level.
standard_error_percentnumber%100 × √(p (1 − p) / n), after the finite population correction if applied.
margin_of_error_percentnumber%z_value × standard error, in percentage points.
lower_bound_percentnumber%proportion − margin (not truncated at 0).
upper_bound_percentnumber%proportion + margin (not truncated at 100).

Example

n = 1,000, 95 %, 50 %: {"sample_size":1000,"confidence_level_percent":95,"proportion_percent":50}{"z_value":1.96,"standard_error_percent":1.5811,"margin_of_error_percent":3.1,"lower_bound_percent":46.9,"upper_bound_percent":53.1}

n = 400, 99 %, 30 %: {"sample_size":400,"confidence_level_percent":99,"proportion_percent":30}{"z_value":2.5758,"standard_error_percent":2.2913,"margin_of_error_percent":5.9,"lower_bound_percent":24.1,"upper_bound_percent":35.9}

GET https://tttkmbb.com/api/v1/calculate/margin-of-error?sample_size=1000&confidence_level_percent=95&proportion_percent=50

Machine access

Sources

FAQ

Why do polls report ±3 %?

A sample of about 1,000 at 95 % confidence and p = 50 % gives 1.96 × √(0.25 / 1000) = 3.1 percentage points; the same sample gives a smaller margin for percentages far from 50 %.

Is the margin in percent or percentage points?

Percentage points: a result of 40 % with a ±3 % margin means 37 % to 43 %.

Related calculators