Sample Size Calculator

Determine statistically valid sample sizes for surveys, A/B tests, and clinical research. Supports infinite/finite populations, custom confidence levels, and visual margin-of-error analysis.

Optional: finite population correction applied when N > 0 and finite.
absolute (±)
Desired precision, e.g., 0.05 = ±5%.
Estimated population proportion (0.5 yields maximum sample size).
? Market Research (95% CI, e=5%, p=0.5, infinite)
? Clinical Trial (99% CI, e=2%, p=0.3, N=10000)
⚙️ Quality Control (95% CI, e=3%, p=0.1, N=5000)
?️ Small Town Survey (90% CI, e=6%, p=0.5, N=800)
Privacy first: All calculations run locally in your browser – no data is uploaded to any server.

Why Sample Size Matters: Statistical Validity & Power

Determining an adequate sample size is the cornerstone of inferential statistics. Too small a sample may fail to detect real effects (low power), while an excessively large sample wastes resources. This calculator implements the widely accepted Cochran formula for infinite populations and the Yamane (finite population correction) adjustment, ensuring your research meets desired precision and confidence constraints.

? Cochran's formula (infinite population)

n₀ = (Z² × p × (1-p)) / e²

where Z = z-score for confidence level, p = expected proportion, e = margin of error.

Finite population correction (Yamane): n = n₀ / (1 + (n₀-1)/N )

Methodological Foundation

Our approach follows established statistical theory from William Cochran (1977) and Yamane (1967). The sample size maximizes variability at p=0.5, ensuring conservative estimates. For populations under 100,000, we strongly recommend applying finite population correction to avoid over-sampling. The underlying assumption is simple random sampling, although the formula also provides a baseline for stratified designs.

Step‑by‑Step Derivation & Real‑World Constraints

1. Choose confidence level (1-α). For 95% confidence, the Z‑score is 1.96, reflecting that the true population parameter lies within the margin of error in 95 of 100 repeated samples.
2. Set the margin of error: e = 0.05 means you accept a ±5% difference between sample estimate and true proportion.
3. Estimate expected proportion p: if unknown, p=0.5 yields maximum required sample size.
4. Compute initial n₀, then apply finite population correction (FPC): n = n₀ / (1 + (n₀-1)/N).
5. For populations below 10,000, FPC substantially reduces sample size without sacrificing precision.

Real-world constraints such as budget, non-response rate (we recommend inflating sample size by 10–20%), and design effects for cluster sampling are not automatic; consider over-sampling accordingly.

Practical Applications Across Domains

  • Market Research: Determine customer satisfaction levels with ±4% precision.
  • Clinical Trials: Calculate patient enrollment to detect treatment effect (event rate difference).
  • Quality Control: Estimate defect proportion in manufacturing lots.
  • Political Polling: Forecast election outcomes within margin of error.
Case Study: Vaccine Efficacy Pilot

A research team aims to estimate COVID‑19 booster acceptance among hospital workers. Total population N = 4,200. They choose 95% confidence, margin of error e = 3% (0.03), and expected proportion p = 0.65 based on previous surveys. The infinite sample yields n₀ = (1.96² × 0.65×0.35) / (0.03²) ≈ 972. After finite correction: n = 972 / (1 + (971/4200)) ≈ 789. The calculator instantly provides 789 subjects, saving the team from recruiting 183 unnecessary participants while maintaining statistical rigor.

Common Misconceptions & Caveats

  • Sample size does NOT guarantee representativeness: Proper randomization is equally critical.
  • Margin of error only accounts for sampling error, not bias. Non-sampling errors (e.g., measurement error) can be larger.
  • For extremely small populations (N<100), consider a census (sampling entire population) rather than statistical formulas.
  • The calculator assumes a simple random sample. For cluster or stratified designs, consult a survey statistician.

When to Use Finite Population Correction

If your population size N is less than 50,000, the finite correction yields a noticeably smaller sample size while maintaining precision. Our correction uses the standard formula: n_adj = n₀ / (1 + (n₀ - 1)/N). For populations > 500,000, the difference between corrected and uncorrected is negligible (<1%).

Authored by the GetZenQuery tech  Team — methodology reviewed against authoritative sources: Sampling Techniques, 3rd Edition (Cochran), Essentials of Business Statistics (Bowerman), and guidelines from the American Statistical Association. Last updated June 2026. All calculations adhere to international research standards.

Frequently Asked Questions

Use p = 0.5 – it maximizes the required sample size and provides the most conservative estimate, ensuring sufficient precision regardless of true proportion.

This calculator focuses on proportion-based surveys. For continuous outcomes (means) or hypothesis testing, effect size and standard deviation are needed. We recommend our Power Analysis Tool for those scenarios.

Yes. Multiply the recommended sample size by (1 / expected response rate). For example, if you expect 80% response rate and the formula yields 400, recruit 500 participants.

For N < 200, the finite correction may produce a sample size close to N – consider a census. Our tool still computes a value but practitioners often advise surveying the entire population when feasible.

99% confidence yields a larger Z (2.576), increasing sample size by roughly 70% compared to 95%, which provides greater certainty but at higher cost.
References: Cochran, W.G. (1977). Sampling Techniques; Yamane, T. (1967). Statistics: An Introductory Analysis; Statistics How To: Sample Size.