SuperDevTools

Sample size and margin of error calculator

Expected proportion: keep 50% if you have no idea of the result. It is the most cautious case, the one that needs the most respondents. Population: leave blank above a few hundred thousand people.

Respondents needed

—

Benchmarks: margin of error by number of respondents

RespondentsMargin of error
100—
400—
1000—
2000—

Confidence interval for a result

—

If the same survey were repeated many times, about 95% of the intervals built this way (at the 95% level) would contain the true value. The finite population correction applies when a population size is entered above.

Compare two proportions

—

Simple two-sample z-test for independent samples, using a pooled proportion. A non-significant difference does not prove there is no difference, and a significant one says nothing about its practical size.

Limitations

These calculations assume a random sample, where everyone in the population has the same chance of being asked. They only cover random error: they say nothing about bias (people you cannot reach, refusals, leading questions, badly built quotas, insincere answers), which can weigh far more than the margin of error.

Your last settings stay saved on this device, in this browser.

How many people should you survey?

This calculator answers the two questions behind every survey: how many respondents you need for a given margin of error, and what margin of error a fixed number of respondents gives you. Use it to plan a customer feedback survey, an employee survey or a dissertation questionnaire, or to judge a poll you read in the news.

How to use it

  1. Pick the "Sample size" or "Margin of error" tab.
  2. Set the "Confidence level": 90%, 95% or 99%, or "Other level" to type your own.
  3. Enter the "Desired margin of error (± points)" or the "Sample size (respondents)".
  4. Keep the "Expected proportion (%)" at 50% if you have no idea of the likely result.
  5. Fill in the "Population size" when it is small and known (staff of a company, students in a school); otherwise leave it blank.
  6. Add an "Expected response rate (%)" to see how many people to contact.

Below the main result you will find a benchmark table, a confidence interval for an observed result and a test that compares two proportions.

The formulas

For a very large population, the sample size is n0 = z² × p(1 − p) ÷ e², where z depends on the confidence level, p is the expected proportion and e the margin of error. When the population N is known, the finite population correction applies: n = n0 ÷ (1 + (n0 − 1) ÷ N), always rounded up. The other way round, the margin of error is e = z × √(p(1 − p) ÷ n).

The z value comes from the inverse of the normal distribution (algorithm AS 241): 1.644854 at 90%, 1.959964 at 95%, 2.575829 at 99%, and 1.281552 for a custom 80% level.

Worked examples

  • 95%, ±3 points, p = 50%, very large population: n0 = 3.8415 × 0.25 ÷ 0.0009 = 1,067.07, so 1,068 respondents.
  • Same settings for a population of 10,000: 1,067.07 ÷ (1 + 1,066.07 ÷ 10,000) = 964.27, so 965 respondents.
  • Staff survey in a company of 2,000 at 95% and ±5 points: 323 respondents. With a 40% response rate, invite 808 people.
  • 1,000 respondents at 95%: a margin of ±3.1 points at most. 400 respondents give ±4.9 and 2,000 give ±2.2.

To halve the margin of error, you need four times as many respondents.

Confidence interval and comparison

A candidate polling at 52% among 1,000 respondents lies, at 95%, in the interval [48.9%, 55.1%]: a majority is not guaranteed. The "Compare two proportions" block runs a simple z-test: 52% against 48%, each on 1,000 people, gives a 4-point gap, z = 1.79 and p = 0.074. At the 95% level, that gap is not significant.

What the numbers leave out

Everything assumes a random sample. The margin of error only measures sampling chance; it ignores bias such as people you cannot reach, refusals, leading questions or poorly built quotas, which often matter more.

FAQ

Why use 50% as the expected proportion?

The product p(1 − p) peaks at 50%, so it is the case that needs the most respondents. If you expect a result near 30%, the sample shrinks: 897 instead of 1,068 for ±3 points at 95%.

Does population size matter much?

Hardly, as long as the sample is small next to it. For ±3 points at 95%, you need 1,068 respondents for the whole country and 1,065 for a city of 500,000. The correction only makes a real difference for populations of a few thousand.

Why is my margin quoted in points, not percent?

The margin is added to and subtracted from a percentage, so ±3.1 means 3.1 percentage points: 52% becomes a range from 48.9% to 55.1%.

Are my settings saved?

Yes, on this device and in this browser. Nothing is sent anywhere: every calculation runs on the page.