Sample Size Calculator

Calculate the minimum sample size needed for surveys, experiments, and clinical trials. Find n based on confidence level, margin of error, and expected proportion or effect size.

📊 Statistics📐 n = (z*/MOE)² × p(1-p)🔢 Math
Calculation type
Margin of error (e.g. 0.05 for ±5%)
Expected proportion p (0.5 if unknown)
Confidence level (90, 95, or 99)
Population SD (for mean type)
Please enter valid values.

Formula & Reference

VariableSymbolFormulaUnits
Sample Size Calculatorn = (z*/MOE)² × p(1-p)participants

Step-by-Step Examples

Example 1
National Poll

95% CI, ±3% margin of error, unknown proportion (use p=0.5).

  • n = (1.96/0.03)² × 0.5 × 0.5
  • = 42.78² × 0.25 = 4268 × 0.25 = 1067
  • Round up: n = 1,068 participants
  • This is why national polls often use ~1000-1500 respondents
✓ n = 1,068 for ±3% margin at 95% CI
Example 2
Company Survey

95% CI, ±5% MOE, expect ~30% yes response.

  • n = (1.96/0.05)² × 0.3 × 0.7
  • = 1536.64 × 0.21 = 323
  • Smaller than ±3% case because larger MOE allowed
✓ n = 323 for ±5% margin at 95% CI
Example 3
Clinical Trial (Mean)

95% CI, want MOE of ±2 mmHg blood pressure, SD=12 mmHg.

  • n = (1.96 × 12 / 2)² = (11.76)² = 138.3
  • n = 139 patients per group
  • For two-group trial: total n = 278
✓ n = 139 per group

Real-World Applications

Common Mistakes to Avoid

⚠️
Using p=0.5 without reason

p=0.5 gives the largest (most conservative) sample size. If you have prior data suggesting p≈0.2, use it — you need fewer participants.

⚠️
Forgetting non-response

The calculated n is the required complete responses. If 40% won't respond, you must contact n/0.6 people.

⚠️
Confusing one-group and two-group designs

This calculator gives n for one proportion/mean. For comparing two groups (A/B test), you often need this n per group.

Frequently Asked Questions

What is margin of error?
The ±amount in the CI. ±3% means the true proportion is within 3 percentage points of your sample result (at the stated confidence level). Smaller MOE = more precise = larger sample needed.
Why does p=0.5 give the largest sample?
p(1-p) is maximized at p=0.5 (value = 0.25). At any other p, p(1-p) < 0.25, requiring fewer participants. So p=0.5 is the conservative worst-case assumption.
How does confidence level affect sample size?
Higher CL → larger z* → larger n. Going from 95% to 99% CI: 2.576² vs 1.96² = 6.64 vs 3.84. The 99% CI requires 6.64/3.84 = 1.73× more participants.
What is statistical power?
Power = probability of detecting a real effect. This calculator is for precision (CI width). For hypothesis testing (t-test, ANOVA), use power analysis with effect size, α, and power (usually 0.80).
Does sample size depend on population size?
For large populations (N > 10,000), population size barely matters. For small populations, apply finite population correction: n_adj = n / (1 + n/N).

Related Math Calculators

Formula Explorer connections

Interpretation: This formula summarizes data, models uncertainty or supports inference about a population or random process. Assumption: The sampling design and distribution assumptions must match the data. Independence, sample size, outliers and measurement quality can materially affect interpretation.

Scatter Plot Calculator →Standard Deviation Calculator →Standard Error Calculator →Math Formula Explorer →