Statistics

Sample Size Calculator

Calculate the minimum sample size needed to achieve your target precision — for estimating means, detecting differences between two groups, or measuring proportions. Includes a precision vs sample size trade-off chart.

Formulas
n = (Zα/2 ⋅ σ / E)²
n = 2(Zα/2 + Zβ)² ⋅ σ² / δ²
n = Z² ⋅ p(1−p) / E²

Enter your parameters

Select the study type, then fill in the inputs. All calculations use two-sided tests.

Estimate from historical data Enter a positive standard deviation.
Maximum acceptable difference from the true mean (same units as σ) Enter a positive margin of error.
Estimate of within-group variation Enter a positive standard deviation.
Smallest difference worth detecting Enter a positive detectable difference.
Expected defect rate or percentage (0 to 1). Use 0.5 if unknown. Enter a proportion between 0 and 1.
Acceptable error around the proportion — e.g. 0.03 means ±3% Enter a positive margin of error (less than the proportion).
🧮

Ready to calculate

Choose your study type, enter the parameters, and press Calculate to see the minimum sample size with a precision trade-off chart.

Required sample size
samples required
Key parameters
What this means

Precision vs Sample Size Trade-off
See how increasing sample size reduces the margin of error — and where diminishing returns kick in
Required n
Your target
Practical Guidance for Your Study
How to plan, justify, and optimise your sample size decision
How it works

Why sample size matters

CI

Confidence & margin of error

The confidence level (e.g. 95%) is the probability that your interval contains the true value if you repeated the study many times. The margin of error is half the width of that interval. A wider margin means a less precise estimate but a smaller sample. Tighter precision always costs more samples.

1-β

Power (two-sample comparisons)

Statistical power is the probability of correctly detecting a real difference between two groups. Low power means you risk missing real improvements — a false negative (Type II error). Most studies target 80–90% power. Higher power requires larger samples, especially when the difference you want to detect is small.

Diminishing returns

Halving the margin of error requires quadrupling the sample size (the relationship is quadratic, not linear). This is why the trade-off chart is curved. Beyond a certain point, collecting more data yields very little additional precision — and the chart shows exactly where that inflection point occurs for your specific inputs.