Advertisement

🔭 Sample Size Calculator

Estimate required sample size for a survey or A/B test from margin of error, confidence level, and population size.

How Many Respondents Before You Can Trust the Survey?

BrainyCalculators editorial insight — unique to this tool

Sample size formulas link confidence level (usually 95%), margin of error (±3% is standard for national polls), and population proportion — maximum n occurs at p = 0.5. A customer NPS study targeting ±5% MOE on a 50,000-user base might need ~385 responses (finite population correction lowers this). Under-powered A/B tests waste traffic; overpowered tests detect trivial lifts.

When to use this calculator

Use before fielding a survey or experiment to set n. After you have data and a sample mean, use Confidence Interval to report the range.

Reference Value Context
±3% MOE, 95% ~1,067 Infinite population
±5% MOE, 95% ~385 Common CX surveys
A/B test (80% power) Varies by MDE Often 1k+ per arm
Finite pop. correction Lowers n When n > 5% of N

Not what you need? After collecting data, report uncertainty with Confidence Interval — not Sample Size.

Building a confidence interval from existing data?

This page plans how many observations to collect. For CI around a mean you already have, use the Confidence Interval Calculator →

Use 0.5 if unknown (most conservative)

What is Sample Size?

Sample size calculation determines how many respondents you need for a target margin of error and confidence level, optionally adjusted for finite populations.

Use this page before fielding a survey or experiment. After you have collected data and want a range for the mean, use the Confidence Interval Calculator.

Percentile and z-score tools describe existing measurements; sample size plans future collection.

Sample Size Formulas

Unknown Population
n = (z² × p × (1−p)) / e²
Known Population (Finite Correction)
n_adj = n / (1 + (n−1) / N)
Z-values
90% → z=1.645 | 95% → z=1.96 | 99% → z=2.576

How to Choose the Right Sample Size

  1. 1
    Set Margin of Error
    Smaller margins (e.g. ±3%) require larger samples. For most surveys, ±5% is a practical balance.
  2. 2
    Choose Confidence Level
    95% is the industry standard. 99% gives more certainty but demands a larger sample.
  3. 3
    Estimate Population Proportion
    If unknown, use p=0.5. This maximises the required sample and ensures you won't undersample.
  4. 4
    Apply Finite Correction
    If your population is small and known, use the finite correction formula to reduce the required sample size.

Worked Example

A researcher wants a 95% CI, ±5% margin, and estimates p=0.5.

n = (1.96² × 0.5 × 0.5) / 0.05²
n = (3.8416 × 0.25) / 0.0025
n = 0.9604 / 0.0025
n = 385 (rounded up)

How the Sample Size Calculator Works

Formula, assumptions, and calculation steps for this statistics tool.

Methodology

Statistics calculators organize sample data, apply the selected descriptive or inferential formula, and report the statistic with interpretation.

Calculation Steps

  1. Enter raw values or summary statistics.
  2. Clean separators and count the sample size.
  3. Apply the relevant statistic, probability, or confidence formula.
  4. Display the result with context such as degrees of freedom, percentile, or strength.

Assumptions and Limits

  • Samples should be representative of the population being studied.
  • Normality or independence assumptions apply only where the selected method requires them.
  • Rounded results may differ slightly from spreadsheet software.

Frequently Asked Questions

Sample size is the number of individuals or observations selected from a population for a study. A larger sample produces more reliable and precise results, but at greater cost and time.

The margin of error quantifies the uncertainty in survey results. A ±5% margin at 95% confidence means the true population value is within 5 percentage points of your sample result 95% of the time.

Higher confidence levels require larger samples. Increasing from 95% to 99% confidence increases the required sample by roughly 75% while keeping margin of error constant.

p is the estimated fraction of the population with a specific characteristic. Using p=0.5 maximises the required sample and is the safe default when you have no prior data.

Real-World Applications

