🧮
🧮 Math & statistics

Sample Size Calculator (survey, margin of error)

Results update as you type.

Your numbers

Understanding the sample size calculator — concept and principle

Before running a survey or poll, you need to know how many responses are enough to estimate a percentage within a chosen margin of error. This calculator answers that question for a proportion, such as the share of customers who are satisfied or voters who support a proposal, with an optional correction when the population is small.

Survey sample size for a ±5% margin1.96² × 0.5 × 0.5 ÷ 0.05² = 384.15, rounded up to 385 people. Halving the margin to ±2.5% needs four times as many, 1,537.How many people to ask?1.96²= 3.8415×0.5 × 0.5p(1−p) = 0.25÷0.05²margin ±5%= 384.15 → always round up±5%385 people±2.5%1,537 peopleHalf the margin → 4× people
At 95% confidence and ±5%, 385 respondents are enough; halving the margin costs four times as many.

How it is calculated

The principle

The margin of error of a proportion is z × √[p(1 − p)/n]. Setting that equal to e and solving for n gives the formula. The term p(1 − p) is largest at p = 0.5 (value 0.25), so assuming 50% gives the most conservative, largest sample when you have no prior estimate. When you sample a large share of a finite population, each response removes more uncertainty, which is what the correction factor captures.

Worked example

  1. Inputs: confidence 95%, margin 5%, expected proportion 50%, population 0 (infinite).
  2. z = 1.959964, so z² = 3.841459.
  3. n₀ = 3.841459 × 0.5 × 0.5 ÷ 0.05² = 0.960365 ÷ 0.0025 = 384.15.
  4. Round up: 385 respondents.
  5. Because the population is infinite, the infinite-population n is also 385.
How Sample size changes with Population (0 = infinite)How Sample size changes with Population01002003004000123456Example: 3Population (0 = infinite)
Each point is the calculator re-run with only “Population (0 = infinite)” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Population (0 = infinite)Sample size
0385
11
22
33
44
55
66

How to read the result

385 is the number of completed, usable responses, not the number of invitations. If you expect a 20% response rate, you need to contact about 385 ÷ 0.20 ≈ 1,925 people. Precision is costly: halving the margin to 2.5% roughly quadruples n to 1,537, and moving to 99% confidence at 5% raises it to 664. For a population of 10,000 the correction lowers 385 to 370.

Common mistakes

Keep in mind: The formula assumes simple random sampling. Cluster or stratified designs, weighting and non-response change the required size, often upward (the design effect).

Frequently asked questions

Why is 385 so common in survey guides?

It is the result for 95% confidence, ±5% and p = 50%, the most frequently used default.

Does a population of 1 million need a larger sample than 100,000?

Barely. Once the population is much larger than the sample, size hardly matters; precision depends mainly on n.

Should I use a different p than 50%?

If a reliable earlier study suggests, say, 20%, using it gives a smaller n (246 at 95% and ±5%). Use 50% if unsure.

Sources: Cochran, W. G. (1977). Sampling Techniques (3rd ed.). Wiley. · NIST/SEMATECH e-Handbook of Statistical Methods.

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

</> Add this calculator to your website (free)

Copy this code into your blog or site. It is free to use; please keep the credit link.

Preview
🧮 All math & statistics tools →🌍 Calculators by country →