STATISTICSSampling DistributionsStatistics Calculator
📊

Sample Size Calculator

Free sample size calculator. Cochran formula, survey proportion, mean estimation, t-test, proportion

Run CalculatorExplore data analysis and statistical calculations

Why This Statistical Analysis Matters

Why: Statistical calculator for analysis.

How: Enter inputs and compute results.

n
STATISTICSSampling & Power

Sample Size Calculator — Cochran, Krejcie-Morgan & NIST

Survey margin of error, mean estimation, clinical trials, A/B tests. FPC, dropout, DEFF. Step-by-step breakdown.

Real-World Scenarios — Click to Load

Survey — Margin of Error → n

sample_size_results.sh
CALCULATED
$ sample_size --mode="survey" --conf=0.95 --moe=0.03
Required n
1068
Margin of Error
±3.0%
Confidence Level
95%
Power
N/A
Share:
Sample Size Result
Required n = 1068
MOE ±3.0% · 95% confidence
numbervibe.com/calculators/statistics/sample-size-calculator

Calculation Breakdown

COCHRAN FORMULA
Cochran formula (infinite pop)
n₀ = 1068
n = z² × p̂(1−p̂) / E² = 1.96² × 0.50×0.50 / 0.030²
Required n
1068
No FPC (infinite population)

Sample Size vs Margin of Error

Sample Size vs Confidence Level

For educational and informational purposes only. Verify with a qualified professional.

Cochran's Formula & Key Takeaways

  • Cochran (1977): n = z² × p̂(1−p̂) / E² for proportion surveys. Use p̂ = 0.5 when unknown (conservative).
  • Krejcie-Morgan: Provides sample size tables for finite populations — equivalent to Cochran with FPC.
  • Mean estimation: n = (z × σ / E)². Requires prior estimate of σ (pilot study or literature).
  • Two-sample t-test: n per group = 2 × ((z_α/2 + z_β) / d)² where d = Cohen's d.
  • Two-proportion test: n per group = (z_α/2√(2p̄q̄) + z_β√(p₁q₁+p₂q₂))² / (p₁−p₂)².
  • FPC (Finite Population Correction): n_adj = n × N / (n + N − 1) when sampling >5% of population.
  • Dropout: n_adj = n / (1 − dropout_rate). DEFF (Design Effect): n_adj = n × DEFF for cluster sampling.

Did You Know?

🗳️Political polls often target ±3% MOE at 95% confidence. That requires ~1,067 respondents for p̂=0.5 (Cochran).Source: AAPOR
📊Using p̂ = 0.5 gives the maximum required sample size for proportion surveys — safe when unknown.Source: SurveyMonkey
💊Clinical trials typically aim for 80% power with α=0.05. Cohen's d=0.5 is a medium effect.Source: FDA Guidance
📱A/B tests comparing 5% vs 7% conversion need ~1,800+ per group for 80% power.Source: Evan Miller
📉Sample size scales with 1/E². Halving MOE requires 4× the sample size.Source: NIST Handbook
🎓Education studies often assume 10–20% dropout; inflate n accordingly (Krejcie-Morgan).Source: Educ Psychol Meas

Formulas (Cochran & NIST)

n = z² × p̂(1−p̂) / E²

Survey proportion (Cochran). With FPC: n_adj = n×N/(n+N−1)

n = (z × σ / E)²

Mean estimation (NIST)

n = 2 × ((z_α/2 + z_β) / d)²

Two-sample t-test, d = Cohen's d

n = (z_α/2√(p₀q₀) + z_β√(p₁q₁))² / (p₁−p₀)²

One-proportion hypothesis test

n = (z_α/2√(2p̄q̄) + z_β√(p₁q₁+p₂q₂))² / (p₁−p₂)²

Two-proportion test (A/B)

Practical Guidelines

Survey Design

Use ±3% for high-stakes (elections). ±5% for market research. ±10% for exploratory. 95% confidence is standard.

Clinical Trials

Target 80–90% power. Use effect size from pilot or literature. Plan for 10–20% dropout.

A/B Testing

Use two-proportion formula. Expect 1,500–3,000+ per group for small conversion differences.

DEFF & Clustering

DEFF = 1 + (m−1)×ρ. Typical 1.5–3 for household surveys. Multiply n by DEFF.

Frequently Asked Questions

What confidence level should I use?

95% is standard (AAPOR, SurveyMonkey). Use 99% for higher certainty; 90% when a rough estimate suffices.

Why use p̂ = 0.5 when proportion is unknown?

p̂(1−p̂) is maximized at 0.5, giving the largest (most conservative) required n (Cochran).

When do I need finite population correction?

When sampling more than 5% of the population (Krejcie-Morgan). E.g., small organizations, schools.

What is Cohen's d?

Effect size: d = (μ₁−μ₂)/σ. Small≈0.2, medium≈0.5, large≈0.8 (Cohen 1988).

How does dropout affect sample size?

Divide required n by (1 − dropout_rate). E.g., 15% dropout: n_adj = n / 0.85.

What is DEFF?

Design Effect. DEFF = 1 for SRS. Cluster sampling increases variance; DEFF typically 1.5–3.

Disclaimer: Sample size formulas assume ideal conditions (SRS, adequate np). Real-world factors (non-response, clustering, measurement error) may require adjustments. Not professional statistical consulting advice.

👈 START HERE
⬅️Jump in and explore the concept!
AI

Related Calculators