Sample Size Calculator
Find out how many respondents your survey, poll, or study needs to reach a chosen margin of error at a given confidence level, with an optional correction for small populations.
How to Use This Calculator
- Select a confidence level (95% is the most common choice)
- Enter the margin of error you can tolerate, in percentage points
- Enter the expected proportion, or leave 50% if you have no prior estimate
- Optionally enter the total population size to apply the finite population correction
- Read the required sample size and plan your data collection
Leave at 50 for the most conservative estimate
Total number of people in the group you are sampling from
Related Calculators
Learn More
Confidence Intervals
Understand what a confidence interval really claims, how the margin of error is built, when to use z versus t, and how sample size controls precision.
Central Limit Theorem
Learn why sample means become normally distributed, how standard error shrinks with sample size, and where the theorem powers everyday inference.
How the Sample Size Formula Works
This calculator uses Cochran's formula, the standard method for sizing a survey that estimates a proportion. It answers a practical question: how many independent observations are needed so that the sampling error stays within the margin you specified?
Cochran's Formula:
n₀ = z² × p(1 − p) / e²
Symbols:
- • n₀ = required sample size for a very large population
- • z = critical value for the confidence level (1.645, 1.96, or 2.576)
- • p = expected proportion, as a decimal
- • e = margin of error, as a decimal (5% = 0.05)
The numerator grows with the variability of the answer, p(1 − p), and with the confidence you demand. The denominator shrinks as you tighten the margin of error, which is why halving the margin roughly quadruples the required sample. After you collect your data, you can run the observed result through our margin of error calculator to confirm the precision you actually achieved, or build the full range with the confidence interval calculator.
Why the Result Is Always Rounded Up
The formula regularly produces a fractional answer such as 384.16, but you cannot interview 0.16 of a person. Rounding to the nearest whole number would sometimes round down, and a sample of 384 does not quite deliver the promised 5% margin — the guarantee fails by a sliver. The calculator therefore always rounds up (a ceiling function), because the required size is a minimum: 385 is the smallest whole number of respondents that keeps the margin of error at or below the target.
This convention matters most when the raw result lands just above a whole number. A value of 384.02 still becomes 385, never 384. Treat the output as the floor for your recruitment plan, not a suggestion to aim near.
Choosing the Expected Proportion
The term p(1 − p) reaches its maximum value of 0.25 exactly at p = 0.5, which is why 50% is the safe default: it produces the largest — most conservative — sample size, so your survey is protected no matter what the true proportion turns out to be. If a pilot study or last year's survey tells you the proportion is far from 50%, using that estimate shrinks the requirement. At 95% confidence with a 5% margin, an expected proportion of 20% needs only 246 respondents instead of 385.
Be careful with this shortcut: if your prior estimate is wrong and the true proportion is closer to 50% than you assumed, the achieved margin of error will be wider than planned. When in doubt, stay with 50%.
Finite Population Correction
Cochran's formula assumes you are drawing from an effectively unlimited pool. When you sample a noticeable share of a small group — a company of 500 employees, a school of 2,000 students — each response covers a meaningful slice of the whole, and fewer responses are needed. The finite population correction (FPC) adjusts for this:
Adjusted Sample Size:
n = n₀ / (1 + (n₀ − 1) / N)
Symbols:
- • n = adjusted sample size
- • n₀ = unadjusted size from Cochran's formula
- • N = total population size
A common rule of thumb: the correction is worth applying when the sample would exceed about 5% of the population. For truly large populations — a city, a country — the adjustment changes almost nothing, which is why national polls of vastly different countries all use similar sample sizes.
Worked Example: Planning a Customer Survey
A product team wants to estimate what share of customers would recommend their service, with a 5% margin of error at 95% confidence. They have no prior estimate, so they keep the expected proportion at 50%. The calculator works through these steps:
- Square the critical value: z² = 1.96² = 3.8416.
- Variability term: p(1 − p) = 0.5 × 0.5 = 0.25.
- Square the margin: e² = 0.05² = 0.0025.
- Apply the formula: n₀ = 3.8416 × 0.25 / 0.0025 = 0.9604 / 0.0025 = 384.16.
- Round up: the required sample size is 385 respondents.
Now suppose the customer base is small: only N = 2,000 people. Applying the finite population correction: n = 384.16 / (1 + 383.16 / 2000) = 384.16 / 1.19158 ≈ 322.3955, which rounds up to 323 respondents — a saving of 62 interviews purely because the population is limited.
For comparison, keeping everything else fixed but changing one input at a time: 90% confidence needs 271 respondents, 99% confidence needs 664, and tightening the margin to 3% pushes the requirement to 1,068.
Frequently Asked Questions
Why does the calculator return 385 when the formula gives 384.16?
Sample size is a minimum requirement, and you can only recruit whole people. Rounding 384.16 down to 384 would leave the margin of error slightly wider than the 5% you asked for, so the calculator always rounds up. 385 is the smallest whole number that satisfies the target.
Why is 50% the default expected proportion?
The product p(1-p) is largest when p equals 0.5, so assuming 50% yields the biggest required sample. That makes it the safest assumption: whatever the true proportion turns out to be, your margin of error will be at or below the level you planned for. Using a prior estimate away from 50% reduces the required size but risks under-sampling if the estimate is wrong.
Why doesn't population size matter much for large populations?
The precision of a random sample depends almost entirely on the absolute number of observations, not on the fraction of the population covered. Whether the population is 100,000 or 100 million, about 385 responses deliver a 5% margin at 95% confidence. The finite population correction only produces meaningful savings when the sample would exceed roughly 5% of the population.
Does this calculator account for response rate?
No. The result is the number of completed responses you need, not the number of invitations. If you expect a 20% response rate, divide the required sample size by 0.20 - for example, 385 completed responses would require inviting about 1,925 people.
Can I use this calculator when estimating a mean instead of a proportion?
This tool sizes studies that estimate a proportion, such as the share of people who hold an opinion. Estimating a mean uses a different formula, n = (z times sigma / E) squared, which requires the population standard deviation and a margin of error expressed in the units of the measurement rather than in percentage points.
Embed This Calculator
Add this free calculator to your course page or LMS.
Adjust the height value to fit your page.