Research Sample Size Calculator
Estimate sample size for a proportion or mean at a chosen confidence level.
About this tool
Work out how many responses you need. In proportion mode, give a confidence level, a margin of error and an expected proportion; at 95% confidence, a 5% margin and p = 0.5 you need 385. In mean mode, give the margin of error and the standard deviation.
How to use
How it works
For a proportion, n = z²·p·(1 − p) / e². The most cautious choice, p = 0.5, gives the largest n. For a mean, n = (z·σ / e)². z is the inverse normal value for your confidence level (1.6449 for 90%, 1.9600 for 95%, 2.5758 for 99%), and any level between 0 and 100 works. The result is the exact formula value rounded up once at the end.
proportion: n = z²·p(1 − p) / e² mean: n = (z·σ / e)²
Worked example
A survey at 99% confidence
- Input
- Proportion, 99% confidence, margin 0.03, p 0.5
- Output
- n = 1844
- Walkthrough
- 2.57583² × 0.5 × 0.5 / 0.03² = 1,843.03, rounded up to 1,844. At 95% with a 0.05 margin the same formula gives 385.
Limitations
- The confidence level must be strictly between 0 and 100; 0 or 100 returns an error.
- Mean mode needs the standard deviation in advance. With σ = 10 and e = 2 at 95% it gives 97 (1.95996 × 10 ÷ 2 = 9.7998, squared 96.04, rounded up).
- No finite population correction for small populations.
- Assumes simple random sampling.
Questions
How many responses do I need for a survey?
Why use p = 0.5?
How does the margin of error change the sample size?
Can I use a confidence level such as 80% or 97%?
Does it correct for a small population?
Features
- Proportion and mean
- Any confidence level
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Learn JSON - Full Crash Course
freeCodeCamp.org
JSON is a primary interchange format for data utilities.
Watch on YouTubeMean, Variance and Standard Deviation
StatQuest with Josh Starmer
Spread metrics when analyzing pasted datasets.
Watch on YouTube
- Fetch API
MDN
How browsers pull remote data into local tools.
- Data Index
Math is Fun
Stats explainers when summarizing columns.