Sample Size Calculator
Calculate the minimum sample size needed for surveys, research studies, and polls. Supports finite and infinite populations, confidence levels, margin of error, design effect, and instant results — free and browser-based.
Inputs
50% gives the most conservative sample size. Use it if the true distribution is unknown.
Calculation Steps
Z = 1.960 (from 95% two-sided confidence)
n = (Z² × p × (1 − p)) ÷ E²
n = (1.960² × 50% × 50%) ÷ 5%²
n = 384.16 (infinite population)
n_adjusted = 384.16 ÷ (1 + ((384.16 − 1) ÷ 10000)) = 369.98
Required Sample Size = 370 (rounded up)
Required Sample Size
370
95% confidence · ±5% margin of error
Interpretation
You need approximately 370 responses to estimate the population within a ±5% margin of error at a 95% confidence level.
Result Details
Estimated Confidence Interval
With this sample size, an observed proportion of 50% would have a true population value estimated between:
Population Size Sensitivity
How the required sample size changes as population grows, at your current confidence level, margin of error, and proportion.
Export & Share
What Is a Sample Size Calculator?
A sample size calculator is a free browser-based tool that determines the minimum number of responses you need to collect for statistically reliable results. It answers the core question every researcher faces before running a survey, poll, or study: how many people do I actually need to ask?
Choosing a sample size by guesswork risks two costly mistakes — surveying too few people (producing results too imprecise to trust) or surveying far more than necessary (wasting time and budget). This calculator solves that with the standard statistical formula used by survey companies, pollsters, and researchers worldwide, factoring in your population size, confidence level, margin of error, expected response distribution, and design effect for complex sampling designs.
This tool is built for students, researchers, university faculty, healthcare professionals, survey companies, UX researchers, product managers, business analysts, marketing teams, polling organizations, data scientists, and government agencies. It runs entirely in your browser — no data is ever sent to a server, and results update instantly as you type.
How the Sample Size Calculator Works
The calculator first computes the sample size needed for an infinite population using the standard proportion formula, then applies a finite population correction if you provide a known population size. A design effect multiplier can inflate the result for cluster or multi-stage sampling designs, and a one-sided or two-sided test setting determines which Z-score is used.
Core Formulas
n = (Z² × p × (1 − p)) ÷ E²
n_adjusted = n ÷ (1 + ((n − 1) ÷ N))
- →Z-score: Derived from your chosen confidence level and test type (one-sided or two-sided) using a standard normal distribution lookup table.
- →Expected Proportion (p): Your best estimate of how responses will be split. 50% is the most conservative choice and produces the largest, safest sample size.
- →Margin of Error (E): How much sampling error you're willing to accept, expressed as a percentage.
- →Finite Population Correction: Automatically applied whenever you provide a population size instead of checking Infinite Population — it reduces the required sample for smaller populations.
- →Design Effect (DEFF): Multiplies the raw sample size to account for cluster sampling, stratification, or other complex survey designs. Leave at 1 for simple random sampling.
How to Use the Sample Size Calculator
Step-by-Step Guide
- 1Enter Your Population Size: Type your total population, or check Infinite Population if you're surveying a very large or unbounded group such as national voters.
- 2Choose a Confidence Level: Select how confident you want to be that your results reflect the true population — 95% is the industry standard.
- 3Set Your Margin of Error: Choose how much sampling error you can tolerate, from 0.1% to 20%. Lower values require larger samples.
- 4Adjust Expected Proportion: Drag the slider to your best estimate of the response split, or leave it at 50% for the safest, most conservative result.
- 5Fine-Tune Advanced Options: Optionally set a design effect for cluster sampling, switch between one-sided and two-sided tests, or toggle the confidence interval panel.
- 6Read the Live Result: The required sample size, Z-score, calculation steps, and plain-language interpretation update instantly as you adjust any input.
- 7Export or Share: Copy the result, download a CSV, TXT, or JSON report, print it, or copy a shareable URL with your inputs encoded.
Key Features
- ✓Finite population correction with an infinite population option
- ✓Confidence levels from 80% to 99.9% with one-sided and two-sided testing
- ✓Adjustable margin of error from 0.1% to 20% with a visual bar
- ✓Expected proportion slider with conservative-estimate guidance
- ✓Design effect (DEFF) support for cluster and multi-stage sampling
- ✓Full calculation steps shown for complete transparency
- ✓Estimated confidence interval panel around your expected proportion
- ✓Population size sensitivity chart showing how sample size scales with population
- ✓Six smart presets: Academic Survey, Market Research, Medical Study, Election Poll, Customer Feedback, UX Research
- ✓Side-by-side scenario comparison (Compare as A / Compare as B)
- ✓Instant calculation with a 150ms debounce as you type
- ✓Shareable calculation URL using query parameters
- ✓Export report as CSV, TXT, or JSON, plus a printable layout
- ✓Calculation history — save and reload up to 20 past results
- ✓Automatic recommendations for very large populations and high confidence levels
- ✓All processing runs locally — no data leaves your browser
Real-World Use Cases
University Survey of a Student Body
A researcher needs to survey a university with 10,000 enrolled students at a 95% confidence level and ±5% margin of error. Entering these values with a 50% expected proportion returns a required sample size of 370 — the researcher now knows exactly how many completed responses to target.
National Election Poll
A polling organization surveys likely voters nationwide, treating the electorate as an infinite population. At 95% confidence and ±3% margin of error, the calculator returns 1,068 respondents — the standard sample size used by most national polls.
Clinical Study at a Small Hospital Network
A medical researcher studying a treatment outcome in a network of 500 eligible patients needs 99% confidence with a ±5% margin of error. Using a design effect of 1.5 to account for site clustering, the calculator adjusts the sample size accordingly for the finite patient population.
SaaS Customer Satisfaction Survey
A product manager with 10,000 active customers wants directionally reliable feedback without surveying everyone. At 90% confidence and a ±7% margin of error, the calculator returns a manageable sample size suited to a quick in-app survey.
UX Research With a Small User Base
A UX researcher with only 200 beta users needing quick usability feedback sets a 90% confidence level and a wider ±10% margin of error, appropriate for early-stage qualitative-leaning research on a small population.
Market Research Across a Large Customer Base
A market research firm surveying a retailer's 100,000-person loyalty program at 95% confidence and ±4% margin of error uses the finite population correction to avoid over-sampling relative to an infinite-population assumption.
Tips & Common Mistakes
Pro Tips
- 💡Leave the expected proportion at 50% unless you have prior data — it's the most conservative assumption and guarantees your sample is large enough regardless of the true split.
- 💡Check Infinite Population whenever your population exceeds roughly 1,000,000 — the finite correction has almost no effect at that scale and the calculator will suggest it automatically.
- 💡Use the Population Size Sensitivity chart to see how much sample size you'd save (or need) if your actual population turns out smaller or larger than expected.
- 💡If your survey uses cluster sampling (e.g. sampling by school, clinic, or region rather than individuals), set the Design Effect above 1 — ignoring it commonly understates the true sample size needed.
- 💡Tighten your margin of error only as much as you truly need — going from ±5% to ±3% roughly triples the required sample size.
Common Mistakes to Avoid
- ✕Don't confuse margin of error with confidence level — margin of error controls precision, confidence level controls how sure you are the true value falls within that margin.
- ✕Don't apply finite population correction when your population is genuinely very large — it adds unnecessary complexity with negligible effect above roughly a million.
- ✕Don't set expected proportion far from 50% without real prior evidence — an incorrect guess can leave you under-sampled if the true split turns out closer to even.
- ✕Don't forget the design effect for multi-stage or clustered surveys — treating clustered data as a simple random sample understates your true required sample size.
- ✕Don't chase 99.9% confidence by default — it dramatically increases the required sample size for only a small precision gain over 95% or 99%.
Common Sample Size Reference Table
All examples use a 50% expected proportion and a two-sided test.
| Population | Confidence Level | Margin of Error | Required Sample Size |
|---|---|---|---|
| 10,000 | 95% | ±5% | 370 |
| Infinite | 95% | ±3% | 1,068 |
| 1,000 | 95% | ±5% | 278 |
| 100,000 | 95% | ±4% | 597 |
| Infinite | 99% | ±5% | 664 |
| 500 | 90% | ±5% | 176 |
Frequently Asked Questions
What is a sample size calculator?
A sample size calculator is a free browser-based tool that determines the minimum number of responses needed for statistically reliable survey or research results. It uses your population size, confidence level, margin of error, and expected proportion to compute the required sample size using the standard statistical formula.
How is sample size calculated?
The calculator first computes n = (Z² × p × (1 − p)) ÷ E² for an infinite population, where Z is the Z-score for your confidence level, p is the expected proportion, and E is the margin of error. If you provide a finite population size, a correction formula reduces this number to account for the smaller population.
What is a good sample size for a survey?
It depends on your population, confidence level, and margin of error — there's no universal number. A common benchmark is around 385 respondents for a large or infinite population at 95% confidence and a ±5% margin of error, but smaller populations or wider margins require fewer.
What is the difference between confidence level and margin of error?
Confidence level is how certain you want to be that your sample reflects the true population — for example, 95% confidence means that if you repeated the survey 100 times, about 95 of those samples would contain the true value within the margin of error. Margin of error is how wide that range of uncertainty is, expressed as a percentage.
How do I decide between finite and infinite population?
Use a finite population whenever you know the total size of the group you're studying and it's under roughly 1,000,000 — the correction meaningfully reduces the required sample. For very large or effectively unbounded populations, such as a country's general public, check Infinite Population.
What does Expected Proportion mean, and why does 50% matter?
Expected proportion is your best guess at how responses will split — for example, the percentage of people expected to answer 'yes.' The value p × (1 − p) is maximized at p = 50%, which is why 50% produces the largest, most conservative sample size when the true split is unknown.
What is the Design Effect (DEFF) and when should I use it?
Design Effect accounts for sampling designs more complex than simple random sampling, such as cluster sampling by school, clinic, or geographic region. A DEFF greater than 1 inflates the required sample size to compensate for the reduced statistical efficiency of clustered data.
What's the difference between a one-sided and two-sided test?
A two-sided (two-tailed) test accounts for the possibility of a difference in either direction and is the standard choice for most surveys. A one-sided (one-tailed) test only checks for a difference in one specific direction and requires a smaller Z-score, and therefore a smaller sample size, for the same confidence level.
Why does a smaller margin of error require a much larger sample?
Margin of error appears squared in the denominator of the sample size formula, so cutting it in half roughly quadruples the required sample size. Going from a ±10% to a ±5% margin of error, for instance, increases the required sample size by about four times.
Is my data private when using this calculator?
Yes. All calculations run entirely in your browser using JavaScript. Your inputs are never transmitted to any server, stored in any database, or accessible to anyone other than you. The calculation history feature saves results only to your browser's local storage, which you can clear at any time.
Who Uses This Calculator?
Students & Researchers
Determine the correct sample size before running a thesis survey, experiment, or academic study.
Healthcare Professionals
Plan clinical studies and patient surveys with statistically defensible sample sizes.
Survey Companies & Pollsters
Set target response counts for polls, market research, and public opinion surveys.
UX Researchers & PMs
Size usability studies and in-product surveys appropriately for a limited user base.
Business & Data Analysts
Validate that internal survey and testing sample sizes are large enough to trust the results.
Government Agencies
Plan census-adjacent surveys and public policy research with reliable statistical precision.
Related Tools
Confidence Interval Calculator
Calculate confidence intervals for a mean or proportion, margin of error, and required sample size — with Z and t critical values and formula breakdown.
A/B Test Calculator
Analyze A/B test results with a two-proportion z-test — conversion rates, lift, Z-scores, p-values, and statistical significance.
P-Value Calculator
Calculate p-values and statistical significance for Z-tests, T-tests, Chi-Square tests, F-tests, and correlation tests instantly.
Standard Deviation Calculator
Calculate sample and population standard deviation with variance, quartiles, mode, and histogram/box plot visualization.
Mean Calculator
Compute average value.
Z-Score Calculator
Calculate standard score.