Skip to content

Sample Size Calculator

How many people to survey for a given margin of error: proportions, means, finite populations and A/B tests.

Your details

Estimate

95 % is the usual choice; 99 % needs a larger sample.

%
%

Leave 50 % if you have no idea: it gives the largest, safest sample.

%

Leave blank for a large or unknown population.

%

Results update as you type

Required sample size

385

n₀ for an infinite population (unrounded)
384.15
Critical value z
1.96

Step-by-step solution
  1. n₀ = z²·p(1 − p) / e² = 1.96² × 0.5 × 0.5 / 0.05² = 384.15
  2. n = ⌈384.15⌉ = 385

Sample size by margin of error

Before launching a survey, an experiment or a quality check, you need to know how many observations are enough. Too few and the margin of error is so wide the result is useless; too many and you waste time and money. This calculator answers the question in three common situations:

  • Estimating a proportion — the share of customers who are satisfied, of voters who back a candidate, of parts that are defective. It uses Cochran’s formula and, if you enter the population size, the finite population correction.
  • Estimating a mean — the average spend per basket, the average blood pressure in a group, the mean filling weight of a bottle — from the standard deviation you expect.
  • Comparing two proportions — an A/B test or a two-arm study, where you want enough statistical power to detect a given difference.

You also get the critical value zz for your confidence level, the unrounded figures, and, if you expect only part of the people you contact to answer, the number of invitations to send.

Sample size is always rounded up: 384.15 respondents means 385, because 384 would not quite reach the target precision.

How to use this calculator

  1. Choose what you want to estimate: a proportion, a mean, or the difference between two proportions.
  2. Set the confidence level (95 % by default).
  3. For a proportion, enter the margin of error (±5 % is common) and the expected proportion (keep 50 % if unsure).
  4. For a mean, enter the expected standard deviation and the margin of error in the same unit.
  5. Optionally enter the population size when it is small (a school, a company), and the response rate you expect.
  6. For two proportions, enter both expected rates and the power (80 % is standard).

The table under a proportion result shows how the required sample shrinks as you accept a wider margin of error.

The formula

Proportion (Cochran). With critical value z=Φ−1(1−α/2)z = \Phi^{-1}(1 - \alpha/2), expected proportion pp and margin of error ee:

n0=z2 p (1−p)e2n_0 = \frac{z^2\,p\,(1 - p)}{e^2}

Mean. With expected standard deviation σ\sigma:

n0=(z σe)2n_0 = \left(\frac{z\,\sigma}{e}\right)^2

Finite population correction for a population of size NN:

n=n01+n0−1Nn = \frac{n_0}{1 + \dfrac{n_0 - 1}{N}}

Two proportions p1p_1 and p2p_2, two-sided test at level α\alpha with power 1−β1 - \beta, pˉ=(p1+p2)/2\bar{p} = (p_1 + p_2)/2, per group:

n=[zα/22pˉ(1−pˉ)+zβp1(1−p1)+p2(1−p2)]2(p1−p2)2n = \frac{\left[z_{\alpha/2}\sqrt{2\bar{p}(1 - \bar{p})} + z_{\beta}\sqrt{p_1(1 - p_1) + p_2(1 - p_2)}\right]^2}{(p_1 - p_2)^2}

The product p(1−p)p(1 - p) is largest at p=0.5p = 0.5, which is why 50 % is the conservative default.

Worked example

National survey. At 95 % confidence (z=1.96z = 1.96), with a ±5 % margin and p=0.5p = 0.5:

n0=1.962×0.5×0.50.052=384.15n_0 = \frac{1.96^2 \times 0.5 \times 0.5}{0.05^2} = 384.15

so you need 385 respondents. Many textbooks round zz to 1.96 and write 384.16; the answer is the same once rounded up. If only 30 % of the people you contact reply, send about 1284 invitations.

Company of 1,000 employees. The correction gives n=384.15/(1+(384.15−1)/1000)=277.73n = 384.15 / (1 + (384.15 - 1) / 1000) = 277.73, hence 278 employees.

Mean. To estimate an average test score within ±3 points when σ≈15\sigma \approx 15: n0=(1.96×15/3)2=96.04n_0 = (1.96 \times 15 / 3)^2 = 96.04, so 97 students.

A/B test. To detect a jump from 40 % to 60 % with 95 % confidence and 80 % power: n=96.92n = 96.92, so 97 per group, 194 in total.

How the inputs change the sample size

Change 95 %, ±5 %, p = 50 % → 385 becomes
99 % confidence 664
±3 % margin 1,068
p = 20 % instead of 50 % 246

Halving the margin of error multiplies the sample by four, because ee is squared. Raising the confidence from 95 % to 99 % adds about 73 %. Population size matters far less than people expect: once the population is above a few tens of thousands, the correction barely changes anything — a national poll of 60 million needs the same ~385 people as a city of 200,000.

Getting the inputs right

For pp, use a previous survey or a pilot; without information, 50 % guarantees the margin you asked for. For σ\sigma, use a pilot study or published data on a similar population; a rough rule is range ÷ 4. These formulas assume simple random sampling: a cluster or quota sample usually needs more people (a design effect of 1.5 to 2 is common). Afterwards, analyse your results with the confidence interval calculator and the point estimate calculator.

Frequently asked questions

Why is 385 the magic number for surveys?

It is the result of Cochran’s formula for 95 % confidence, a ±5 % margin of error and the worst-case proportion of 50 %, for a large population. Any survey with at least 385 random respondents meets that precision for every yes/no question.

Does a bigger population need a bigger sample?

Only slightly, and only for small populations. The precision of a random sample depends mainly on its size, not on the share of the population surveyed. The finite population correction reduces the sample when the population is small (1,000 → 278 instead of 385).

What margin of error should I choose?

±5 % is standard for opinion and satisfaction surveys, ±3 % for published polls, ±1–2 % when small differences matter. Smaller margins quickly become expensive: ±3 % needs 1,068 respondents, ±1 % more than 9,600.

What is statistical power?

Power is the probability that your study detects a difference that really exists. With 80 % power, a real difference of the size you entered is found 4 times out of 5; the rest of the time the test misses it (a type II error).

What if my response rate is low?

Divide the required sample by the expected response rate to know how many people to contact. Be aware that non-response can bias the results if those who answer differ from those who do not — a larger sample does not fix that.

Sources

Last updated:

More Statistics calculators

People also use