Sample Size Calculator

Calculate required sample size for surveys and experiments at any confidence level and margin of error.

Use 50% when unknown (gives maximum sample size)

Required Sample Size

371

Formula inputsz=1.96, e=5.0%, p=50%
Infinite population n385
Population size (N)10,000
Adjusted sample size371
% of population3.7%

How to Use the Sample Size Calculator

This sample size calculator tells you the minimum number of respondents you need for a valid survey, poll, A/B test, or clinical study. It is the same statistical sample size calculator used for survey research, political polling, UX experimentation, and academic studies. Enter four numbers and you get the exact count of responses required to hit your target precision.

  1. Enter the population size.This is the total group you are sampling from: 2,500 employees, 50,000 customers, 180 million registered voters. Check "Unknown / very large" if the population is huge or you genuinely do not know the figure. The calculator then uses the infinite population version of the Cochran formula.
  2. Choose the confidence level. 95% is the default for survey research, marketing studies, and almost all published polls. 99% is standard for clinical research and regulated studies where error is costly. 90% is common for exploratory A/B testing where speed matters more than strict precision.
  3. Set the margin of error. A ±5% margin of error means a reported 60% result sits somewhere between 55% and 65% in the true population. Political polls typically target ±3%. Academic survey research targets ±2% to ±3%. Tighter margins require much larger samples because error appears squared in the denominator.
  4. Enter the expected proportion.If prior research suggests roughly 30% of people will answer "yes" to your question, enter 30. If you have no prior data, leave it at 50%. That is the worst-case value and gives the largest, most conservative minimum sample size, so you cannot be wrong by under-sampling.

The result is the minimum sample size you need to hit your confidence and margin-of-error target. For online surveys, panel research, and email studies, divide that number by your expected response rate to get how many invitations to send. A 1,067-respondent target at a 20% response rate means mailing 5,335 invitations.

Sample Size Formula and Worked Examples

The sample size formula has two common forms: one for an unknown or very large population, and one adjusted for a finite population of known size N. Both come from William Cochran's 1963 textbook and are still the standard in survey research.

Cochran Formula for a Proportion (Unknown Population)

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

z = z-score for the chosen confidence level
p = estimated proportion (use 0.5 for maximum variance when unknown)
E = margin of error as a decimal (0.05 for ±5%)

The product p(1 − p) is maximized at p = 0.5, which gives 0.25. That is why "50%" is the safe default when you have no prior estimate: any other value gives a smaller required sample, so 0.5 guarantees you will not under-sample.

Finite Population Correction

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

N = total population size
n₀ = sample size from the Cochran formula above

When N is large, this correction shrinks n only a little. When N is small (say, 500 employees), the correction can cut the required sample by 40% or more. Skipping it is one of the most common mistakes made by people building their first minimum sample size calculator in a spreadsheet.

Z-Scores by Confidence Level

Confidence LevelZ-ScoreTypical Use
80%1.282Quick internal checks
90%1.645Exploratory A/B testing
95%1.960Standard survey research, polls
99%2.576Clinical trials, regulated studies
99.9%3.291Safety-critical research

Worked Example: Political-Style Poll at ±3%

Goal: 95% confidence, ±3% margin of error, proportion unknown
z = 1.96, p = 0.5, E = 0.03

n₀ = 1.96² × 0.5 × 0.5 / 0.03²
   = 3.8416 × 0.25 / 0.0009
   = 0.9604 / 0.0009
   = 1,067.1 → 1,067 respondents

This is why national political polls typically report n ≈ 1,067.

Worked Example with Finite Population Correction

Same goal (95% CI, ±5%, p = 0.5), population N = 10,000
n₀ = 1.96² × 0.25 / 0.05² = 384.16 → 385

n = 385 / (1 + (385 − 1) / 10,000)
  = 385 / (1 + 0.0384)
  = 385 / 1.0384
  = 370.8 → 371 respondents

Continuous Outcome (T-Test or Two-Sample Mean)

When the outcome is a number, not a yes/no proportion (blood pressure, revenue per user, test score), the sample size formula uses the effect size δ and the standard deviation σ instead of p.

n = ((z_α/2 + z_β) × σ / δ)²   per group

z_α/2 = z-score for the confidence level (1.96 at 95%)
z_β   = z-score for the power (0.84 at 80% power, 1.28 at 90% power)
σ     = standard deviation of the outcome
δ     = effect size you want to detect (difference between group means)

Example: detect a 5-point difference in a test score with σ = 15, 95% confidence, 80% power. n = ((1.96 + 0.84) × 15 / 5)² = (2.80 × 3)² = 70.56, so about 71 participants per group, or 142 total. Halving the effect size to δ = 2.5 quadruples the required sample to roughly 284 per group.

Quick Reference: Sample Size at 95% Confidence, p = 0.5

Margin of ErrorInfinite Population nN = 1,000N = 10,000N = 100,000
±1%9,6049064,8998,763
±2%2,4017061,9362,345
±3%1,0675169641,056
±4%600375566597
±5%385278371383
±7%196164193196
±10%97889697

