Sample Size Calculator
Estimate sample size for a proportion or mean.
About this tool
Enter a confidence level, a margin of error and an expected proportion to see how many respondents you need. 95% confidence with a ±5% margin needs 385.
How to use
How it works
The formula is n = z² · p(1 − p) ÷ e², rounded up. p = 0.5 gives the largest and safest answer. z comes from the inverse normal for your confidence level, so any level works. For 95% confidence and e = 0.05: 1.95996² × 0.25 ÷ 0.0025 = 384.15, which rounds up to 385.
n = z² · p(1 − p) ÷ e² z = 1.6449 (90%), 1.9600 (95%), 2.5758 (99%)
Worked example
A tighter margin at higher confidence
- Input
- 99% confidence, margin 0.03, p = 0.5
- Output
- 1,844
- Walkthrough
- 2.57583² × 0.25 ÷ 0.03² = 6.63490 × 0.25 ÷ 0.0009 = 1,843.03, rounded up to 1,844.
Limitations
- The margin of error must be between 0 and 1: enter 0.05, not 5.
- The confidence level must be strictly between 0 and 100.
- For proportions only. The expected proportion p must be strictly between 0 and 1 (0 and 1.2 are errors). It assumes a large population, with no finite-population correction.
Questions
What sample size gives ±5% at 95% confidence?
What sample size gives ±3% at 99% confidence?
What if I expect a proportion of 0.2?
Why use p = 0.5?
Can I use a confidence level other than 90, 95 or 99?
Features
- Any confidence level
- Conservative p = 0.5 default
- Rounded up
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Rectangle area as product of dimensions
Khan Academy
Foundational area thinking across math tools.
Watch on YouTubeStandard Deviation vs Standard Error
StatQuest with Josh Starmer
Avoids mixing SD and SE when reading results panels.
Watch on YouTube
- Correlation
Math is Fun
Correlation vs causation notes next to correlation tools.
- Statistics and probability
Khan Academy
Full stats path when a single calculator result needs context.