Home/Blog/How to Calculate Sample Size for a Survey (With Formulas and Examples)
Back to Blog

How to Calculate Sample Size for a Survey (With Formulas and Examples)

August 24, 2026
9 min read
By DSTechnoverse
Statistics & Data Science

The actual arithmetic behind survey sample size — confidence level, margin of error, population proportion, finite population correction, design effect and non-response — with worked examples you can copy.

How to Calculate Sample Size for a Survey (With Formulas and Examples)

"How many people do we need to survey?" has a real answer, and it is arithmetic rather than opinion. This guide gives the formulas, the inputs, and worked examples for the cases that come up most — a general population survey, a small finite population, a cluster design, and a before-and-after comparison.

The Four Inputs

Every survey sample size calculation needs four decisions. Three you choose; one you estimate.

InputWhat it meansCommon value
Confidence levelHow often the interval would contain the truth on repeated sampling95% (z = 1.96)
Margin of errorHow precise the estimate must be, in percentage points±5%, ±3% for national surveys
Population proportion (p)The expected share holding the attribute0.5 when unknown — the safest value
Population size (N)Total in the group you are describingOnly matters when small

Using p = 0.5 is deliberate: it maximises variance, so it gives the largest — safest — sample. If you have solid prior data (say, 20% of households own the asset), use it and the required sample falls.

The Core Formula

For a large or unknown population, the sample size for estimating a proportion is:

n₀ = z² × p × (1 − p) / e²

Where z is the z-score for the confidence level, p is the expected proportion, and e is the margin of error as a decimal.

Worked example — a city-wide survey at 95% confidence, ±5%, p unknown:

n₀ = (1.96)² × 0.5 × 0.5 / (0.05)² = 3.8416 × 0.25 / 0.0025 = 384.16, rounded to 385 respondents

That 385 is the number behind almost every "we surveyed about 400 people" you have ever read. It holds whether the city has 200,000 people or 2 million — which surprises people, but the arithmetic does not include N at all until the population is small.

ConfidenceMargin of errorRequired n (p = 0.5)
90%±5%271
95%±10%97
95%±5%385
95%±3%1,068
95%±2%2,401
99%±5%664
99%±3%1,844

Notice the shape: halving the margin of error roughly quadruples the sample. That relationship — not the population size — is what drives survey budgets.

Small Populations: The Finite Population Correction

When you are surveying a defined, countable group — the 1,200 employees of a company, the 450 households in a resettlement area — the sample can be smaller:

n = n₀ / (1 + (n₀ − 1) / N)

Worked example — 450 households, 95% confidence, ±5%:

n = 385 / (1 + (385 − 1)/450) = 385 / 1.853 = 208 households

Population (N)Sample needed (95%, ±5%)
10080
500218
1,000278
5,000357
10,000370
100,000383
1,000,000 or more384

Above roughly 20,000 the correction stops mattering. Below 1,000 it matters a great deal, and ignoring it wastes money.

Cluster Sampling and the Design Effect

The formulas above assume simple random sampling. Real field surveys rarely work that way — you select villages, then households within villages, because sending enumerators to 385 randomly scattered addresses is not affordable.

Clustering costs you precision, because people in the same village are more alike than people drawn at random. You compensate with the design effect (DEFF):

n_cluster = n_SRS × DEFF, where DEFF = 1 + (m − 1) × ICC

  • m = average number of respondents per cluster
  • ICC = intra-cluster correlation, typically 0.02 to 0.15 for socio-economic variables

Worked example — 385 needed under SRS, 20 households per village, ICC = 0.05:

DEFF = 1 + (20 − 1) × 0.05 = 1.95, so n = 385 × 1.95 = 751 households, across roughly 38 villages.

A DEFF of 1.5 to 2.0 is normal for household surveys. Budgeting for the SRS number and then discovering you need double is one of the most common survey planning failures. Our guide on sampling methods for household surveys covers how to choose the cluster size that balances cost against DEFF.

Adding Non-Response

The formula gives you completed responses. To get there you must contact more people:

n_contact = n_required / expected response rate

ModeTypical response rateMultiplier
Face-to-face household (CAPI)75-90%1.1-1.3x
Telephone (CATI)20-40%2.5-5x
Online panel10-30%3-10x
Email to customer list5-15%7-20x
Intercept / exit survey30-60%1.7-3.3x

For 751 completed face-to-face interviews at an 85% response rate, sample 884 households. For the same target by email at 10%, you need a list of 7,510 — which is usually the point at which the mode gets reconsidered. See CATI, CAPI and paper survey methods compared.

