Sample Size Calculator
Free sample size calculator (Cochran's formula). Enter your margin of error, expected proportion, and confidence level to see how many respondents you need.
Sample Size Calculator
Background.
The Quanta sample size calculator answers the question every survey designer has to solve before collecting a single response: how many people do I actually need to ask? Enter your desired margin of error (how precise you need the result to be), your best guess at the true proportion, and a confidence level, and the calculator returns the minimum number of respondents required. Enter the textbook defaults — a margin of error of 0.05 (±5 percentage points), an unknown proportion (p̂ = 0.5), and 95% confidence — and the calculator returns 385, the single most frequently cited sample-size figure in applied survey methodology.
This calculator is the exact mirror image of Quanta's margin-of-error calculator. Margin-of-error starts from a sample size you already have (perhaps because a survey has already been run, or because of a fixed budget) and tells you how much sampling error to expect. Sample-size starts from the sampling error you are willing to tolerate and tells you how large a sample is required to achieve it. The two calculators share the identical underlying formula, algebraically rearranged: e = z·√(p̂(1−p̂)/n) solved for n gives n0 = z²p̂(1−p̂)/e², the formula this calculator implements, drawn from William Cochran's 1977 textbook Sampling Techniques, still the standard graduate reference in survey statistics.
Three practical facts fall out of the formula and are worth internalizing before designing any survey. First, sample size requirements grow with the square of the precision you demand — halving your target margin of error (say from ±5% to ±2.5%) quadruples the required sample size, which is exactly why tightly-precise national polls (margin of error under 2%) require many thousands of respondents while a rougher ±5% estimate needs only a few hundred. Second, the required sample size is largest when the expected proportion p̂ is 0.5 and shrinks as p̂ moves toward 0 or 1 — which is why survey researchers conventionally use p̂ = 0.5 as the safe default whenever the true split is not known in advance: any other true value of p̂ would require a smaller sample than the 0.5 case calls for, so planning around 0.5 never leaves you under-sampled. Third, moving from 90% to 95% to 99% confidence increases the required sample size, because a higher confidence level demands a larger z critical value, and z appears squared in the formula — going from 95% to 99% confidence (z = 1.96 to z = 2.576) increases the required sample size by a factor of roughly 1.73, even though the margin of error and expected proportion stay fixed.
When the population you are sampling from is itself small and fully known — a single company's employees, a school's student body, members of a specific club — Cochran's finite population correction can substantially reduce the sample size otherwise required, because a fixed absolute number of respondents represents a larger, more informative share of a small population than of a large one. This calculator applies that correction automatically whenever a population size is entered, and always reports the uncorrected (infinite-population) figure alongside it so you can see exactly how much the correction saved. Leave the population size at 0 for any survey of a large, open, or effectively unlimited population — national polling, customer satisfaction surveys of an online product, market research across a whole country — where the correction would have a negligible effect anyway.
What is sample size calculator?
The required sample size for estimating a population proportion within a target margin of error e, at a given confidence level, is n0 = z²·p̂(1−p̂)/e², where z is the critical value of the standard normal distribution for the chosen confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%), and p̂ is the best available estimate of the true proportion, entered as a decimal between 0 and 1 (use 0.5 when unknown, since it maximizes the required sample size and is therefore the conservative choice). This is the algebraic inverse of the margin-of-error formula e = z·√(p̂(1−p̂)/n): solving for n instead of e gives exactly this expression (Cochran, 1977, Sampling Techniques, 3rd ed., Ch. 4). Because a fractional number of respondents is meaningless, the raw n0 is always rounded up (ceiling) to the next whole number. When the population being sampled is itself small and fully enumerated (size N), Cochran's finite population correction adjusts the requirement downward: n = n0 / (1 + (n0 − 1)/N) (Cochran, 1977, Ch. 9). As N grows very large relative to n0, this adjusted value converges back to the unadjusted n0, which is why the correction is conventionally skipped for large or open populations (national surveys, customer bases, and similar) and applied only when sampling a comparatively small, closed group.
How to use this calculator.
- Enter your desired margin of error as a decimal — 0.05 for ±5 percentage points, 0.03 for ±3, and so on. Smaller values demand larger samples.
- Enter your expected proportion p̂. If you have prior data (a previous survey, a pilot study) use that estimate; otherwise leave it at 0.5, the conservative default that always requires a sample at least as large as any other true value of p̂ would.
- Choose your confidence level: 90%, 95% (the most common default in published research and journalism), or 99% for a stricter standard.
- Leave population size at 0 for a large, open, or unknown population (the standard case for national or broad-market surveys). Enter the true population size only when sampling a small, fully-known group, such as a single organization's staff or members — this will reduce the required sample size.
- Read the primary result, the required sample size, already rounded up to a whole number of respondents.
- Compare it against the unadjusted (infinite-population) figure to see exactly how much the finite population correction reduced the requirement, if you entered a population size.
- If you are instead starting from a sample size you already have (perhaps from a completed survey or a fixed budget) and want to know the resulting margin of error, use Quanta's margin-of-error calculator — the inverse of this one.
The formula.
The sample size formula is the algebraic rearrangement of the margin-of-error formula, solved for n instead of e. Starting from e = z·√(p̂(1−p̂)/n), squaring both sides gives e² = z²·p̂(1−p̂)/n, and solving for n gives n0 = z²·p̂(1−p̂)/e² (Cochran, 1977, Ch. 4; matching Israel's University of Florida IFAS Extension PEOD-6 notation exactly, where the same expression appears as n0 = Z²pq/e² with q = 1−p). Because n0 will almost never come out to a whole number, it is always rounded up (the ceiling function) — a survey cannot collect a fractional respondent, and rounding up (rather than to the nearest whole number) guarantees the target precision is actually met rather than falling just short of it.
Three structural properties of the formula matter in practice. Because e is squared in the denominator, required sample size scales with 1/e² — halving your target margin of error quadruples the required sample, and this fourfold relationship is exactly the mirror image of the square-root relationship in the margin-of-error formula. Because p̂(1−p̂) is maximized at p̂ = 0.5, the required sample size is also maximized there, which is why 0.5 is the standard conservative planning assumption whenever the true proportion is unknown in advance — any actual value of p̂ other than exactly 0.5 would need fewer respondents than planning for 0.5 provides. And because z is squared, moving to a higher confidence level increases the required sample size faster than the confidence percentage itself suggests: going from 90% (z=1.645) to 99% (z=2.576) multiplies the required sample size by (2.576/1.645)² ≈ 2.45, more than doubling it, even though the jump from 90% to 99% confidence sounds modest.
When the total population being sampled is itself finite and comparatively small, Cochran's finite population correction adjusts the estimate downward: n = n0 / (1 + (n0 − 1)/N). As N becomes large relative to n0, the fraction (n0−1)/N shrinks toward zero, the denominator approaches 1, and n approaches n0 — the correction has essentially no effect, which is why it is conventionally skipped for large-scale surveys. As N shrinks toward the size of n0 itself, the adjusted sample size shrinks well below n0 and approaches N, correctly capturing the fact that once your sample represents a large share of a small population, you need only slightly fewer than everyone to achieve your target precision. The correction is well-defined even at N = 1 — the (n0−1)/N term simply becomes n0−1 exactly, making the denominator equal to n0 and the adjusted sample size exactly 1 — so no special-case handling is needed at the smallest possible population.
A worked example.
A graduate student is designing a survey of general public opinion and wants results accurate to within ±5 percentage points at the standard 95% confidence level, with no prior data on how the true opinion split might land (so p̂ = 0.5, the conservative assumption). Using z = 1.96 for 95% confidence, the required sample size is n0 = 1.96² × 0.5 × (1 − 0.5) / 0.05² = 3.8416 × 0.25 / 0.0025 = 0.9604 / 0.0025 = 384.16. Because a fractional respondent is not possible, this is rounded up to 385 — the exact figure that appears, almost as a rite of passage, in countless research methods textbooks and survey-design guides as the standard sample size for ±5%, 95% confidence work. Since the population being surveyed (the general public) is vastly larger than 385, the population size is left at 0 and no finite population correction is applied; if the student were instead surveying a single university's 2,000 enrolled students rather than the general public, entering 2,000 as the population size would reduce the requirement to a noticeably smaller number, since 385 respondents already represents a meaningful fraction of a population that size.
Frequently asked questions.
Why does this calculator always assume p̂ = 0.5 by default?
Why does cutting my margin of error in half quadruple the required sample size?
How much does raising the confidence level increase the required sample size?
When should I use the finite population correction?
Is 385 always the 'right' sample size for a survey?
References& sources.
- [1]Cochran, W.G. (1977). Sampling Techniques, 3rd ed. New York: John Wiley & Sons. Ch. 4 (n0 = z²p̂(1−p̂)/e²) and Ch. 9 (finite population correction).
- [2]Israel, G.D. "Determining Sample Size." University of Florida IFAS Extension, PEOD-6 — presents the identical Cochran formulas (n0=Z²pq/e² and the finite population adjustment) with worked examples.
- [3]Krejcie, R.V. & Morgan, D.W. (1970). "Determining Sample Size for Research Activities." Educational and Psychological Measurement, 30, 607–610.
- [4]NIST/SEMATECH e-Handbook of Statistical Methods.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled