Skip to content
LoveToCalc

Definition — what does that mean?

Sample size for a proportion

How many people a survey has to ask to pin a percentage down to within a chosen margin of error.

In Swedish: Urvalsstorlek för en andel

Sample size for a proportion

The relation

n=z²p(1−p)E²

How large a sample has to be to pin a proportion down to a given margin of error at a given confidence level: the critical value squared, times the proportion times its complement, over the margin squared.

Solve for

n=322.6944

n equals (1.96 squared times (0.3 times (1 minus 0.3))) divided by 0.05 squared, equals (3.8416 times (0.3 times 0.7)) divided by 0.0025, equals (3.8416 times 0.21) divided by 0.0025, is approximately 0.8067 divided by 0.0025, equals 322.6944

Working5 steps

The formula

n = z² · p(1 − p) / E²

z is the z-value for the confidence level (1.96 for 95%, 2.576 for 99%), p the proportion you expect and E the margin of error, both as decimals.

95% confidence, margin ±5 percentage points, expected share 30%: n = 1.96² · 0.3 · 0.7 / 0.05² ≈ 322.7 — so 323 respondents. Always round up.

When you have no idea what p is

p(1 − p) is largest at p = 0.5, so that is the safe assumption: it gives the largest n, and any other true share only makes the result more precise.

Confidence Margin n at p = 0.5
95% ±5 points 385
95% ±3 points 1,068
99% ±3 points 1,844

Many opinion polls ask about a thousand people, which matches the middle row.

Precision is expensive

E is squared in the denominator: halving the margin of error takes four times as many respondents. Going from ±3 to ±1 point takes nine times as many — from about a thousand to over nine thousand.

The population size does not appear in the formula, which assumes the population is much larger than the sample. Then a thousand people pin down a share just as well in Sweden as in India, provided they are chosen at random.

Common mistakes

Questions people ask

How do I get the margin of error from n instead? Turn the formula round: E = z · √(p(1 − p) / n). With 1,000 respondents and p = 0.5 it is about ±3.1 points. The calculator solves for any of the four.

Does it work for averages too? Not this one. For a mean, replace p(1 − p) with the variance: n = z² · s² / E².

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
nz²p(1−p)E²1.96²·0.3(1−0.3)0.05²322.6944
znE²p(1−p)322.6944·0.05²0.3(1−0.3)1.96
p1−1−4nE²z²21−1−4·322.6944·0.05²1.96²20.3
Ezp(1−p)n1.960.3(1−0.3)322.69440.05

Last reviewed October 6, 2026 ·How pages are reviewed

Statistics and probabilityAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.