Sample Size Calculator
Find how many responses your survey or study needs: n = z²p(1−p)/e², with finite population correction, for any confidence level and margin of error.
Working
n₀ = z²·p(1−p) ÷ e² = 1.96² × 0.5 × 0.5 ÷ 0.05² = 384.16. Sample sizes are always rounded up.
What is the Sample Size Calculator?
The ByteTools Sample Size Calculator tells you how many people you need to survey to achieve a chosen margin of error at a chosen confidence level.
- Solves n = z²p(1−p)/e² with the inputs you control
- Finite population correction for small, known populations
- Standard confidence levels plus custom levels via inverse normal
- Shows the unadjusted and corrected sample sizes
- Explains each input in plain language
- 100% private — computed entirely in your browser
How to use the Sample Size Calculator
- 1
Choose a confidence level (95% is the common default) or enter a custom one.
- 2
Enter your desired margin of error, e.g. 5%.
- 3
Optionally adjust the expected proportion (leave 50% if unsure).
- 4
Optionally enter the total population size for the finite correction.
- 5
Read the required sample size, rounded up, and copy the result.
About the Sample Size Calculator
The ByteTools Sample Size Calculator tells you how many people you need to survey to achieve a chosen margin of error at a chosen confidence level. It solves the standard formula n = z²·p(1−p) / e², where z is the critical value for your confidence level, p is the expected proportion and e is the margin of error.
If you know the total population size — a mailing list, a customer base, a school — the tool applies the finite population correction, which can substantially reduce the required sample when the population is small. Standard confidence levels use exact z values, and custom levels are handled by an inverse-normal approximation.
Everything is calculated 100% locally in your browser and nothing is stored. The default p = 50% is the conservative choice that maximises the required sample; if you have a prior estimate of the proportion, entering it will usually lower the number you need.
Frequently asked questions
How do you calculate sample size for a survey?
Use n = z²·p(1−p)/e². For 95% confidence (z = 1.96), a 5% margin of error and p = 0.5, you get n = 1.96² × 0.25 / 0.05² = 384.16, rounded up to 385 respondents. This tool does that arithmetic and the rounding for you.
What is the finite population correction?
When you sample a noticeable fraction of a small population, you need fewer responses than the infinite-population formula suggests. The corrected size is n₀ / (1 + (n₀−1)/N). For n₀ = 385 and a population of 1,000, the requirement drops to 278.
Why use 50% as the expected proportion?
Because p(1−p) is largest at p = 0.5, assuming 50% yields the biggest — safest — sample size. If prior data suggests the true proportion is nearer 10% or 90%, using that estimate legitimately reduces the required sample.
Does a bigger population always need a bigger sample?
Not really — this surprises most people. Beyond a few tens of thousands, population size barely matters: a national survey and a city survey both need roughly 385 responses for ±5% at 95% confidence. Population size only helps when it is small relative to the sample.
What margin of error should I aim for?
±5% at 95% confidence is the common standard for general surveys; ±3% is typical for published polls. Halving the margin of error roughly quadruples the required sample, so tighter precision gets expensive quickly.
Related tools
Margin of Error Calculator
Calculate the margin of error for a survey or sample: z × √(p(1−p)/n) for proportions or z × σ/√n for means, with finite population correction.
Confidence Interval Calculator
Build a confidence interval for a mean (z or t) or a proportion. Get the margin of error, lower and upper bounds, and the critical value used, step by step.
Normal Distribution Calculator
Compute normal distribution probabilities for any mean and standard deviation: P(X<x), P(X>x), P(a<X<b), the PDF, plus an inverse quantile mode.
Percentage Calculator
Calculate what X% of a number is, what percent one number is of another, and percentage increase or decrease between two values — instantly and free.
Probability Calculator
Work out probabilities for one or two events: complement, union, intersection, conditional probability and the chance of at least one success in n trials.