Home/Blog/How to Calculate Sample Size for a Survey: Formula, Examples and Adjustments
Back to Blog

How to Calculate Sample Size for a Survey: Formula, Examples and Adjustments

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

The complete sample size calculation for surveys: Cochran's formula, confidence level, margin of error, finite population correction, design effect, non-response, subgroups and comparing two groups, with every worked example shown step by step.

How to Calculate Sample Size for a Survey: Formula, Examples and Adjustments

Quick answer: To work out how to calculate sample size for a survey, pick a confidence level (usually 95%, z = 1.96), a margin of error (often ±5%) and an expected proportion (0.5 if unknown), then apply Cochran's formula n0 = z² × p × (1 − p) / e². That gives 384.16, rounded up to 385 completed responses. Correct it for a small population, multiply by the design effect if you sample in clusters, and divide by the expected response rate.

"How many people do we need to survey?" has a real answer, and it is arithmetic rather than opinion. Too small a sample and your estimates are too vague to act on, or your study is underpowered and misses a real difference. Too large and you spend time and money buying precision nobody needed. This guide explains how to calculate sample size for a survey from first principles: the sample size formula, its inputs, worked examples with the arithmetic shown, the adjustments field surveys need, comparing two groups, and building your own sample size calculator.

Why Sample Size Calculation Matters

A survey sample size is a design decision, made before a single questionnaire is printed. Getting it wrong has predictable consequences:

  • Too small: the margin of error is wider than you promised, subgroup figures are unusable, and any comparison is underpowered. A non-significant result from a small study is uninformative rather than reassuring.
  • Too large: fieldwork costs rise in proportion, enumerator quality often falls as teams are stretched, and trivial differences may be flagged as "significant" simply because the sample is huge.
  • Unjustified: even a sensible number is a problem if its assumptions are not written down. Ethics committees, funders and reviewers ask for the calculation, not just the result.

The aim is the right size: big enough to answer the question, and no bigger.

The Four Inputs to a Survey Sample Size

Every survey sample size calculation for estimating a percentage needs four decisions. Three you choose; one you estimate.

InputWhat it meansCommon value
Confidence levelHow often an interval built this way would contain the true value on repeated sampling95% (z = 1.96)
Margin of error (e)How precise the estimate must be, in percentage points either side±5%; ±3% for national surveys
Expected proportion (p)The share of the population you expect to hold the attribute0.5 when unknown, the safest value
Population size (N)The total number in the group you are describingOnly matters when it is small

Confidence Level and Its z-Score

The confidence level is converted to a z-score from the standard normal distribution. The three you will meet most often are:

Confidence levelz-scorez²
90%1.6452.706
95%1.9603.842
99%2.5766.635

95% is the default in social, health and market research. Moving to 99% multiplies the sample by 6.635 / 3.842 = 1.73, so it costs about 73% more for the same margin of error. Use it when being wrong is expensive, not by habit.

Margin of Error

The margin of error is the "plus or minus" quoted with the result: 62% ±5% means the true figure is very likely between 57% and 67%. It sits squared in the denominator, so halving it quadruples the sample.

Expected Proportion

The term p × (1 − p) is the variance of a yes/no answer. It peaks at p = 0.5, where it equals 0.25. Using p = 0.5 is therefore deliberate: it gives the largest, most conservative sample. If you have solid prior data, for example a previous survey found 20% of households own the asset, you can use p = 0.2 and the required sample falls, because 0.2 × 0.8 = 0.16 instead of 0.25. If the questionnaire has many questions, size it on the most important one, or simply use 0.5 so every percentage is covered.

Population Size

The input people expect to matter most usually matters least. N enters only through the finite population correction, covered below, and stops mattering above about 20,000.

The Sample Size Formula: Cochran's Formula for Proportions

For a large or unknown population, the standard sample size formula for estimating a proportion is Cochran's formula:

