Sample Size Calculator
Free sample size calculator for surveys and research. Calculate required sample size for proportions, means, and group comparisons.
For finite population correction
Quick Reference: Common Sample Sizes
For Proportions (95% CI, p = 0.5)
Effect Size Guidelines (Cohen's d)
How to Use the Sample Size Calculator
This calculator determines the minimum sample size needed for your research or survey. Choose from three calculation types based on your study design.
Sample Size for Proportions
Use this when estimating a percentage or proportion (e.g., survey responses, conversion rates).
Formula
n = (z² × p × (1-p)) / e²
Where:
- z = z-score for confidence level (1.96 for 95%)
- p = expected proportion (use 0.5 if unknown)
- e = margin of error (as decimal)
Quick Reference Table
| Margin of Error | 90% CI | 95% CI | 99% CI |
|---|---|---|---|
| ±10% | 68 | 97 | 166 |
| ±5% | 271 | 385 | 664 |
| ±3% | 752 | 1,068 | 1,844 |
| ±2% | 1,692 | 2,401 | 4,148 |
| ±1% | 6,766 | 9,604 | 16,590 |
Assumes p = 0.5 (maximum variability)
Sample Size for Means
Use this when estimating a continuous variable (e.g., average income, test scores).
Formula
n = (z × σ / e)²
Where:
- z = z-score for confidence level
- σ = population standard deviation (estimated)
- e = desired margin of error (same units as the mean)
Example
To estimate average income within ±25,000:
n = (1.96 × 25,000 / 5,000)² = 96 people
Sample Size for Comparing Two Groups
Use this when comparing two independent groups (e.g., treatment vs. control).
Formula
n per group = 2 × ((z_α + z_β) / d)²
Where:
- z_α = z-score for significance level (e.g., 1.96 for α = 0.05)
- z_β = z-score for power (e.g., 0.84 for 80% power)
- d = Cohen’s d (effect size)
- Result is per group
Effect Size Guidelines (Cohen’s d)
| Effect | d | Example |
|---|---|---|
| Small | 0.2 | Subtle differences, large overlap |
| Medium | 0.5 | Noticeable difference |
| Large | 0.8 | Obvious difference, little overlap |
Sample Sizes for Two-Group Comparison
| Effect Size | 80% Power | 90% Power |
|---|---|---|
| d = 0.2 | 394/group | 527/group |
| d = 0.5 | 64/group | 86/group |
| d = 0.8 | 26/group | 34/group |
At α = 0.05, two-tailed
Finite Population Correction
When sampling from a finite population (N), apply the correction:
n’ = n / (1 + (n-1)/N)
This reduces the required sample size when sampling a significant portion of the population.
Example
If you calculate n = 400, but your population is N = 1,000:
n’ = 400 / (1 + 399/1000) = 400 / 1.399 ≈ 286
Factors Affecting Sample Size
| Factor | Effect on Sample Size |
|---|---|
| ↑ Confidence level | Larger sample needed |
| ↑ Precision (↓ margin of error) | Larger sample needed |
| ↑ Expected variability | Larger sample needed |
| ↑ Effect size | Smaller sample needed |
| ↑ Power | Larger sample needed |
Common Questions
Why use p = 0.5 for proportions?
When you don’t know the expected proportion, 0.5 gives the maximum sample size needed. Any other proportion would require fewer samples.
What confidence level should I use?
- 90%: Preliminary studies, quick estimates
- 95%: Standard for most research (recommended)
- 99%: When high certainty is critical
What is statistical power?
Power is the probability of detecting an effect if it exists. Standard is 80%, but 90% is better for important decisions.
How do I estimate standard deviation?
- Use data from previous similar studies
- Conduct a pilot study
- Use the range/4 as a rough estimate
- For proportions, use √(p(1-p))
Design Considerations
Practical Sample Size
Always add extra to account for:
- Non-response (typically 10-50%)
- Invalid responses
- Subgroup analysis needs
- Dropout in longitudinal studies
Adjusted n = n / (1 - expected dropout rate)
Minimum Sample Sizes
- For normal approximation: n ≥ 30
- For proportions near 0 or 1: larger n needed
- For regression: n ≥ 10 × number of predictors
Related Resources
- Confidence Intervals - Understanding intervals
- Hypothesis Testing - Power and significance
- Central Limit Theorem - Why sampling works
- Standard Error - Measuring precision
Want to learn the theory?
Our lessons explain the statistical concepts behind this calculator with clear examples.
Browse Lessons →