Sample Size Calculator
Free sample size calculator for surveys, research & experiments. Calculate required n for means, proportions & group comparisons with confidence.
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))
Frequently Asked Questions
How do I calculate sample size for a survey?
To calculate sample size for a survey: (1) Choose your confidence level (typically 95%), (2) Set your desired margin of error (e.g., ±5%), (3) Estimate the expected proportion (use 50% if unknown), (4) Use the formula: n = (z² × p × (1-p)) / e². Our calculator above does this automatically.
What sample size do I need for 95% confidence?
For 95% confidence with ±5% margin of error and p=0.5, you need approximately 385 respondents. For ±3% margin, you need about 1,068. For ±1% margin, you need approximately 9,604.
How many participants do I need for a study?
The number of participants depends on: (1) Expected effect size—smaller effects require more participants, (2) Desired power (typically 80-90%), (3) Significance level (typically 0.05), (4) Type of analysis. Use our calculator for comparing two groups or estimating means.
What is margin of error?
Margin of error represents the range within which the true population value likely falls. For example, if 60% of respondents prefer Option A with ±5% margin of error, the true population proportion is likely between 55% and 65%.
What is the minimum sample size needed?
General minimums: For descriptive statistics, n ≥ 30 is often sufficient. For regression, aim for 10-20 observations per predictor. For proportions, ensure np ≥ 10 and n(1-p) ≥ 10. For reliable estimates, more is generally better.
How does population size affect sample size?
For large populations (>10,000), population size has minimal effect on required sample size. For smaller populations, apply the finite population correction: n’ = n / (1 + (n-1)/N), which reduces required sample size.
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
- Standard Deviation Calculator - Calculate variability
Want to learn the theory?
Our lessons explain the statistical concepts behind this calculator with clear examples.
Browse Lessons →