CalcMountain

Sample Size Calculator

Determine how many survey responses you need to achieve a desired margin of error at a given confidence level. Optionally apply a finite population correction.

Sample size determines how precisely a survey, study, or experiment can estimate a population parameter. Too few responses produce wide error margins and unreliable conclusions; too many waste budget and time. A sample size calculation answers the fundamental planning question: how many people do I need to survey, how many users do I need in an A/B test, or how many patients must I enroll in a trial to detect a meaningful effect?

This calculator returns the minimum sample size for estimating a proportion (e.g., percentage of voters favoring a candidate, defect rate in a process, conversion rate in a marketing test) at your chosen confidence level and margin of error. It optionally applies a finite population correction (FPC) when the population is small enough that sampling materially reduces the required n.

The math behind sample size is the inverse of the margin-of-error formula. Where margin of error tells you how precise your current sample is, sample size tells you how large a sample you need to reach a target precision. The relationship is roughly: halving the margin of error quadruples the sample size. Going from ±5% to ±2.5% precision typically means 4× the respondents.

Common applications: political polling, market research, customer satisfaction surveys, public-health studies, quality-control sampling, A/B testing planning, academic research, and any planning task where the cost of additional observations must be balanced against statistical precision.

Inputs

Use 50% if unknown

Results

Required Sample Size

385

Infinite Pop. Sample Size

385

Before finite correction

Z-Value

1.960

Effective Margin

± 4.99%

Last updated:

Formula

**Sample size for a proportion (infinite population):** n = (z² × p × (1 − p)) / E² Where: - z = z-score for the chosen confidence level - p = expected proportion (use 0.5 if unknown — gives the maximum, most conservative n) - E = desired margin of error (as a decimal) **Z-scores for common confidence levels:** | Confidence | Z | |---|---| | 80% | 1.282 | | 90% | 1.645 | | 95% | 1.960 | | 99% | 2.576 | **Worked example: political poll** Goal: estimate vote share to ±3% at 95% confidence. Unknown proportion → use p = 0.5. n = (1.96² × 0.5 × 0.5) / 0.03² n = (3.8416 × 0.25) / 0.0009 n = 0.9604 / 0.0009 n ≈ 1,068 Round up: **1,068 respondents** needed. **Finite population correction (FPC):** For smaller populations N, the required sample shrinks: n_adjusted = n / (1 + (n − 1) / N) Example: N = 5,000, n_infinite = 1,068. n_adj = 1,068 / (1 + 1,067/5,000) n_adj = 1,068 / (1 + 0.2134) n_adj = 1,068 / 1.2134 n_adj ≈ 880 **Sample size for estimating a mean:** n = (z × σ / E)² Where σ = population standard deviation, E = margin of error in original units. Example: estimating mean income to ±$500 at 95% confidence with σ = $10,000: n = (1.96 × 10,000 / 500)² = 39.2² ≈ 1,537 **Sample size for two-proportion comparison (A/B testing):** n per group ≈ (z_{α/2} + z_β)² × (p₁(1−p₁) + p₂(1−p₂)) / (p₁ − p₂)² Where z_β corresponds to desired power (typically 80% → z_β = 0.84). Example: detect lift from 5% baseline to 6% conversion (relative 20% lift), 95% confidence, 80% power: n ≈ (1.96 + 0.84)² × (0.05 × 0.95 + 0.06 × 0.94) / 0.01² n ≈ 7.84 × (0.0475 + 0.0564) / 0.0001 n ≈ 7.84 × 0.1039 / 0.0001 n ≈ 8,146 per variant **Quick reference table (95% confidence, p = 0.5, infinite N):** | Margin of error | n | |---|---| | ±1% | 9,604 | | ±2% | 2,401 | | ±3% | 1,068 | | ±4% | 600 | | ±5% | 385 | | ±7% | 196 | | ±10% | 96 | **Rule of thumb: doubling precision quadruples cost.**

How to use this calculator

  1. Enter desired margin of error as a percentage (e.g., 5 for ±5%).
  2. Choose confidence level (95% is the standard).
  3. Enter expected proportion if known; use 50% for the most conservative estimate.
  4. Enter population size if it is small (under ~100,000); otherwise leave at 0 for infinite.
  5. Calculator returns minimum respondents required.
  6. Add 10-20% buffer to account for non-response and ineligible respondents.

Worked examples

National political poll

