Sample Size Calculator
Two modes: calculate minimum sample size for a proportion survey (n = z²×p(1−p)/ME²) or for estimating a mean (n = (z×σ/ME)²). Also includes a p-value calculator from z-scores.
You might also need
How It Works
Enter: confidence level (90, 95, or 99%), margin of error (e.g. 0.05 for ±5%), and estimated proportion p (use 0.5 if unknown). Formula: n = z² × p(1−p) / ME². Result: minimum sample size required. For 95% CI, ME=3%, p=0.5: n = 3.8416 × 0.25 / 0.0009 = 1068. You need at least 1068 respondents.
n = z² × p(1−p) / ME² | use p=0.5 for worst case95% CI, ME=5%, p=0.5 → n=385 | ME=3% → n=1068Enter: confidence level, margin of error (in the same units as your measurement), and standard deviation σ (from literature or pilot study). Formula: n = (z × σ / ME)². For 95% CI, σ=20, ME=5: n = (1.96×20/5)² = (7.84)² = 61.5 → n=62. Always round UP to the next integer.
n = (z × σ / ME)² | round UP always95% CI, σ=20, ME=5 → n=62 | ME=2 → n=385For populations of known finite size N: n_adj = n / (1 + (n−1)/N). This reduces the required sample. If N=500 and n=385: n_adj = 385/(1+384/500) = 385/1.768 ≈ 218. The finite correction matters when your sample would be more than ~5% of the population.
n_adj = n / (1 + (n−1)/N) | use when n/N > 5%N=500, n=385 → n_adj≈218 | N=10000, n=385 → n_adj≈371Switch to the P-Value tab. Enter a z-score and select one-tailed or two-tailed test. The calculator finds the area under the normal curve beyond your z-score. For z=1.96, two-tailed: p = 2×P(Z>1.96) = 2×0.025 = 0.05. For z=2.576: p=0.01. A p-value < 0.05 indicates statistical significance at the 5% level.
p = 2×Φ(−|z|) for two-tailed | p = Φ(−z) for one-tailedz=1.96 → p=0.05 (2-tailed) | z=2.576 → p=0.01Three-way relationship: narrower ME → larger n. Higher confidence → larger n (z² grows). Larger σ → larger n. To reduce n: accept wider ME, lower confidence, or reduce variation (better measurement). Halving ME quadruples n (n ∝ 1/ME²). Going from 95% to 90% confidence reduces n by 27% (1.645²/1.96²=0.705).
n ∝ z², n ∝ 1/ME², n ∝ σ²ME: 5%→3% triples n | 95%→90%: n reduces by 27%Quick Reference
Verify these in the calculator above.
Proportion
95% CI, ME=5%, p=0.5
n = 385
Proportion
95% CI, ME=3%, p=0.5
n = 1,068
Proportion
99% CI, ME=5%, p=0.5
n = 664
Mean
95% CI, σ=15, ME=3
n = 97
P-Value
z=1.96, two-tailed p
p = 0.05
P-Value
z=2.576, two-tailed p
p = 0.01
P-Value
z=1.645, one-tailed p
p = 0.05
Trade-off
ME halves → n
multiplies by 4
Tips & Shortcuts
Always use p=0.5 for the proportion estimate if you have no prior information — this gives the most conservative (largest) sample size, ensuring adequate precision.
Round sample sizes UP always, never down. n=384.16 means you need 385. A fractional person is not a valid sample unit.
For the Mean mode, get σ from a pilot study, previous research, or literature. If unavailable, use the range/4 as a rough estimate (assumes normality).
In the P-Value tab: for two-tailed tests (the standard for most research), double the one-tailed p-value. z=2.0 gives one-tailed p=0.0228, two-tailed p=0.0455.
Non-response rate matters: if you expect 60% response rate and need n=385 completed responses, send to 385/0.6 ≈ 642 people.
Common Mistakes
Rounding sample size down
n=384.16 requires n=385. Rounding to 384 means your confidence interval is slightly wider than specified. Always round UP for sample sizes.
Using ME as a decimal for percentage inputs
If ME should be ±5%, enter 0.05 (decimal) not 5 (percentage) in the formula. The calculator specifies which format is expected. Using 5 instead of 0.05 gives n = z²×p(1−p)/25 — massively too small.
Ignoring non-response in survey design
If the required n is 385 and you expect 70% response rate, you need to contact 385/0.70 = 550 people. The sample size formula gives the number of completed responses needed, not invitations sent.
Assuming the formula applies to non-random samples
These formulas assume simple random sampling. Convenience samples, self-selected samples, and non-random panels do not benefit from larger n in the same way — sampling bias is not fixed by sample size.
Confusing sample size for CI with sample size for hypothesis tests
The calculator computes n for confidence intervals. Hypothesis test sample sizes require additional input (effect size, power). For power analysis (e.g. detecting a 5% difference with 80% power), use a power analysis tool.
Frequently Asked Questions
For proportions: n = z² × p(1−p) / ME². For 95% CI (z=1.96), ME=5%, p=0.5 (worst case): n = 1.96² × 0.25 / 0.05² = 3.8416 × 0.25 / 0.0025 = 384.16 → n=385.
Margin of error (ME) is half the width of the confidence interval. A 95% CI of 45% to 55% has ME=5%. ME = z × SE. Smaller ME requires more observations. Typical surveys use ME=3% to 5%.
p=0.5 gives the maximum variance p(1−p)=0.25, producing the largest (most conservative) sample size. If you have prior information suggesting p≠0.5, using that estimate reduces the required n.
n = (z × σ / ME)². Need: z (from confidence level), σ (population SD, estimated from pilot study or literature), and ME (desired precision). For 95% CI, σ=15, ME=3: n = (1.96×15/3)² = (9.8)² = 96.04 → n=97.
z changes from 1.96 to 2.576. Since n ∝ z², sample size increases by (2.576/1.96)² ≈ 1.73×. To go from 95% to 99% confidence with the same ME, you need about 73% more observations.
Only for small populations. For infinite populations: n = z²p(1−p)/ME². For finite population N: n_adjusted = n / (1 + (n−1)/N). For N=10,000 and n=385: n_adj = 385/(1+384/10000) ≈ 371. The correction matters only when n/N exceeds 5%.
P-value is the probability of observing a test statistic at least as extreme as your result, assuming the null hypothesis is true. p < 0.05: reject null at 5% significance. p < 0.01: reject at 1%. A smaller p-value means stronger evidence against the null — not that the effect is larger.
Related Calculators
Variance Calculator
Calculate population and sample variance.
Statistics Calculator
Full descriptive statistics: mean, median, mode, range, std dev.
Probability Calculator
Calculate event probability, odds, and complementary probability.
Simple Interest Calculator
Calculate interest earned on a principal without compounding.
Present Value Calculator
Find the current value of a future sum of money.
Scientific Calculator
Full scientific calculator with trig, log, and advanced functions.