Sample Size for Subgroups

This is where budgets actually break. A national sample of 1,068 gives ±3% overall — but if you need separate estimates for five states, each state needs its own adequate sample.

The rule: the margin of error depends on the size of the subgroup, not the total. If you plan to report on a subgroup, size that subgroup as if it were its own survey. Practical minimums:

Reporting needMinimum per subgroup
Headline percentage only100
Comparison between two subgroups200 each
Cross-tabulation within a subgroup300 or more

Listing every planned table before deciding the sample size takes an hour and routinely halves the number of surprises later.

Sample Size for Comparing Two Groups

If the survey is designed to detect a difference — before versus after, treatment versus control — the proportion formula is the wrong tool. You need a power calculation.

Sample size needed as effect size shrinks

For comparing two means, per group:

n = 2 × (z_α/2 + z_β)² × σ² / Δ²

At 95% confidence and 80% power, (1.96 + 0.84)² = 7.85, giving the familiar n ≈ 16 σ²/Δ² per group.

Effect size (Cohen's d)Per group (95%, 80% power)
Large (0.8)26
Medium (0.5)64
Small (0.3)175
Very small (0.2)394
Tiny (0.1)1,571

For comparing two proportions — 30% versus 40%, say — the requirement is around 356 per group at 80% power. The full logic is in statistical power and effect size, and the impact-evaluation case is covered in baseline and endline impact evaluation.

A Checklist Before You Commit

  1. What exactly is being estimated — a proportion, a mean, or a difference?
  2. What is the smallest difference that would change a decision?
  3. What subgroups will be reported separately?
  4. Is the design simple random or clustered? What DEFF applies?
  5. What is the realistic response rate for this mode and population?
  6. Is the sampling frame complete, and how will you handle the part of the population it misses?
  7. Have you budgeted for replacement of unreachable units?

Point 6 is worth dwelling on: a perfectly calculated sample drawn from an incomplete frame produces a precise estimate of the wrong population. Coverage error is not fixed by a bigger n.

Tools

The formulas above are simple enough for a spreadsheet, and building it yourself makes the assumptions explicit. For power calculations, pwr in R and statsmodels.stats.power in Python are reliable, and G*Power covers most designs with a GUI. For large official surveys, the UN household survey guidelines remain the standard reference on frames and design effects.

Frequently Asked Questions

How do you calculate sample size for a survey? Choose a confidence level, a margin of error and an expected proportion, then apply n = z²p(1−p)/e². Adjust for a small population with the finite population correction, multiply by the design effect if clustered, and divide by the expected response rate.

What is a good sample size for a survey? For a general population at 95% confidence and ±5%, about 385 completed responses. For ±3%, about 1,068. The right number depends on the precision you need and the subgroups you plan to report.

Does population size matter? Only below roughly 20,000. Above that, the required sample barely moves — a survey of India and a survey of a city of 100,000 need almost the same number for the same precision.

What sample size do I need for a 1,000-person population? 278 at 95% confidence and ±5%, using the finite population correction.

Why does 385 come up so often? It is z²p(1−p)/e² with 95% confidence, p = 0.5 and e = 5% — the default assumptions when nothing else is known.

What if I cannot reach the calculated sample? Report the achieved margin of error honestly, check whether non-respondents differ systematically from respondents, and consider weighting. Do not present a ±5% claim on a sample that supports ±8%.

How does margin of error relate to sample size? Inversely, through a square root. Four times the sample halves the margin of error.

What is the design effect and do I need it? It is the precision penalty for cluster sampling, typically 1.5-2.0 in household surveys. If your design selects groups rather than individuals, yes — you need it.

Should I use 90%, 95% or 99% confidence? 95% is the default. Use 99% when being wrong is expensive; it costs about 73% more sample for the same margin of error.

How many responses do I need for statistical significance? There is no fixed number. Significance depends on the effect size you are trying to detect — a large effect can be detected with 26 per group, a tiny one needs over 1,500.


Need the statistics done properly? DSTechnoverse runs study design, sample size calculation, hypothesis testing and reporting for research teams, businesses and PhD scholars — in R, Python, SPSS and Stata. We are based in Indore, Madhya Pradesh and work with clients across India. See our statistical research and data analysis and data analytics services, or talk to our team about your study.

Share

Tags

sample size for surveyshow do you calculate sample size for a surveysample size calculationmargin of errorconfidence levelsurvey methodologydesign effect

Explore More Articles

Discover more insights and updates from DSTechnoverse

View All Articles