📊 Sample Size Calculator – Plan Accurate Surveys & Research Studies
Determining the right sample size is one of the most critical decisions in survey design, clinical research, A/B testing, and quality control. Too small a sample yields unreliable estimates; too large wastes time and resources. This calculator uses statistically grounded formulas to tell you the minimum number of observations needed to achieve your desired level of precision.
Why Sample Size Matters
Every statistical estimate comes with uncertainty. The margin of error quantifies how far your sample estimate might be from the true population value, while the confidence level tells you how often the estimate would fall within that margin if you repeated the study many times. Choosing an appropriate sample size ensures that both quantities are acceptable before data collection begins — not after.
Supported Calculation Modes
Proportion Estimate
Use this mode for surveys with yes/no outcomes, approval ratings, or any binary response. The formula is:
n = z² × p × (1 − p) / E²
where z is the critical value for the chosen confidence level, p is the expected proportion, and E is the margin of error. When the true proportion is unknown, use p = 0.50 — this maximises the product p(1−p) and produces the most conservative (largest) sample size.
Mean Estimate
Use this mode for continuous measurements such as exam scores, blood pressure, or processing time. The formula is:
n = (z × σ / E)²
where σ is the population (or estimated) standard deviation and E is the acceptable margin of error in the same measurement units as σ. Obtain σ from a pilot study, published literature, or expert knowledge.
Optional Adjustments
Finite Population Correction (FPC)
When sampling from a bounded population — a school class, a patient registry, or a customer list — the standard formula over-estimates the required sample size. FPC adjusts it downward:
n_adj = n₀ / (1 + (n₀ − 1) / N)
FPC makes a meaningful difference only when the sample-to-population ratio exceeds about 5%. For populations in the thousands or more, the correction is negligible.
Nonresponse Adjustment
Real surveys rarely achieve 100% response rates. To ensure the final completed sample meets your precision target, divide the required sample by the expected response rate:
n_invitations = n / response_rate
For example, if you need 385 completed responses and anticipate a 70% response rate, you should contact at least 550 people.
Design Effect (DEFF)
Cluster sampling, stratified designs, or multistage probability samples introduce correlation between observations. The design effect multiplier (DEFF) captures this variance inflation:
n_design = n × DEFF
For simple random sampling, DEFF = 1. Household surveys typically useDEFF = 1.2–2.0 depending on clustering homogeneity.
Quick Reference: Sample Size vs. Margin of Error
The table below shows typical required sample sizes for proportion estimates at 95% confidence with p = 0.50:
| Margin of Error | Required n | Suitable For |
|---|---|---|
| ±1% | 9,604 | National polling, regulatory studies |
| ±2% | 2,401 | Large market research |
| ±3% | 1,068 | General surveys |
| ±5% | 385 | Small studies, pilot surveys |
| ±10% | 97 | Exploratory research |
Common Applications
- Survey design — determine how many respondents are needed before launching a questionnaire.
- A/B testing — calculate the sample per group required to detect a meaningful conversion rate difference.
- Clinical trials — establish the minimum patient count to demonstrate efficacy at the desired significance level.
- Quality control — find the inspection lot size needed to detect a defect rate with acceptable confidence.
- Academic research — justify sample size in a proposal or IRB application using the exact formula and parameters.
Interpreting Your Results
The calculator returns the minimum sample size meeting your stated precision requirements. In practice, always add a buffer of 10–20% to account for incomplete responses, data quality exclusions, and subgroup analyses. The rounded-up whole number is used as the recommended target because a fraction of a person is not a valid observation.