**Scenario:** Pollster wants to estimate presidential approval to ±3% at 95% confidence. National adult population ≈ 250 million (treat as infinite). Unknown proportion → p = 0.5. **Calculation:** n = (1.96² × 0.5 × 0.5) / 0.03² = 0.9604 / 0.0009 ≈ 1,068. **Result:** Need ~1,068 completed interviews. With a typical 30% response rate, plan to contact ~3,600 voters. This matches the n ≈ 1,000 you see reported in major national polls.

Small-town satisfaction survey

**Scenario:** Town of 4,000 residents wants ±5% precision at 95% confidence on a satisfaction question. **Calculation:** Unadjusted n = (1.96² × 0.25) / 0.05² ≈ 385. Apply FPC: n_adj = 385 / (1 + 384/4000) = 385 / 1.096 ≈ 351. **Result:** Survey 351 residents — about 9% of the town. The finite-population correction saved 34 surveys vs. the infinite-population estimate.

A/B test planning

**Scenario:** E-commerce site has 5% baseline conversion. Wants to detect a 1-percentage-point lift (5% → 6%) at 95% confidence and 80% power. **Calculation:** Using two-proportion formula: n per group ≈ 8,146. **Result:** Need ~8,150 visitors per variant — about 16,300 total. At 1,000 visitors/day, the test runs ~16 days. If only 4,000 visitors/day are available, plan for ~4 days. Stopping early on apparent winners inflates false-positive rates — wait for the planned sample.

When to use this calculator

**Use sample-size calculations to plan:**

- **Surveys and polls**: determine respondents needed for target precision. - **A/B tests**: determine traffic per variant before launching. - **Clinical trials**: determine patients per arm to detect a clinically meaningful effect. - **Quality control**: determine inspection sample size for a process. - **Customer research**: determine review counts needed to estimate satisfaction. - **Academic studies**: justify n in grant applications and IRB submissions.

**Key inputs to choose carefully:**

- **Margin of error**: how precise must the answer be? Tighter precision = larger n (quadratic relationship). - **Confidence level**: 95% is standard. 99% requires ~70% more sample; 90% needs ~30% less. - **Expected proportion**: if completely unknown, use 50% (maximum variance). If you have prior estimates, use them — extreme proportions need smaller n. - **Population size**: matters only when small (under ~10,000) relative to sample. Otherwise treat as infinite. - **Power (for tests)**: 80% is convention; clinical trials often require 90%.

**Real-world adjustments:**

- **Non-response**: typical online surveys 5-30% response, phone 10-20%, mail 20-40%. Inflate contact list accordingly. - **Ineligibility**: some respondents won't qualify. Add 10-25% buffer. - **Stratified sampling**: if subgroup analysis is needed, calculate n per stratum separately. - **Multiple comparisons**: testing 10 hypotheses at α = 0.05 inflates false-positive rate; use Bonferroni or FDR correction and recalculate n.

**Common contexts:**

- **Political polling**: ±3% at 95% → ~1,000. - **Market research**: ±5% at 95% → ~400. - **Customer satisfaction**: ±5% at 95% → ~400. - **Manufacturing QC**: lot-acceptance sampling tables (ANSI/ASQ Z1.4). - **Clinical trials**: power analysis with effect size, often hundreds to thousands per arm.

**Software:**

- **R**: pwr package (proportions, t-tests, ANOVA). - **G*Power**: free desktop tool, widely cited in clinical literature. - **Python**: statsmodels.stats.power. - **SAS/SPSS**: built-in power and sample size modules.

**Pitfalls:**

- **Underestimating drop-out**: trials lose 10-30% of enrollees; inflate n. - **Optimistic effect sizes**: small estimated effects need huge n. Be honest. - **Ignoring clustering**: classroom or clinic-level sampling needs design effect adjustment (often 1.5-3× n). - **Single estimate when comparing groups**: comparison tests need substantially more n than estimation. - **Stopping early without planned interim analysis**: inflates type-I error.

**Don't oversize either:** unnecessarily large samples waste resources, prolong studies, and may be unethical in clinical contexts (exposing more subjects than needed to risk).

Common mistakes to avoid

  • Using estimation sample size for comparison tests (A/B tests need more).
  • Forgetting to inflate for non-response (final n much smaller than contacted).
  • Using 50% proportion when known proportion is much smaller (overestimates n).
  • Ignoring population size for small populations (overestimates n).
  • Failing to plan for subgroup analyses (each subgroup needs its own n).
  • Treating margin of error as the same as confidence interval width (it is half-width).
  • Stopping data collection early when results look favorable (inflates false positives).
  • Confusing 95% confidence with 95% power (different concepts).

Frequently Asked Questions

Sources & further reading

SponsoredShop Top Deals on AmazonSupport CalcMountain — browse top-rated products at no extra cost to you.

Related Calculators