Updated Stats & Research

Sample Size Calculator

Compute sample sizes for proportions, means, A/B tests, power and effect size, with finite population and dropout adjustments.

Proportions Means A/B Tests Power & Effect Size

All-in-One Sample Size Calculator

Use these tabs to design surveys, experiments, and A/B tests with the right sample size for your goals.

Enter as %, use 50% if unsure.
Leave blank or 0 for very large population.

Formula: n = z² · p(1 − p) ÷ E², where p is in proportion and E is margin of error.

Formula: n = (z · σ ÷ E)², where σ is standard deviation and E is margin of error.

Formula: adjusted n = base n ÷ (1 − dropout).

For worst case, use 50%.

Formula: E = z · √[p(1 − p)/n] for proportions.

Formula (equal groups): n per group ≈ 2·p̄(1−p̄)(zₐ + zᵦ)² ÷ (p₂ − p₁)², where p̄ is the average rate.

Cohen's d: 0.2 small, 0.5 medium, 0.8 large.

Approximate formula for two-sample tests: n per group ≈ 2(zₐ + zᵦ)² ÷ d².

Sample Size Calculator – Proportion, Mean, A/B Test & Power

This Sample Size Calculator helps you plan surveys, experiments, and A/B tests by estimating how many observations you need for a chosen confidence level, margin of error, power, and effect size.

Sample Size for Proportions

For a proportion estimate (for example a percentage who answer “yes”), the base sample size for a large population is:

n = z² · p(1 − p) ÷ E²

where z is the z-score for your confidence level, p is the estimated proportion, and E is the margin of error in proportion units.

Sample Size for a Mean

For estimating a mean value with known or approximate standard deviation σ, an approximate sample size is:

n = (z · σ ÷ E)²

where z is the z-score and E is the allowed margin of error in the same units as the mean.

Finite Population and Dropout Adjustments

When your population is not very large, the finite population correction reduces the required sample size:

n = n₀ ÷ [1 + (n₀ − 1)/N]

If you expect dropout or attrition, you can inflate the sample size by dividing by the retention rate.

Two-Proportion A/B Test Sample Size

For comparing two proportions such as conversion rates p₁ and p₂ with equal group sizes, an approximate sample size per group is:

n ≈ 2·p̄(1 − p̄)(zₐ + zᵦ)² ÷ (p₂ − p₁)²

where p̄ is the average of p₁ and p₂, zₐ is based on your confidence level, and zᵦ is based on your desired statistical power.

Power and Effect Size

For two-sample tests based on standardized effect size d (Cohen’s d), a common approximation is:

n ≈ 2(zₐ + zᵦ)² ÷ d²

where smaller effect sizes require larger samples to detect reliably with the same confidence and power.

Try more free calculators on MyTimeCalculator — fitness, finance, health, math, and science tools designed to help you plan and analyze with confidence.