Sample Size Calculator
Free sample size calculator. Cochran formula, survey proportion, mean estimation, t-test, proportion
Why This Statistical Analysis Matters
Why: Statistical calculator for analysis.
How: Enter inputs and compute results.
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
Calculation Breakdown
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?
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.
Official Data Sources
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.
Related Calculators
Sampling Error Calculator
Computes expected sampling error for means and proportions. Shows how sampling error decreases with sample size. Margin of error, confidence intervals...
StatisticsSampling Distribution of the Sample Proportion Calculator
Calculate the sampling distribution of p̂ (sample proportion). Shows normality conditions, standard error, probabilities for p̂, and required sample size for...
StatisticsRelative Standard Error Calculator
Computes RSE = (SE/Estimate) × 100%. Used in survey statistics and government data for reliability assessment. MOE, CI, design effect.
StatisticsStandard Deviation of Sample Mean Calculator
Computes the standard deviation of the sampling distribution of the mean (σ_x̄ = σ/√n), also called the standard error of the mean. Shows how variability of...
StatisticsStandard Error Calculator
Computes standard error for various statistics: SE of mean, proportion, difference of means, difference of proportions, correlation, median, and regression...
StatisticsMargin of Error Calculator
Computes margin of error for surveys and polls. Handles proportions and means, determines required sample size, and shows confidence interval.
Statistics