Sample Size Calculator

Calculate required sample size for surveys, A/B tests, and clinical trials with confidence level, margin of error, and power analysis.

Use 50 if unsure (most conservative)
0 = infinite (large population)
Sample Size Needed
383
At 95% confidence, ±5%
Confidence Level
95%
Z = 1.96
Margin of Error
±5%
Proportion = 50%
Population
100,000
Sampling fraction: 0.38%
Invitations (60% response)
639
Assuming 60% response rate
Data Collection
Medium
Internet survey feasible

Sample Size vs Margin of Error

±1%
8,763
±2%
2,345
±3%
1,056
±4%
597
±5%
383
±7%
196
±10%
96

Invitations Needed by Response Rate

Response RateInvitations Needed
100%383
80%479
60%639
50%766
40%958
30%1,277
20%1,915
Planning notes, formulas, and examples

About the Sample Size Calculator

Determining the right sample size is one of the most important decisions in any research study, survey, or experiment. Too small a sample gives unreliable results; too large wastes resources. The required sample size depends on your desired confidence level, acceptable margin of error, expected variability, and for experiments, the effect size you want to detect.

This calculator handles three common scenarios: surveys (proportion-based), comparative experiments (A/B tests), and continuous-variable studies. It computes the minimum sample size needed and shows how sample size changes with different confidence levels, margins of error, and effect sizes.

Whether you're planning a market research survey, designing an A/B test for your website, sizing a clinical trial, or planning an academic study, it gives the statistical foundation for your research design. It helps you avoid underpowered studies that miss real effects and oversized studies that waste time, budget, and participants. That makes the study plan easier to defend before data collection starts.

When This Page Helps

Use this calculator to set a study size before collecting data so the target confidence, margin of error, or minimum detectable effect is explicit up front. It is useful for surveys, experiments, and validation work where sample size needs to be justified rather than guessed. The result also makes it easier to explain the study plan to stakeholders before any data is collected.

How to Use the Inputs

  1. Choose the study type: survey, A/B test, or continuous variable.
  2. Enter the desired confidence level (90%, 95%, or 99%).
  3. Enter the acceptable margin of error (e.g., 3%, 5%).
  4. For surveys: enter expected proportion and population size.
  5. For A/B tests: enter baseline rate and minimum detectable effect.
  6. Review the required sample size and sensitivity analysis.
  7. Use the comparison table to see how different parameters affect sample size.
Formula used
Survey: n = (z²pq/e²) / (1 + (z²pq/e²N)). A/B test: n = (z_α + z_β)²(p₁q₁ + p₂q₂) / (p₁ − p₂)². Continuous: n = (z_α + z_β)²(2σ²) / δ². Where z = Z-score, p = proportion, e = margin of error, N = population.

Example Calculation

Result: 370 respondents needed

For 95% confidence with ±5% margin of error, assuming 50% proportion and 10,000 population, you need 370 survey respondents.

Tips & Best Practices

  • Always assume 50% proportion if you're unsure — it's the most conservative estimate.
  • Account for non-response: if you expect 60% response rate, recruit n/0.6 participants.
  • For A/B tests, smaller effects need exponentially larger samples — focus on effects that matter.
  • Population correction factor only matters below ~50,000 total population.
  • Power of 80% is standard; 90% is used for confirmatory studies.
  • Stratified sampling can reduce required sample size if you know subgroup proportions.

Sample Size for Surveys

Survey sample size depends on four factors: confidence level (Z-score), expected variability (p), margin of error (e), and population size (N). The formula uses the finite population correction (FPC) when the population is small.

The most common misunderstanding: sample size is not proportional to population size. A city of 100,000 and a country of 100,000,000 need essentially the same sample for the same precision. The FPC only matters when your sample is a large fraction of the population.

A/B Testing Sample Size

A/B tests compare two groups, so the calculation is different. You need to specify: the baseline rate (control group), the minimum detectable effect (how small a lift you want to detect), alpha (false positive rate, usually 5%), and beta (false negative rate, usually 20% for 80% power).

The key insight: detecting small effects requires massive samples. To detect a 1% absolute lift on a 5% baseline (5% → 6%) requires ~15,000 per group. To detect a 5% lift (5% → 10%) requires only ~400 per group.

Practical Considerations

Real-world studies must account for attrition, non-response, data quality issues, and subgroup analysis. A common rule of thumb: recruit 20-30% more than the calculated minimum. If you plan to analyze subgroups, each subgroup needs the full sample size independently.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • 95% is standard for most research. Use 99% for high-stakes decisions (medical, regulatory). Use 90% for preliminary or exploratory research where resources are limited.