🗳️
Political Opinion Polling
National pollsters interview 1,000–2,000 registered voters to estimate national opinion within ±3% at 95% confidence — a sample size derived from the standard survey formula. The famous "±3 points" margin of error in US political polling comes directly from the sample size formula applied to a national adult population.
🧪
Clinical Drug Trials (Phase II/III)
FDA and EMA require clinical trial sample sizes determined by pre-specified statistical power analysis — calculating the number of patients needed to detect the minimum clinically meaningful treatment effect at 80% or 90% power and a 5% significance level. Underpowered trials cannot provide sufficient evidence of drug efficacy for regulatory approval.
🔬
A/B Testing in Product & Marketing
Product managers and growth teams calculate minimum sample sizes before running website A/B tests — ensuring they collect enough observations to detect the minimum conversion rate improvement that would justify implementing the variant, avoiding premature stopping of experiments that lack statistical validity.
🏭
Quality Control Sampling Plans
Manufacturers use acceptance sampling plans (AQL-based) that specify how many units to inspect from a production batch — balancing the cost of inspection against the risk of accepting a defective batch. Sample size determines the operating characteristic (OC) curve of the sampling plan, defining the producer's and consumer's risk.
📊
Market Research Surveys
Market researchers determine required survey sample sizes based on the target subgroup analyses planned — if a survey needs to analyse responses separately for 5 demographic segments, each segment needs adequate representation (typically ≥50–100 respondents per subgroup), driving total sample size higher than simple population-level analysis would require.
🌍
Public Health Surveillance Studies
Epidemiologists calculate the sample size needed to estimate disease prevalence within a specified margin of error — a rare disease with 0.5% expected prevalence requires a much larger sample (at ±0.1% margin: ~19,000 participants) than a common condition at 30% prevalence (±3% margin: ~1,067 participants).

Common Mistakes

1
Calculating sample size after data collection rather than before
Sample size should be determined before data collection begins — it defines the study's power to detect effects. Post-hoc power analysis based on observed results is widely criticised as circular and misleading. The correct practice is pre-study power analysis to determine the required n, then collecting exactly that number of observations (or more, to account for dropout).
2
Using p = 0.5 for all proportion estimates without justification
Using p = 0.5 gives the maximum (conservative) sample size estimate when the true population proportion is unknown. If prior research strongly suggests the proportion is around 0.2 or 0.8, using that estimate produces a smaller, more efficient required sample size. Always use the best available prior estimate of p — but fall back to p = 0.5 only when genuinely no prior information exists.
3
Ignoring the finite population correction for small populations
The standard formula assumes an infinite population. When sampling from a finite population of size N, the required sample size is reduced by the finite population correction (FPC): n_adj = n / (1 + (n−1)/N). For a population of 500 people, a raw sample size of 384 (for ±5% at 95% confidence) reduces to about 218 after FPC — a significant reduction that avoids unnecessary over-sampling.
4
Not accounting for expected non-response and dropout
The calculated sample size is the number of completed responses needed — not the number of people to invite. If a 30% non-response or dropout rate is expected, the number of invitations or enrolled participants must be inflated by 1/(1 − dropout rate). For 30% expected dropout: invite 384/0.70 = 549 people to expect 384 completed responses.
5
Treating the sample size formula for proportions as applicable to means
The survey proportion formula (n = Z²p(1−p)/E²) is designed for estimating a population proportion. Estimating a population mean requires a different formula: n = (Z × σ / E)², where σ is the population standard deviation. Using the proportion formula for a continuous outcome (e.g., estimating mean income) produces an incorrect required sample size.

Required Sample Size by Margin of Error (95% Confidence, p=0.5)

Margin of Error (±) Required n Typical Use Case
±10% 97 Exploratory / small-scale research
±5% 385 Standard market research, surveys
±3% 1,068 National polls, large-scale surveys
±2% 2,401 High-precision public health studies
±1% 9,604 Very high precision requirements

References

  1. Cochran, W.G. Sampling Techniques. Wiley, 1977.
  2. Cohen, J. Statistical Power Analysis for the Behavioral Sciences. Lawrence Erlbaum, 1988.
  3. Fleiss, J.L., Levin, B. and Paik, M.C. Statistical Methods for Rates and Proportions. Wiley, 2003.
  4. Krejcie, R.V. and Morgan, D.W. "Determining Sample Size for Research Activities." Educational and Psychological Measurement, 1970.
  5. Ioannidis, J.P.A. "Why Most Published Research Findings Are False." PLOS Medicine, 2005.