n0 = 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 written as a decimal (5% = 0.05). The result is the number of completed, usable responses needed under simple random sampling.

Worked Example 1: The Classic 385

Illustrative scenario: a city-wide household survey, 95% confidence, margin of error ±5%, no prior estimate of p.

  1. z = 1.96, so z² = 1.96 × 1.96 = 3.8416.
  2. p = 0.5, so p × (1 − p) = 0.5 × 0.5 = 0.25.
  3. e = 0.05, so e² = 0.05 × 0.05 = 0.0025.
  4. Numerator: 3.8416 × 0.25 = 0.9604.
  5. n0 = 0.9604 / 0.0025 = 384.16.
  6. Always round up, never to the nearest, because rounding down would give a slightly wider margin than promised: 385 respondents.

That 385 is the number behind almost every "we surveyed about 400 people". It holds whether the city has 200,000 people or 2 million, because N does not enter the formula until the population is small. Calculators showing 384 round to the nearest; 385 is strictly correct.

Worked Example 2: Using a Prior Proportion

Illustrative scenario: a previous district survey found about 20% of households have a piped water connection. You want ±4% at 95% confidence.

  1. z² = 3.8416.
  2. p × (1 − p) = 0.2 × 0.8 = 0.16.
  3. e² = 0.04 × 0.04 = 0.0016.
  4. n0 = 3.8416 × 0.16 / 0.0016 = 0.614656 / 0.0016 = 384.16, rounded up to 385.

The same 385 now buys ±4% instead of ±5%. Only lean on a prior you trust: if the true value were 40%, this sample would give about ±4.9%.

Quick Reference: Confidence and Margin of Error

For p = 0.5 and a large population, rounding up each time:

ConfidenceMargin of errorRequired n
90%±5%271
95%±10%97
95%±7%196
95%±5%385
95%±3%1,068
95%±2%2,401
95%±1%9,604
99%±5%664
99%±3%1,844

Notice the shape: halving the margin of error roughly quadruples the sample, and going from ±5% to ±1% costs twenty-five times as much, not five. That relationship, not the population size, is what drives survey budgets.

Quick Reference: Expected Proportion and Margin of Error

At 95% confidence for a large population, the required sample depends on how close the true value sits to 50%:

Margin of errorNear 50%Near 20% or 80%Near 10% or 90%
±10%976235
±7%19612671
±5%385246139
±3%1,068683385
±2%2,4011,537865
±1%9,6046,1473,458

One caution for rare outcomes: a margin of ±5% around an expected 5% prevalence is meaningless, because the interval would run from 0% to 10%. For rare characteristics, set the margin of error relative to p (for example ±20% of the estimate, which is ±1 percentage point at p = 5%) and accept that the sample will be large.

Working Backwards: The Margin of Error for a Given Sample

Often the budget fixes the sample and you need to know what precision it buys. Rearranging the formula:

e = z × √(p × (1 − p) / n)

Illustrative example: 300 completed interviews, 95% confidence, p = 0.5.

  1. p × (1 − p) / n = 0.25 / 300 = 0.000833.
  2. √0.000833 = 0.02887.
  3. e = 1.96 × 0.02887 = 0.0566, or about ±5.7%.
Completed responsesMargin of error (95%, p = 0.5)
100±9.8%
200±6.9%
300±5.7%
400±4.9%
600±4.0%
1,000±3.1%
2,000±2.2%

If a survey falls short of target, report the margin the achieved sample supports, not the one in the proposal.

Small Populations: The Finite Population Correction

When you are surveying a defined, countable group, such as the 2,000 employees of a company, the 450 households in a resettlement colony or the 140 schools in a block, each respondent is a meaningful share of the whole and the sample can be smaller. The finite population correction (FPC) adjusts Cochran's n0:

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

An algebraically identical version, used by many calculators, is n = n0 × N / (n0 + N − 1).

Worked Example 3: A Population of 2,000