Notice the squared relationship: moving from ±5% to ±1% multiplies the required sample by exactly 25. Moving from ±3% to ±1% multiplies it by 9. This is the main reason statisticians fight hard against demands for tighter margins: every tick of precision costs quadratically more respondents.

What Actually Drives Sample Size in Real Studies

A statistical sample size calculator gives you a number. What it does not explain is why that number behaves the way it does, which tradeoffs real researchers make, and the common mistakes that produce under-powered surveys or wasted research budgets. This section covers the practical side of designing a study.

What Drives Sample Size Up

Three knobs control n, and each one has a very different cost curve. Treating them as equal is the most expensive mistake in study design.

ChangeEffect on nExample
Confidence 95% → 99%Roughly 1.7× larger385 becomes 666
Confidence 95% → 99.9%Roughly 2.8× larger385 becomes 1,083
Margin of error halved4× larger (quadratic)385 at ±5% becomes 1,537 at ±2.5%
Margin of error to one-fifth25× larger385 at ±5% becomes 9,604 at ±1%
Effect size halved (t-test)4× larger71/group becomes 284/group
Power 80% → 90%Roughly 1.34× larger71/group becomes 95/group

Margin of error and effect size are squared in the formula, so they dominate the cost. Confidence level only appears as a z-score, so its effect is more modest. If your budget is tight, loosening the margin of error from ±3% to ±4% drops the sample from 1,067 to 600 (a 44% reduction) while 95% confidence stays unchanged.

Diminishing Returns and Why Polls Stop at 1,000

Because margin of error scales with 1/√n, doubling the sample does not halve the margin. It multiplies it by 1/√2 ≈ 0.707. Huge samples give only tiny precision gains.

Sample Size nMargin of Error at 95% CICost per Response ($15)
400±4.9%$6,000
1,000±3.1%$15,000
2,000±2.2%$30,000
5,000±1.4%$75,000
10,000±1.0%$150,000
100,000±0.3%$1,500,000

Going from 1,000 to 10,000 respondents cuts the margin from ±3.1% to ±1.0%, a 2.1 percentage-point gain that costs ten times more. That is why most national polls stop at 1,000 to 2,000 completed interviews, and why market research firms rarely field surveys above 3,000.

Real-World Contexts: Polls, A/B Tests, Clinical Trials

Different fields treat sample size differently because their cost, risk, and effect-size assumptions differ.

ContextTypical TargetWhy
National political polln ≈ 1,067 to 1,500±3% at 95% CI is the reporting standard
Customer satisfaction surveyn ≈ 385±5% at 95% CI is good enough for business decisions
Academic survey researchn ≈ 600 to 2,400±2% to ±4% at 95% CI to survive peer review
Product A/B test (2% lift)n ≈ 17,000 per armSmall effects need huge samples at 80% power
Product A/B test (20% lift)n ≈ 200 per armBig effects emerge fast
Phase III clinical trialn ≈ 300 to 3,000 per arm80% power, ethical review, regulatory approval
UX usability studyn ≈ 5 to 15Qualitative; saturation, not statistical precision

Clinical trials usually target 80% power, which means an 80% chance of detecting the specified effect if it exists. Regulators accept that level because higher power inflates trial costs without proportionate benefit. Product teams running A/B tests often relax to 70% power and 90% confidence to ship faster, trading a higher false-negative rate for speed.

Common Mistakes in Sample Size Planning

  • Using the population size without the finite correction.If N = 500 and you only apply the Cochran infinite formula, you will over-sample by 25% to 40%. For small populations, always apply n = n₀ / (1 + (n₀ − 1) / N).
  • Confusing population N with sample n. The figure you collect responses from is the sample (n). The full group you are sampling from is the population (N). A survey of 400 voters in a city of 800,000 has n = 400 and N = 800,000, not the other way around.
  • Ignoring the response rate. If you need 1,067 completed responses and expect a 20% response rate, you must invite 1,067 ÷ 0.20 = 5,335 people. Online panels often run 5% to 15% response rates, so inflate your invite list accordingly.
  • Treating margin of error as linear. Halving the error from ±5% to ±2.5% does not double the cost. It quadruples it. Budget discussions should reference the squared relationship.
  • Forgetting stratification. If you want reliable estimates for subgroups (say, voters under 30), each subgroup needs its own minimum sample size. National polls of 1,067 often have ±10% margins inside small demographic slices.
  • Assuming 50% is always conservative. It is, for a single proportion. For two-sample comparisons and continuous outcomes, use pilot data or published effect sizes. The t-test sample size formula does not use p at all.

Frequently Asked Questions

For a typical survey with a 95% confidence level and ±5% margin of error, you need 385 respondents from a large population. At ±3% you need 1,067, which is why national political polls usually report samples near that number. If your population is small (say, 500 employees), the finite population correction drops the requirement to around 217. Confidence level and margin of error drive the result more than anything else. Population size only matters when it is small.

Related Calculators