Sample Size Calculator
Work out how many survey responses or measurements you need for a chosen margin of error and confidence level.
For a survey percentage, the sample size is z squared times p times (1 - p), divided by the margin of error squared, rounded up. At 95% confidence (z = 1.960) with a 5% margin and p = 50%, that is 384.16, so you need 385 responses. Tightening the margin to 3% raises it to 1,068.
Results assume a simple random sample from a large population and use z values rounded to three decimals. They do not account for non-response, survey design effects, small populations or bias in who answers, so a real study may need a larger sample; for research with consequences, check the design with a statistician.
Sample size needed
385
Responses, rounded up from 384.16
- z for the confidence level
- 1.960
- Formula
- n = z squared x p x (1 - p) / E squared
Embed this calculator on your site →
About the Sample Size Calculator
A sample size calculation answers one question: how many responses do you need so that your result lands within a set distance of the true value most of the time? Three inputs set it. The confidence level sets z, the number of standard errors the margin covers: 1.645 at 90%, 1.960 at 95% and 2.576 at 99%. The margin of error is the plus-or-minus you can live with. And the expected percentage, p, matters because the spread of a yes/no answer is greatest near 50%. With no prior estimate, use 50%, which gives the largest and safest sample. The margin enters squared, so it drives the size hardest: tightening it from plus or minus 5% to 3% at 95% confidence raises the sample from 385 to 1,068 responses. A textbook example at 90% confidence, a 3% margin and p = 50% works out to 751.67, rounded up to 752. If you expect a percentage near 20%, the same 95% and 5% need only 246. To estimate an average instead, enter a standard deviation from earlier data: with a standard deviation of 15 and a margin of 5 at 95%, you need 35. These formulas assume a simple random sample from a large population and say nothing about bias from who chooses to respond.
Frequently asked questions
How many survey responses do I need?+
At 95% confidence and a margin of error of plus or minus 5%, 385 responses, using p = 50% when you have no estimate. For plus or minus 3% you need 1,068, and at 99% confidence with a 1% margin, 16,590.
Why use 50% for the expected percentage?+
p x (1 - p) is largest at p = 50%, so it gives the biggest sample and covers any true value. If you already know the answer is near 20% or 80%, entering it gives a smaller sample: 246 instead of 385 at 95% and 5%.
What does the confidence level mean?+
It is how often the method gives a range that contains the true value. At 95%, about 19 in 20 samples would give an estimate within the margin of the true value. Higher confidence uses a bigger z, 2.576 at 99%, and needs more responses.
Does the size of my population matter?+
Not in these formulas, which assume the population is large compared with the sample. For a small population the true requirement is lower; this calculator does not apply a finite population correction.
Proportion formula and rounding up: OpenStax, Introductory Statistics 2e, section 8.3. Mean: NIST/SEMATECH e-Handbook, 7.2.2.2. z values: NIST/SEMATECH e-Handbook, 1.3.6.7.1.
Embed this calculator
Free to use on your own site. Paste this snippet where you want the sample size calculator to appear — it resizes itself automatically.
<iframe
src="https://manytools.co/embed/sample-size-calculator"
title="Sample Size Calculator by ManyTools"
data-manytools="sample-size-calculator"
width="100%"
height="640"
loading="lazy"
style="border:0;width:100%;max-width:720px"></iframe>
<script>
(function () {
window.addEventListener("message", function (e) {
if (e.origin !== "https://manytools.co") return;
var d = e.data || {};
if (d.type !== "manytools:embed:height" || d.slug !== "sample-size-calculator") return;
var f = document.querySelector('iframe[data-manytools="sample-size-calculator"]');
if (f && d.height) f.style.height = d.height + "px";
});
})();
</script><a href="https://manytools.co/math/sample-size-calculator">Sample Size Calculator by ManyTools</a>