Determine the required sample size for a survey, study or A/B test — for proportions or for means — using confidence level, margin of error and population size, with the formula shown.
Quick Answer: How Do You Determine Sample Size?
For a survey estimating a proportion, use n = z² × p(1−p) / E², where z is the critical value for your confidence level, p is the expected proportion (use 0.5 if unknown, since it gives the largest, most conservative sample size), and E is your target margin of error. For a general population survey at 95% confidence with a ±5% margin of error, this works out to about 385 respondents — and that number barely changes whether the underlying population is 10,000 or 10 million.
Sample Size for Proportions
Confidence Level ?
Margin of Error ?
%
Population Size ?
Expected Proportion ?
%
Sample Size for Mean (Continuous Data)
Confidence Level
Margin of Error (absolute)
Std Deviation (σ) ?
Required Sample Size
Minimum Sample Size
385
For 95% CI, ±5% margin of error
Parameter
Value
Sample Size Comparison Table
Required sample sizes at 95% confidence, p=50%:
Population
±3%
±5%
±10%
What Is Sample Size and Why Does It Matter?
Sample size is the number of people, items or observations you need to collect data from so that your results reliably reflect the larger population you're studying. Get it wrong in one direction and you waste money and time collecting more data than necessary; get it wrong in the other direction and your results are too imprecise or underpowered to be trusted — a survey with too few respondents can produce a margin of error so wide the result is practically meaningless.
Determining sample size before you collect data — rather than guessing, or simply gathering "as many as we can get" — is standard practice in survey research, clinical trials, market research and A/B testing, and it is exactly what this calculator works out for you.
💡 Did You Know? For a large population, required sample size barely changes with population size at all. A sample of 385 gives the same ±5% margin of error whether you're surveying a city of 50,000 or a country of 25 million — it's the absolute number of respondents that drives precision, not the fraction of the population sampled.
Sample Size Formulas
Proportion (infinite population): n = z² × p(1 − p) / E²
Finite population correction: n_adj = n / (1 + (n − 1)/N)
Mean (continuous data): n = (z × σ / E)² z = critical value | p = expected proportion | E = margin of error | N = population size | σ = standard deviation
Step-by-Step Calculation Examples
Example 1 — standard survey sample size (proportion)
Target: 95% confidence, ±5% margin of error, proportion unknown so p = 0.5.
Because you're sampling a large share of a small population, fewer respondents are needed than the infinite-population formula suggests.
Example 3 — sample size for a mean
A researcher wants to estimate an average with a margin of error of ±5 units, knowing σ ≈ 25, at 95% confidence.
n = (1.96 × 25 / 5)² = (9.8)² = 96.04 → round up to 97
Example 4 — effect of a known prior estimate
A previous survey found the true proportion is closer to 30% (p = 0.3), not the conservative 50%. Target: 95% confidence, ±5% margin of error.
n = 1.96² × 0.3 × 0.7 / 0.05² = 3.8416 × 0.21 / 0.0025 ≈ 322.7 → round up to 323
Using a realistic prior estimate instead of the conservative p = 0.5 reduces the required sample size — but only use this if the prior estimate is genuinely trustworthy.
Confidence Level, Margin of Error and Sample Size
Confidence
Margin of error
Required n (p = 0.5)
95%
±10%
97
95%
±5%
385
95%
±3%
1,068
95%
±1%
9,604
99%
±5%
664
90%
±5%
271
⚡ Pro Tip: Sample size and margin of error have a squared relationship, not a linear one. Halving the margin of error (say from ±5% to ±2.5%) roughly quadruples the required sample size — which is exactly why extremely precise polling and census-quality data are so much more expensive than a rough directional survey.
Common Mistakes
Mistake
Why it goes wrong
How to avoid it
Believing a bigger population always needs a bigger sample
For large populations, required sample size is almost independent of population size
Only apply the finite population correction when sampling a meaningful fraction of a small population
Assuming more respondents always fixes a biased sample
Sample size only addresses random sampling error, not a flawed sampling method or non-response bias
Fix the sampling design first; a bigger biased sample is still biased
Using p = 0.5 when a good prior estimate exists
Produces an unnecessarily large, expensive sample size
Use a genuine prior estimate of p from earlier research when you have one
Forgetting response rate when planning data collection
The sample size formula gives completed responses needed, not invitations sent
Divide the required sample size by your expected response rate to size your outreach
Using the proportion formula for a continuous measurement
Means and proportions require different formulas — mixing them gives the wrong n
Use n = (z×σ/E)² for means, not the proportion formula
⚠️ Common Mistake: Treating "n = 385" as a universal answer for every survey. It is specifically the answer for 95% confidence, ±5% margin of error, and p = 0.5 — change any of those three inputs and the required sample size changes too.
Practical Applications
Survey and market research
Market researchers and pollsters use sample size calculations before fieldwork begins, to make sure a survey budget produces a result precise enough to be useful, without overspending on unnecessary extra respondents.
Clinical trials and health research
Clinical trials require a pre-specified sample size — often called a "power calculation" — to ensure the study has a reasonable chance of detecting a real treatment effect if one exists, and Australian researchers follow NHMRC guidelines when planning trial sample sizes.
A/B testing and product experiments
Digital product teams use sample size calculations to decide how long an A/B test needs to run before its result can be trusted, balancing the cost of a longer test against the risk of acting on a result that's just random noise.
Official statistics
The Australian Bureau of Statistics designs its ongoing surveys — such as the Labour Force Survey — around carefully calculated sample sizes that balance precision against the cost and burden of data collection, while the five-yearly Census deliberately surveys the entire population rather than a sample.
Auditing
Auditors use sample size calculations to decide how many transactions, invoices or records to test out of a much larger population, balancing audit assurance against the cost of checking every item. Audit sampling often works from a target confidence level and tolerable error rate rather than a margin of error percentage, but the underlying logic is the same trade-off between precision and sample size shown in this calculator — larger samples give more assurance that a material error would have been detected.
How to Calculate Sample Size in Excel
Excel has no built-in "sample size" function, but the proportion formula is short enough to write directly into a cell using NORM.S.INV for the critical value.
=ROUNDUP((NORM.S.INV(1-(1-C)/2)^2 * p * (1-p)) / E^2, 0) C = confidence level as a decimal (e.g. 0.95) | p = expected proportion (0.5 if unknown) | E = margin of error as a decimal (e.g. 0.05)
Worked example in Excel
95% confidence, ±5% margin of error, p = 0.5: =ROUNDUP((NORM.S.INV(1-(1-0.95)/2)^2*0.5*(1-0.5))/0.05^2,0)
This returns 385 — matching the benchmark figure and the calculator above.
To skip the NORM.S.INV step, you can hard-code the z-value instead: for 95% confidence, replace NORM.S.INV(1-(1-0.95)/2) with 1.96.
Sample Size for Precision vs Sample Size for Statistical Power
This calculator answers "how many respondents do I need for a given margin of error?" — the standard question for surveys and polls. A related but different question, common in clinical trials and A/B testing, is "how many participants do I need to reliably detect a real effect of a certain size?" — this is a power analysis, and it needs extra inputs this calculator doesn't ask for: the expected effect size, the desired statistical power (commonly 80% or 90%), and — for a t-test specifically — the variability of the outcome being measured. If you're planning a study that needs to detect a difference between two groups (rather than just estimate a single proportion or mean precisely), you need a power calculation, not just a margin-of-error sample size.
Sample Size Cheat Sheet
Quick Reference
Proportion (infinite population): n = z² × p(1−p) / E²
Finite population correction: n_adj = n / (1 + (n−1)/N)
Mean (continuous data): n = (z × σ / E)²
Conservative default: p = 0.5 (maximises required n when p is unknown)
90% z = 1.645 | 95% z = 1.96 | 99% z = 2.576
Rule of thumb: quadruple n to halve the margin of error
Benchmark: 95% confidence, ±5% margin of error, p=0.5 → n ≈ 385
Practice Questions
Beginner (with answers)
What sample size is needed for 95% confidence, ±5% margin of error, p unknown?
What z-value corresponds to 90% confidence?
Why is p = 0.5 used when the true proportion is unknown?
Does increasing the population size from 10,000 to 1,000,000 significantly change the required sample size for a fixed margin of error?
What happens to required sample size if you increase the confidence level from 90% to 99%?
Show answers
1) n ≈ 385 2) z = 1.645 3) It maximises p(1−p), giving the largest and most conservative sample size estimate 4) No — for large populations, required sample size is nearly independent of population size 5) It increases, since a higher confidence level requires a larger critical value
Advanced (with answers)
Find the required sample size for 99% confidence, ±3% margin of error, p = 0.5.
A population has only 800 members. Using n = 385 (infinite population formula), apply the finite population correction.
Find the required sample size for estimating a mean with σ = 40, E = 4, 95% confidence.
A survey needs 385 completed responses and historically gets a 20% response rate. How many invitations should be sent?
If a prior study found p = 0.2, how does the required sample size compare with using the conservative p = 0.5, at 95% confidence and ±5% margin of error?
Show answers
1) n = 2.576² × 0.25 / 0.03² = 6.636×0.25/0.0009 ≈ 1,843 2) n_adj = 385/(1+(384/800)) = 385/1.48 ≈ 260 3) n = (1.96×40/4)² = 19.6² ≈ 384.16 → 385 4) 385/0.20 = 1,925 invitations 5) p=0.2: n = 1.96²×0.2×0.8/0.05² ≈ 246, compared with 385 for p=0.5 — using the realistic lower proportion needs far fewer respondents
🔑 Key Takeaways
Larger samples give more precise estimates but cost more to collect.
n = (z² × p × (1−p)) / E² for proportions; n = (z × σ / E)² for means.
Margin of error and sample size have a squared relationship — halving E roughly quadruples n.
p = 0.5 is the conservative default that maximises required sample size when the true proportion is unknown.
For large populations, required sample size barely depends on population size at all.
The finite population correction only matters meaningfully when sampling a large share of a small population.
Frequently Asked Questions
For a general population survey at 95% confidence with a ±5% margin of error, you need approximately 385 respondents (using the conservative p = 0.5 assumption). For a ±3% margin, you need 1,068; for ±1%, 9,604. Sample size is largely unrelated to population size for large populations — 385 respondents is equally valid for a city of 1 million or a country of 25 million.
For a proportion, use n = z² × p(1−p) / E², where z is the critical value for your confidence level, p is the expected proportion (use 0.5 if unknown), and E is your target margin of error. For a continuous measurement (a mean), use n = (z × σ / E)², where σ is the standard deviation. Round the result up to the next whole number.
It depends on your target margin of error and the expected proportion. At the common benchmark of ±5% margin of error and p = 0.5, the answer is 385. At ±3%, it rises to 1,068; at ±10%, it drops to 97. The confidence level alone doesn't determine sample size — margin of error and expected proportion matter just as much.
Sample size is inversely proportional to the square of the margin of error. Halving the margin of error quadruples the required sample size. Going from ±5% (n=385) to ±2.5% requires roughly 4×385 = 1,540 respondents. This is why highly precise surveys are expensive — very small margins of error require very large samples.
The formula n = z²p(1−p)/E² is maximised when p = 0.5, since 0.5 × 0.5 = 0.25 is the largest possible value of p(1−p). Using p = 0.5 when the true proportion is unknown gives the largest, most conservative sample size estimate — it guarantees your margin of error target is met regardless of what the true proportion turns out to be. If you have a trustworthy prior estimate of p, using it reduces the required sample size.
Only meaningfully when the sample is a large fraction of a small population. For large populations, the finite population correction factor is close to 1 and has almost no effect — a sample of 385 gives essentially the same precision whether the population is 20,000 or 20 million. The correction becomes important when you're sampling, say, more than 5–10% of a population.
Use n = (z × σ / E)², where σ is the population standard deviation (known or estimated from prior data) and E is your target absolute margin of error. Unlike the proportion formula, this one needs an estimate of variability rather than an estimate of a proportion, often taken from a pilot study or previous research on the same measurement.
Statistical power is the probability a study correctly detects a real effect when one exists, and it depends heavily on sample size — larger samples give more power to detect smaller true effects. A full clinical trial power calculation also factors in the expected effect size and the desired power level (commonly 80% or 90%), which goes beyond the simpler margin-of-error approach used for general surveys.
Yes. The sample size formula tells you how many completed responses you need, not how many invitations to send. If you expect a 20% response rate and need 385 completed responses, divide 385 by 0.20 to find that you need to invite approximately 1,925 people.
Yes. Enter your confidence level, margin of error, population size and expected proportion (or, for continuous data, your standard deviation) and the calculator shows the required sample size along with every input used, plus a comparison table across different population sizes and margins of error.
There is no single "good" number — it depends on your target margin of error and confidence level. The widely used benchmark is 385 respondents (95% confidence, ±5% margin of error), which is treated as a reasonable minimum for general quantitative research on a large population. Smaller, more exploratory studies sometimes use fewer respondents with a wider acknowledged margin of error; more precise research needs proportionally more.
Increasing the sample size decreases the margin of error and narrows the confidence interval, but not in a straight line — the relationship follows an inverse square root, so you need to quadruple the sample size to halve the margin of error. Beyond a certain point, adding more respondents produces rapidly diminishing returns in precision.
There's no built-in function, but you can write the proportion formula directly: =ROUNDUP((NORM.S.INV(1-(1-C)/2)^2*p*(1-p))/E^2,0), where C is the confidence level, p is the expected proportion, and E is the margin of error, all entered as decimals. For 95% confidence, ±5% and p=0.5, this returns 385.
Population size (N) is the total number of individuals or items in the entire group you're studying — every customer, every voter, every unit produced. Sample size (n) is the smaller number you actually collect data from. For large populations, the required sample size barely depends on N at all; it only becomes a meaningful factor through the finite population correction when your sample is a large share of a small population.
Last updated: August 2026
Reviewed by Mohsin Iqbal using standard statistical definitions, with every worked example independently verified. This page is for educational purposes.