Toolvito

Works on this device

Margin of Error Calculator

Find the margin of error of a percentage from a poll or survey, or of a mean, at the confidence level you choose. You can add the population size, find the sample size you need for a target margin, or read the margin from an interval.

Enter your values

For a percentage from a sample, such as 52% of 1,000 people said yes.

Your values

The number of people or items in the sample.

Choose a count when you know how many in the sample gave the answer.

The share of the sample with the answer. Use 50% if you do not know it yet: it gives the largest margin.

How sure the interval should be. 95% is the usual choice; 90% and 99% are also common.

Leave it empty for a very large population. Fill it in when the sample is more than about 5% of the population.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to use this calculator

  1. Choose what you want to work out: the margin for a proportion, the margin for a mean, the sample size for a target margin, or the margin from an interval.
  2. Enter the sample size and the result of the sample. For a proportion you can type a percentage or a count such as 520 out of 1,000.
  3. Choose the confidence level. 95% is the usual choice.
  4. If the sample is a large part of a small population, type the population size. The finite population correction then makes the margin smaller.
  5. Choose Calculate. You get the margin, the interval, the working and the numbers used.

The formulas

  • Proportion: E = z × √(p̂ (1 − p̂) ÷ n). p̂ is the sample proportion and n the sample size.
  • Mean: E = t × s ÷ √n, with t from Student's t distribution with n − 1 degrees of freedom. With a known population standard deviation σ: E = z × σ ÷ √n.
  • z is the two-sided critical value of the normal distribution: 1.645 for 90%, 1.960 for 95%, 2.576 for 99%.
  • Finite population correction: multiply the standard error by √((N − n) ÷ (N − 1)), with N the population size.
  • Sample size: n₀ = z² p (1 − p) ÷ E² for a proportion, n₀ = (z σ ÷ E)² for a mean. With a population N: n = n₀ ÷ (1 + (n₀ − 1) ÷ N). Round up.
  • From an interval: E = (upper limit − lower limit) ÷ 2.

Worked example

A poll asks 1,000 people and 52% say yes. The standard error is √(0.52 × 0.48 ÷ 1,000) = 0.0157987. At 95%, z = 1.95996, so the margin of error is 1.95996 × 0.0157987 = 0.0309649, about 3.1 percentage points. The interval is 48.9% to 55.1%.

To plan a poll with a margin of 3 percentage points at 95%, with p = 50%: n₀ = 1.95996² × 0.25 ÷ 0.03² = 1,067.07, so you need 1,068 people. If the whole population is 5,000 people, n = 1,067.07 ÷ (1 + 1,066.07 ÷ 5,000) = 879.54, so 880 people are enough.

Related calculators

The margin for a proportion here uses the normal approximation (the Wald interval) that polls report. For small samples, or a proportion near 0% or 100%, use the Wilson or Clopper-Pearson interval of the Population Proportion Calculator.

The Finite Population Correction Calculator shows the correction factor and the corrected standard error on their own. For a sample split into groups (strata), use the Stratified Sampling Calculator.

Limits you should know

  • The margin covers only the chance error of a simple random sample. It does not cover people who did not answer, a sample that was not chosen at random, or bad questions.
  • The proportion margin is poor when n × p̂ or n × (1 − p̂) is below about 10. The page warns you then.
  • The sample size for a mean uses z, because t needs the sample size first. For small samples the real margin is a little larger.
  • Cluster samples and weighted samples need a design effect. This calculator does not include one.

Related tools