Illustrative scenario: a staff survey in an organisation of N = 2,000 employees, 95% confidence, ±5%, p = 0.5.

  1. From Example 1, n0 = 384.16. Keep the unrounded value for this step.
  2. n0 − 1 = 383.16.
  3. (n0 − 1) / N = 383.16 / 2,000 = 0.19158.
  4. Denominator: 1 + 0.19158 = 1.19158.
  5. n = 384.16 / 1.19158 = 322.4.
  6. Round up: 323 completed responses.

The correction saves 62 interviews compared with 385, about 16% of the fieldwork, with no loss of precision.

For 450 households in a project-affected area the same steps give 384.16 / (1 + 383.16 / 450) = 384.16 / 1.85147 = 207.5, so 208 households: nearly half. For very small populations it is often simpler and more defensible to survey everyone (a census) than to sample.

Population (N)Sample needed (95%, ±5%, p = 0.5)
10080
250152
500218
1,000278
2,000323
5,000357
10,000370
20,000377
100,000383
1,000,000 or more385

Above roughly 20,000 the correction stops mattering; below 1,000 ignoring it wastes money. If you report a subgroup separately, apply the FPC to that subgroup's size, not the total.

Sample Size for Estimating a Mean

When the survey's key output is an average, such as monthly household income, distance to the nearest clinic or a satisfaction score, the formula uses the standard deviation (σ) instead of p:

n0 = (z × σ / e)²

where e is now the margin of error in the units of the measurement.

Illustrative example: you want mean monthly household expenditure to within ±₹1,000 at 95% confidence, and a pilot suggests σ ≈ ₹8,000.

  1. z × σ = 1.96 × 8,000 = 15,680.
  2. Divide by e: 15,680 / 1,000 = 15.68.
  3. Square it: 15.68 × 15.68 = 245.9.
  4. Round up: 246 households, before any finite population, design effect or non-response adjustment.

The hard part is σ: take it from a pilot of 30 to 50 respondents, a previous survey, or for a bounded scale the rough rule σ ≈ range / 4 (σ ≈ 1 on a 1 to 5 scale). For Likert items, read analysing Likert scale data before treating the score as a mean.

Cluster Sampling and the Design Effect

Every formula above assumes simple random sampling (SRS). Field surveys usually select villages or wards first, then households within them, because 385 scattered addresses are unaffordable. Clustering costs precision: neighbours resemble each other, so each extra interview in a cluster adds less new information. You compensate with the design effect (DEFF):

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

  • m is the average number of respondents per cluster.
  • ICC is the intra-cluster correlation, typically 0.02 to 0.15 for socio-economic variables and higher for outcomes shared by a whole village, such as water source or road access.

Worked Example 5: A Village-Based Design

Illustrative scenario: 385 needed under SRS, 20 households per village, ICC = 0.05.

  1. m − 1 = 20 − 1 = 19.
  2. 19 × 0.05 = 0.95.
  3. DEFF = 1 + 0.95 = 1.95.
  4. n = 385 × 1.95 = 750.75, rounded up to 751 households.
  5. Clusters: 751 / 20 = 37.6, so 38 villages of 20 households (760 in total).
SituationTypical design effect
Simple random sample1.0
Stratified sample with well-chosen strata0.9 to 1.0
Cluster sample, heterogeneous outcome (e.g. income)1.5 to 2.0
Cluster sample, homogeneous outcome (e.g. water source)2.0 to 4.0
Typical multi-stage household survey1.5 to 2.0

Budgeting for the SRS number and then needing double is a common planning failure. Choosing cluster size, number of clusters and the ICC for household and village designs is covered in depth in how to determine sample size for a household survey, and the wider choice of design in sampling methods for household surveys.

Adding Non-Response

Every formula gives you completed responses. To reach them you must approach more people:

n_contact = n_required / expected response rate

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

