Work out how large a sample you need before you run the survey: for estimating a proportion (like a poll) or a mean, given your confidence level and acceptable margin of error — with optional correction for a small population.
The variance p(1−p) is maximised at p = 0.5. If the true proportion is near 0.5 you need the most data; if you know it is nearer 0.1 or 0.9, a smaller sample achieves the same margin.
When your sample is a noticeable fraction of a finite population, sampling without replacement is more precise than the infinite-population formula assumes. The correction n_adj = n ÷ (1 + (n − 1) ÷ N) reduces the required sample for small populations.
Halving the margin quadruples the sample: ±5% needs 385, ±2.5% needs about 1,537, ±1% needs about 9,604 (all at 95%, p = 0.5). Precision is bought quadratically.
Barely, once the population is large — a country of 200 million needs almost the same 385 as a city of 200,000 for the same margin. Sample size is driven by the margin you demand, not population size.
Proportion: n = z² × p(1 − p) ÷ E², rounded up. Mean: n = (z × σ ÷ E)², rounded up. Finite population correction: n_adj = n ÷ (1 + (n − 1) ÷ N), rounded up. z comes from the confidence level (1.645 / 1.960 / 2.576).
Inputs: proportion, p = 0.5, E = 0.05, 95% (z = 1.96).
Steps: n = 1.96² × 0.5 × 0.5 ÷ 0.05² = 3.8416 × 0.25 ÷ 0.0025 = 0.9604 ÷ 0.0025 = 384.16 → round up to 385. With a population of 2,000: 385 ÷ (1 + 384 ÷ 2000) = 385 ÷ 1.192 = 322.99 → 323. Mean check: σ = 15, E = 5 → (1.96 × 15 ÷ 5)² = 5.88² = 34.57 → 35.
Result: 385 (or 323 in a town of 2,000); 35 for the mean case.
Add this calculator to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the calculator to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.