Sample Size Calculator
Calculate the required sample size for surveys and statistical studies
Results:
Required Sample Size: 35
Confidence Level: 95%
Margin of Error: ±5%
Standard Deviation: 15
Z-Score: 1.96
About Sample Size
Sample size determines how many observations are needed for reliable results in a study.
Formula (Infinite Population): n = (z²σ²) / E²
Formula (Finite Population): n = n₀ / (1 + (n₀-1)/N)
Tips:
- Larger confidence level requires larger sample
- Smaller margin of error requires larger sample
- For proportions, use standard deviation = 0.5
What Is Sample Size and Why Does It Matter?
Sample size is the number of observations or participants in a study. Determining the right sample size is crucial: too small means unreliable results that may miss real effects; too large wastes resources without adding value. Sample size calculations balance precision, confidence, and practical constraints.
| Sample Size | Pros | Cons |
|---|---|---|
| Too small | Cheaper, faster | Low power, wide confidence intervals, unreliable |
| Just right | Adequate power, valid conclusions | Requires careful calculation |
| Too large | High precision | Wasteful, finds trivial differences "significant" |
Sample Size for Proportion (Survey)
Where:
- n= Required sample size
- z= Z-score for confidence level (1.96 for 95%)
- p= Expected proportion (use 0.5 if unknown)
- E= Margin of error (e.g., 0.05 for ±5%)
Sample Size for Estimating Proportions
When conducting surveys or polls to estimate a percentage (proportion), sample size depends on desired confidence level, margin of error, and expected proportion.
| Confidence Level | Z-Score | Interpretation |
|---|---|---|
| 90% | 1.645 | 10% chance interval misses true value |
| 95% | 1.960 | 5% chance interval misses true value |
| 99% | 2.576 | 1% chance interval misses true value |
| Margin of Error | Sample Size (p=0.5, 95% CI) | Precision |
|---|---|---|
| ±10% | 97 | Low precision |
| ±5% | 385 | Standard |
| ±3% | 1,068 | High precision |
| ±1% | 9,604 | Very high precision |
Note: Using p = 0.5 (maximum uncertainty) gives the most conservative estimate—your actual required sample size may be smaller if the true proportion is far from 50%.
Sample Size for Estimating Means
When estimating a population mean (e.g., average income, average height), sample size depends on the desired precision and population variability.
| Factor | Effect on Required n | Relationship |
|---|---|---|
| Higher confidence level | Increases n | n ∝ z² |
| Smaller margin of error | Increases n (dramatically) | n ∝ 1/E² |
| Higher population SD | Increases n | n ∝ σ² |
Sample Size for Mean
Where:
- n= Required sample size
- z= Z-score for confidence level
- σ= Population standard deviation (estimate)
- E= Desired margin of error (same units as σ)
Finite Population Correction
When sampling from a finite population where your sample is a significant portion (>5%) of the total, you need fewer observations than the infinite population formula suggests.
| Population (N) | Sample % of N | Uncorrected n | Corrected n' | Reduction |
|---|---|---|---|---|
| 10,000 | 3.8% | 385 | 370 | -4% |
| 2,000 | 16% | 385 | 323 | -16% |
| 500 | 43% | 385 | 218 | -43% |
| 100 | 79% | 385 | 79 | -79% |
Finite Population Correction
Where:
- n'= Adjusted sample size
- n= Sample size for infinite population
- N= Total population size
Sample Size for Hypothesis Testing (Power Analysis)
Statistical power is the probability of detecting an effect when it truly exists. Power analysis determines sample size needed to detect a specified effect with a given confidence level.
| Parameter | Typical Value | Effect on Sample Size |
|---|---|---|
| Significance level (α) | 0.05 (5%) | Lower α → larger n |
| Power (1-β) | 0.80 (80%) | Higher power → larger n |
| Effect size (d) | 0.2 small, 0.5 medium, 0.8 large | Smaller effect → much larger n |
| Test Type | Effect Size d | Sample Size per Group (α=0.05, power=0.80) |
|---|---|---|
| Two-sample t-test | 0.2 (small) | 394 |
| Two-sample t-test | 0.5 (medium) | 64 |
| Two-sample t-test | 0.8 (large) | 26 |
Key insight: Detecting small effects requires dramatically larger samples than detecting large effects.
Practical Considerations
Real-world sample size planning must account for non-response, dropout, and other practical issues.
| Factor | Adjustment | Example |
|---|---|---|
| Non-response | n_actual = n / response_rate | If 60% response expected, divide by 0.6 |
| Dropout (longitudinal) | Account for attrition | Add 10-20% for expected dropout |
| Subgroup analysis | Size each subgroup adequately | If analyzing 4 subgroups, each needs sufficient n |
| Cluster sampling | Apply design effect | Multiply n by design effect (often 1.5-2) |
Rule of thumb: When in doubt, add 10-20% to your calculated sample size to account for unforeseen issues.
Sample Size for Common Research Scenarios
Different research designs have different sample size requirements. Here are common scenarios with typical recommendations.
| Research Type | Minimum Recommended n | Notes |
|---|---|---|
| Pilot study | 30-50 | Feasibility, not statistical inference |
| Survey (general population) | 384-400 | 95% CI, ±5% margin |
| A/B test (large effect) | 50-100 per group | 10%+ conversion difference |
| A/B test (small effect) | 1000+ per group | 1-2% conversion difference |
| Regression (rule of thumb) | 10-20 per predictor | Minimum 50 total |
| Factor analysis | 300+ or 10 per variable | Whichever is larger |
Worked Examples
Survey Sample Size Calculation
Problem:
A company wants to survey customers about satisfaction. They want 95% confidence with ±4% margin of error. What sample size is needed?
Solution Steps:
- 1Identify parameters: z = 1.96 (95% CI), E = 0.04, p = 0.5 (unknown proportion, use maximum)
- 2Apply formula: n = (z² × p × (1-p)) / E²
- 3Calculate: n = (1.96² × 0.5 × 0.5) / 0.04²
- 4n = (3.8416 × 0.25) / 0.0016 = 0.9604 / 0.0016 = 600.25
- 5Round up: n = 601
Result:
Need 601 survey responses for 95% confidence with ±4% margin of error. To account for 70% expected response rate, send surveys to 601/0.70 = 859 customers.
Sample Size for Comparing Two Means
Problem:
A researcher wants to detect a medium effect (d = 0.5) between two treatment groups with 80% power at α = 0.05. How many per group?
Solution Steps:
- 1Use power analysis formula: n per group = 2[(zα + zβ)²] / d²
- 2For α = 0.05 (two-tailed), zα = 1.96
- 3For power = 0.80, β = 0.20, zβ = 0.84
- 4n = 2 × [(1.96 + 0.84)²] / 0.5² = 2 × 7.84 / 0.25
- 5n = 15.68 / 0.25 = 62.7, round up to 63 per group
Result:
Need 63 participants per group (126 total) to detect a medium effect (d = 0.5) with 80% power. For 90% power, would need approximately 85 per group.
Finite Population Adjustment
Problem:
A school has 450 students. How many should be surveyed for 95% CI with ±5% margin?
Solution Steps:
- 1Calculate infinite population n: n = (1.96² × 0.5 × 0.5) / 0.05² = 384.16 → 385
- 2Apply finite population correction: n' = n / [1 + (n-1)/N]
- 3n' = 385 / [1 + (384)/450] = 385 / [1 + 0.853] = 385 / 1.853
- 4n' = 207.8 → round up to 208
Result:
Need only 208 students (not 385) because 450 is a small population. Survey about 46% of students rather than what infinite formula suggests.
Tips & Best Practices
- ✓Use p = 0.5 for proportion sample sizes when the true proportion is unknown—it's the most conservative choice.
- ✓Margin of error has a squared effect: halving the margin requires 4× the sample size.
- ✓Apply finite population correction when sampling more than 5% of a population.
- ✓Always plan for non-response by inflating sample size: n_needed / expected_response_rate.
- ✓For power analysis, 80% power with α = 0.05 is standard; use 90% power for important decisions.
- ✓Detecting small effects (d = 0.2) requires ~16× more participants than large effects (d = 0.8).
- ✓When in doubt, round up and add 10-20% buffer for unexpected dropouts or data quality issues.
Frequently Asked Questions
Sources & References
Last updated: 2026-01-22