For 751 completed face-to-face interviews at an 85% response rate: 751 / 0.85 = 883.5, so draw 884 households. For the same target by email at a 10% response rate you would need a list of 7,510, which is usually the point at which the mode gets reconsidered. Mode choice is compared in CATI vs CAPI vs PAPI vs CAWI.

A bigger initial sample fixes the count, not the bias: if non-respondents differ, you just get a more precise wrong answer. Field practices that keep response high and even are covered in how to reduce bias in field surveys.

If the same households will be interviewed again, as in a baseline and endline impact evaluation, also divide by the expected retention rate: panel attrition of 10% to 20% a year is common in mobile populations.

Putting the Adjustments Together

The adjustments multiply. Here is a full sample size calculation for an illustrative village-level baseline wanting ±5% at 95% confidence, with a design effect of 1.6, 85% response and 12% expected attrition before the endline:

StepCalculationRunning total
1. Base (p = 0.5, large population)3.8416 × 0.25 / 0.0025, rounded up385
2. Design effect 1.6385 × 1.6616
3. Non-response at 85%616 / 0.85 = 724.7725
4. Attrition of 12% (retain 88%)724.7 / 0.88 = 823.5824
5. Fit to clusters of 20824 / 20 = 41.2, so 42 villages840 households

The base formula said 385; the realistic answer is more than double, a conversation to have with a funder before fieldwork, not after. For a small population, apply the finite population correction at step 1. This is the full answer to how to calculate sample size for a survey in practice: the formula, then the multipliers.

Sample Size for Subgroups and Stratified Surveys

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. Wanting four subgroup estimates at ±7% each is close to four separate surveys of 196.

Reporting needPractical minimum per subgroup
Headline percentage only (about ±10%)100
Comparison between two subgroups200 each, more if the gap is small
Cross-tabulation within a subgroup300 or more

Stratified designs can allocate proportionally (self-weighting) or equally across strata (better for comparisons, but the overall estimate then needs weights). List every planned table before fixing the sample size.

Sample Size Calculation for Comparing Two Groups

If the survey is designed to detect a difference, such as before versus after, treatment versus control or men versus women, the proportion formula is the wrong tool. You are no longer estimating one number to a stated precision; you are testing whether two numbers differ. That requires a power calculation, with two extra inputs: power (usually 80%, so a 20% risk of missing a real effect) and the smallest difference worth detecting. The trade-off between false positives and false negatives is explained in Type I and Type II errors.

Sample size needed as effect size shrinks

Two Proportions

The usual formula, per group, is:

n = [z(α/2) × √(2 × p̄ × (1 − p̄)) + z(β) × √(p1(1 − p1) + p2(1 − p2))]² / (p1 − p2)²

where p̄ is the average of p1 and p2, z(α/2) = 1.96 for a two-sided 5% test and z(β) = 0.8416 for 80% power.

Illustrative example: detect an increase from 30% to 40% in households using a service.

  1. p̄ = (0.30 + 0.40) / 2 = 0.35, so 2 × 0.35 × 0.65 = 0.455, and √0.455 = 0.6745.
  2. First term: 1.96 × 0.6745 = 1.3221.
  3. p1(1 − p1) + p2(1 − p2) = 0.21 + 0.24 = 0.45, and √0.45 = 0.6708.
  4. Second term: 0.8416 × 0.6708 = 0.5646.
  5. Sum: 1.3221 + 0.5646 = 1.8867, squared = 3.5596.
  6. Divide by (0.10)² = 0.01: n = 355.96, rounded up to 356 per group, 712 in total, before design effect and non-response.

Two Means

For a continuous outcome, per group:

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

At 95% confidence and 80% power, (1.96 + 0.8416)² = 2.8016² = 7.849, so n ≈ 15.7 × σ² / Δ², the familiar "16 σ² over Δ²" rule. Expressed as Cohen's d = Δ / σ, the requirement per group (using the exact t-test calculation, which adds one or two to the normal approximation) is:

