Sample size calculator
Calculate your survey's sample size online for free. Enter the population size, confidence level and margin of error, and get the number of completed responses you need.
- Checked against reference values
- Free, no sign-up
- Nothing leaves your browser
Research parameters
Total people in the target audience. Leave empty if unknown or very large.
Share of intervals built this way that contain the true value over repeated surveys.
Half-width of the confidence interval around the result. Standard is 5%.
If unknown, use 50%: it gives the largest (conservative) sample size.
Assumptions and limitations
- Cochran formula for estimating a proportion.
- p = 50% gives the largest (conservative) sample size.
- The finite population correction is applied when you enter the population size.
- Assumes a simple random sample: the result does not cover bias from who chooses to respond.
Ready to collect 385 responses? Start from a template or let Ninja AI draft the questions, then share the survey by link or QR code.
Use this template See the questions firstData is not stored — calculation runs in your browser.
Ready-made template
Do it with your own respondents
The “Market research survey” template already has the questions. Put in your company name, share the link and watch the answers come in.
- Copy the template: the questions are written
- Share it by link, QR code or a widget on your site
- Read the results in the report with charts
New accounts get 14 days of Premium features, no credit card.
What is sample size in statistics?
Sample size is the number of completed responses a survey needs so that a percentage measured in it lands within a chosen margin of error of the true population value, at a chosen confidence level. It is calculated with Cochran's formula, n₀ = z² × p(1−p) / e², corrected for small populations. At 95% confidence and ±5%, a large population needs 385 responses.
How to calculate sample size step by step
-
1. Choose the confidence level
The confidence level gives the critical value z: 1.645 for 90%, 1.96 for 95%, 2.576 for 99%. It describes the method, not one survey: if you repeated the survey many times with new random samples, about 95% of the intervals built this way would contain the true value.
-
2. Set the margin of error
The margin of error e is the precision you need, written as a decimal: ±5% is 0.05. With a margin of ±5% and a result of 60%, the 95% confidence interval is 55–65%. Halving the margin roughly quadruples the sample.
-
3. Apply Cochran's formula
n₀ = z² × p × (1−p) / e², where p is the expected proportion. If you do not know it, use p = 0.5. At 95% and ±5%: n₀ = 1.96² × 0.25 / 0.0025 = 384.15, rounded up to 385.
-
4. Correct for a finite population
n = n₀ / (1 + (n₀−1)/N), applied when the population N is known. For N = 2,000: 384.15 / (1 + 383.15 / 2,000) = 322.4, rounded up to 323. The correction matters when n₀ is more than about 5% of N.
-
5. Turn responses into invitations
The formula gives completed responses, not invitations. Divide by the response rate you expect: 323 responses at a 25% response rate means 1,292 invitations. The invitations calculator among the related tools below does this and adds a buffer.
-
Finite or infinite population
A population is finite when you can count it: the 800 employees of a company, the students of one university, the customers in your CRM. Treat it as infinite when it is very large or unknown, like the adults of a country. Above about 20,000 people the correction barely changes the result: 377 instead of 385 at ±5%.
Sample size calculation examples
-
Customer survey, large audience
- Population unknown, 95% confidence, ±5% margin of error, p = 50%.
n₀ = 384.15, rounded up to 385 completed responses.
-
Employee survey in a company of 800
- N = 800, 95% confidence, ±5% margin of error, p = 50%.
n = 384.15 / (1 + 383.15 / 800) = 259.8, so 260 responses: about a third of the staff.
-
High precision for a decision that matters
- Population unknown, 99% confidence, ±3% margin of error.
1,844 responses, almost five times the standard 385.
-
Expected share known from a previous wave
- Last year 20% of customers were dissatisfied. 95% confidence, ±5%, p = 20%.
n₀ = 1.96² × 0.2 × 0.8 / 0.0025 = 245.9, so 246 responses. If you are not sure the share is still close to 20%, keep p = 50% and plan 385.
-
From responses to invitations
- 385 responses needed, expected response rate 20%.
385 / 0.20 = 1,925 invitations. If the response rate may come in lower, invite more people from the start.
Sample size table by population size
* At 95% confidence and p = 50%, rounded up, exactly as the calculator computes them.
| Population | MOE ±5% | MOE ±3% | MOE ±1% |
|---|---|---|---|
| 100 | 80 | 92 | 99 |
| 200 | 132 | 169 | 196 |
| 300 | 169 | 235 | 291 |
| 500 | 218 | 341 | 476 |
| 1,000 | 278 | 517 | 906 |
| 2,000 | 323 | 697 | 1,656 |
| 5,000 | 357 | 880 | 3,289 |
| 10,000 | 370 | 965 | 4,900 |
| 20,000 | 377 | 1,014 | 6,489 |
| 50,000 | 382 | 1,045 | 8,057 |
| 100,000 | 383 | 1,056 | 8,763 |
| 1,000,000 | 384 | 1,066 | 9,513 |
| Unknown or very large | 385 | 1,068 | 9,604 |
Sample size by confidence level and margin of error
* Unknown or very large population, p = 50%. For a known population, enter it in the calculator.
| Margin of error | 90% | 95% | 99% |
|---|---|---|---|
| ±10% | 68 | 97 | 166 |
| ±7% | 139 | 196 | 339 |
| ±5% | 271 | 385 | 664 |
| ±4% | 423 | 601 | 1,037 |
| ±3% | 752 | 1,068 | 1,844 |
| ±2% | 1,691 | 2,401 | 4,147 |
| ±1% | 6,764 | 9,604 | 16,588 |
What to avoid
-
Confusing sample size and population
The sample is who you survey; the population is the entire target audience. The calculator shows how many people from the population to survey.
-
Stopping data collection early
Until you reach the calculated size, the margin of error is wider than planned. Reach the target sample size.
-
Ignoring the correction for small populations
If the audience is a few thousand people or fewer, enter it in the population field, otherwise the required sample will be overstated.
-
Assuming 385 is always enough
The size depends on the margin of error and the expected proportion. For ±3% or 99% confidence you need more respondents.
-
Treating an open link as a random sample
The formula assumes everyone in the population had the same chance to be asked. A link posted on social media collects the people who chose to answer, and a larger sample does not remove that bias.
Before launching the survey
- Define the target audience and how you will reach them.
- Calculate the sample size (this calculator) and fix the margin of error and confidence level.
- Estimate the response rate and calculate how many invites to send.
- Prepare a short survey and a test invite.
- Launch collection and monitor progress toward the target sample.
Next step
Read the answers in a report, not a spreadsheet
Charts are built for you from every answer. Share the report by link or export the answers to Excel, CSV or SPSS.
- Ready questions or AI from a description
- A link for your email or chat, a QR code or a widget on your site
- Charts in the report, export to Excel, CSV and SPSS
FAQ about sample size
What is the formula to calculate sample size?
Cochran's formula for proportions: n₀ = z² × p(1−p) / e², where z comes from the confidence level (95% → 1.96), p is the expected proportion and e the margin of error as a decimal. When the population N is known, apply the finite population correction: n = n₀ / (1 + (n₀−1)/N). Round the result up. At 95% and ±5% this gives 385 for a large population and 323 for a population of 2,000.
What sample size do I need for 95% confidence?
For a ±5% margin of error and a large or unknown population you need 385 completed responses. For ±3% you need 1,068, for ±10% you need 97. A smaller population needs fewer: 278 responses for a population of 1,000 at ±5%.
What if I don't know the population size?
Leave the population field empty. The calculator then uses the formula for an infinite population, which gives the largest sample for your settings, so the precision holds whatever the real size is. Above about 20,000 people the difference is small anyway: 377 responses instead of 385 at ±5%.
What is the difference between a finite and an infinite population?
A finite population has a known, countable size, such as the employees of a company or the members of an association. An infinite population is one too large or too vague to count, such as the customers of a national chain. For a finite population the finite population correction lowers the required sample; for an infinite one it does not apply.
Why does p = 50% give the maximum sample size?
At p = 50% the product p(1−p) is at its maximum (0.25). If you don't know the expected proportion, use 50%: that gives a conservative estimate that keeps the planned precision whatever the actual split turns out to be.
What is confidence level?
Confidence level describes how reliable the method is: if you repeated the survey many times, about 95% of the confidence intervals built this way would contain the true value. For a single survey the true value is either inside its interval or not. Standard is 95%; for critical decisions use 99%.
What is margin of error?
Margin of error is the half-width of the confidence interval around your result. With a margin of ±5% and a result of 60%, the 95% confidence interval is 55–65%. A smaller margin requires a larger sample.
How do I draw a sample from a population?
In three steps. First work out how many responses you need: enter the population, confidence level and margin of error above. For 2,000 people at 95% and ±5%, that is 323 responses. Then pick who to ask at random, for example with a random draw from the full list of customers or employees, so everyone has the same chance to be selected. Finally, send more invitations than the responses you need, because not everyone answers.
When does the calculation hold?
The formula assumes a simple random sample: every member of the population has the same chance to be selected, and whether someone answers does not depend on what they would answer. If you sample whole groups (clusters) such as stores or classes, the required size is usually larger. If response rates differ a lot between groups, set quotas or weight the results.
How many invitations do I need to send?
Divide the required sample by the response rate you expect. For 385 responses at a 20% response rate you need 1,925 invitations; at 10%, 3,850. Use the response rate of your previous surveys with the same audience if you have one.
Can I collect the sample in SurveyNinja?
Yes. Create a survey in SurveyNinja and share it by link, QR code or a widget on your site. The report shows how many responses have come in, so you can see when you reach the target sample size, and quotas let you cap the number of responses per group.
Sources
- Cochran, W. G. Sampling Techniques, 3rd ed. Wiley, 1977
Learn the method
Read how the method works and where its numbers come from.
Agent skills
Do this with your AI assistant
Free agent skills for Claude Code, Codex, Cursor and Gemini CLI that do this job in your SurveyNinja account.
All agent skills
Turn the numbers into a survey
Start from the “Market research survey” template: the questions are ready.
WooCommerce Post-Purchase Survey: 7 Questions, When to Ask and What to Do Next