Effect size (Cohen's d)Plain descriptionPer group, 80% powerPer group, 90% power
0.8Large, obvious in raw data2634
0.5Medium, visible in a chart6486
0.3Small but often meaningful176235
0.2Small394527
0.1Very small1,5712,103

Illustrative example: detect a ₹2,000 difference in mean monthly income between programme and comparison households, with σ = ₹8,000. Here d = 2,000 / 8,000 = 0.25, and 15.7 / 0.25² = 15.7 / 0.0625 = 251.2, so about 252 per group by the normal approximation, or 253 by the exact t-test.

Halving the effect roughly quadruples the sample. With 200 households per arm, effects below about d = 0.28 will probably go undetected; say so in the protocol. Choosing the effect size, one-sided versus two-sided tests and power for regression and ANOVA are covered in statistical power and effect size; designs with a comparison group over time have their own considerations, discussed in difference-in-differences with baseline and endline data. For online experiments, see A/B testing statistics.

Building Your Own Sample Size Calculator

An online sample size calculator is quick, but a spreadsheet version makes every assumption visible. In Excel or Google Sheets, put the inputs in cells (confidence in B1 as 0.95, margin of error in B2 as 0.05, p in B3 as 0.5, N in B4, design effect in B5, response rate in B6) and use these formulas:

z:                 =NORM.S.INV(1-(1-B1)/2)
Cochran n0:        =B7^2*B3*(1-B3)/B2^2
After FPC:         =B8/(1+(B8-1)/B4)
After DEFF:        =B9*B5
Contacts to make:  =ROUNDUP(B10/B6,0)

with z in B7, n0 in B8, the corrected n in B9 and the clustered n in B10. Round up only at the end so rounding errors do not compound. With 95%, ±5%, p = 0.5 and N = 2,000, the sheet should return 1.96, 384.16 and 322.4, matching Worked Example 3.

Other reliable tools:

ToolBest forCost
OpenEpiQuick proportion and two-group calculations in a browserFree
G*Powert-tests, ANOVA, regression, chi-square powerFree
R (pwr package) or Python (statsmodels)Reproducible calculations in a scriptFree
Stata power commandComplex survey and cluster designsLicensed

For large official surveys, the UN household survey guidelines remain the standard reference on frames and design effects.

How to Calculate Sample Size for a Survey: Step by Step

  1. Define the key estimate: a proportion, a mean or a difference between groups.
  2. Set the confidence level (95% unless there is a reason not to) and the margin of error or smallest difference worth detecting, tied to a decision.
  3. Estimate p or σ from a previous survey, a pilot, or p = 0.5 if nothing is known.
  4. Calculate n0 with Cochran's formula or the two-group formula.
  5. Apply the finite population correction if the population or reporting subgroup is small.
  6. Multiply by the design effect if you sample clusters, and size each reporting subgroup separately.
  7. Divide by the expected response and retention rates, round up, fit to whole clusters and document every assumption.

Common Mistakes in Survey Sample Size Calculation

  • Using 385 for everything. It assumes ±5%, 95% confidence, p = 0.5, a large population, simple random sampling and full response.
  • Applying the formula to the whole sample but reporting subgroups. The precision of a subgroup estimate is set by the subgroup's size.
  • Using a sample size for estimation when the aim is comparison. Detecting change needs power, and usually far more respondents.
  • Assuming a bigger sample fixes a bad frame. A precisely calculated sample drawn from an incomplete list gives a precise estimate of the wrong population. Coverage error is not fixed by a bigger n.

Many of these feed into the analysis stage too; common statistical mistakes in research covers the wider list.

What to Write in Your Protocol

Reviewers rarely reject a sample size section because the number is wrong; they reject it because the assumptions are missing. State:

  1. The primary outcome and whether it is a proportion, mean or difference.
  2. The confidence level and margin of error (or alpha, power and the minimum detectable effect).
  3. The assumed p or σ, and where it came from.
  4. The population size and whether the finite population correction was applied.
  5. The design effect and the ICC or source behind it.
  6. The expected response and retention rates.
  7. Any subgroup that will be reported separately, and its own sample.

A one-paragraph example: "Assuming 50% prevalence, a sample of 385 gives ±5% precision at 95% confidence. Allowing a design effect of 1.6 for two-stage cluster sampling and 85% response, the target is 616 completed interviews, so 725 households are approached, rounded up to 37 clusters of 20 (740)." Once the data are in, presenting statistical results shows how to report the achieved precision alongside the estimates.

How DSTechnoverse Helps

DSTechnoverse handles the statistics side of survey and study design for researchers, PhD scholars, NGOs, hospitals and businesses. We calculate and justify sample sizes for proportions, means and group comparisons, build design effect and non-response allowances into the number, write the sample size section of your protocol, and later run the analysis in SPSS, R, Python or Stata. The analysis and explanation are delivered to you; authorship of the thesis or report stays with the researcher. Where you also need the fieldwork, our socio-economic and baseline survey team can design and run it. See statistical and research data analysis or contact us to discuss your study.

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 Cochran's formula n0 = z² × p × (1 − p) / e². At 95% confidence, ±5% and p = 0.5 this gives 384.16, rounded up to 385. Then apply the finite population correction for a small population, multiply by the design effect if you sample clusters, and divide by the expected response rate.

What is a good sample size for a survey? There is no single number. For a large population at 95% confidence and ±5%, about 385 completed responses is the starting point; ±3% needs about 1,068. The right figure depends on the precision you need, how you sample, the response rate you expect and, above all, the subgroups you plan to report separately.

Does population size affect the sample size? Only when the population is small. Above roughly 20,000 the required sample barely moves, so a survey of a whole state and a survey of a city of 2 lakh need almost the same number for the same precision. Below about 1,000, the finite population correction reduces the requirement substantially.

What sample size do I need for a population of 2,000? At 95% confidence, ±5% and p = 0.5, apply the finite population correction to n0 = 384.16: n = 384.16 / (1 + 383.16 / 2,000) = 384.16 / 1.19158 = 322.4, so 323 completed responses. Add non-response on top, and a design effect if you sample in groups rather than individually.

Why does 385 come up so often? It is Cochran's formula at the default assumptions: 95% confidence (z = 1.96), p = 0.5 and a ±5% margin of error, giving 384.16, rounded up. Some calculators show 384 because they round to the nearest whole number. It is a reasonable starting point, not a universal answer.

How does margin of error relate to sample size? Inversely, through a square root. The margin of error is z × √(p(1 − p)/n), so quadrupling the sample halves the margin of error. At 95% confidence and p = 0.5, 100 responses give about ±9.8%, 400 give about ±4.9% and 1,000 give about ±3.1%.

What is the design effect and do I need it? It is the precision penalty for cluster sampling, calculated as 1 + (m − 1) × ICC, where m is respondents per cluster. Household surveys typically see values of 1.5 to 2.0. If your design selects villages, wards, schools or clinics first and then people within them, you need it, and ignoring it can halve your real precision.

Should I use 90%, 95% or 99% confidence? 95% is the convention in most research and what reviewers expect. 90% is acceptable for exploratory or internal work. Use 99% when a wrong conclusion would be costly, but budget for it: at the same margin of error it needs about 73% more respondents than 95%.

How many responses do I need for statistical significance? There is no fixed number, because significance depends on the size of the difference you are trying to detect. At 95% confidence and 80% power, a large effect (d = 0.8) needs about 26 per group, a medium one 64 and a small one (d = 0.2) about 394 per group.

What if I cannot reach the calculated sample size? Report the margin of error the achieved sample actually supports, check whether non-respondents differ from respondents, and consider weighting. Do not present a ±5% claim on a sample that only supports ±7%. For comparisons, report the smallest effect the achieved sample could have detected.


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.

Sources and Further Reading

Official and primary sources for the standards, rules and data discussed on this page.

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