Calculate required sample size for surveys and experiments at any confidence level and margin of error.
Reviewed by the CalculatorKosh Editorial TeamUpdated June 2026Free ยท No sign-up
Sample Size Calculator
Calculate required sample size for surveys and experiments at any confidence level and margin of error.
How It Works
This sample size calculator tells you how many people you need to survey to estimate a percentage with a given level of confidence and precision. Sample size is the number of observations a study needs to be statistically reliable: too few and your estimate is shaky and easily wrong; too many and you waste time, money and goodwill. Getting the number right before you start is one of the most important decisions in any survey or research design.
It is built for anyone running a survey or poll โ a market researcher sizing a customer study, a student planning a dissertation questionnaire, a product manager validating a feature, an NGO conducting a field survey, or a quality team setting an inspection sample. You supply three things: how confident you want to be (the confidence level), how close to the truth you need to be (the margin of error), and a rough idea of the result you expect (the proportion p). The tool returns the minimum number of completed responses required.
The three inputs
Confidence level is how sure you want to be that the true value falls inside your margin โ 95% is the usual default, meaning that if you repeated the survey many times, about 95 in 100 of the resulting ranges would contain the real figure. Margin of error (e) is the precision: a ยฑ5% margin means your sample estimate should be within 5 percentage points of the true population value. Proportion p is your prior guess at the answer (for example, "about 30% will say yes"); when you have no idea, use 50%.
The formula
n = zยฒ ร p(1 โ p) / eยฒ
Here z is the critical value (z-score) for your confidence level, p is the expected proportion as a decimal, and e is the margin of error as a decimal. Common z-values are 1.645 for 90%, 1.96 for 95%, and 2.576 for 99% confidence. The term p(1 โ p) is the variance of a proportion, and because sample size grows with zยฒ, raising the confidence level increases the count steeply.
Worked example
Suppose you want 95% confidence, a ยฑ5% margin of error, and you have no prior estimate, so you use p = 0.5. Then z = 1.96, e = 0.05, and: n = 1.96ยฒ ร 0.5 ร (1 โ 0.5) / 0.05ยฒ = 3.8416 ร 0.25 / 0.0025 = 0.9604 / 0.0025 โ 385. You would aim for 385 completed responses. Tighten the margin to ยฑ3% and the requirement jumps to about 1,068 โ precision is expensive. This is also why a national opinion poll covering all of India can quote a ยฑ3% margin from roughly a thousand respondents: the formula does not depend on how large the population is, only on how precise you want to be.
Finite-population correction
The formula above assumes an effectively infinite population. When you are sampling from a small, known group โ say the 600 employees of one company โ you can survey fewer people and still hit your target precision. Apply the finite-population correction:
n_adjusted = n / (1 + (n โ 1) / N)
where N is the total population. For the example above (n = 385) drawn from N = 600 people, n_adjusted = 385 / (1 + 384/600) โ 235. The correction matters most when your initial n is a large fraction of N; for populations above roughly 10,000 it barely changes the answer, which is why the main calculator uses the simpler infinite-population formula.
Tips and common mistakes
Use p = 50% whenever you are unsure: it maximises p(1 โ p) and therefore gives the largest, safest sample, valid no matter what the true proportion turns out to be. The most common mistake is treating the calculated n as the number of people to invite โ it is the number of completed responses you need, so inflate your invitations to allow for non-response (if you expect a 40% response rate, send out roughly n รท 0.40 invitations). Another is confusing margin of error with confidence level, or mixing up percentages and decimals (5% is 0.05, not 5). Finally, this formula estimates a proportion; if your outcome is a continuous measurement like average income or height, you need the means formula, n = (z ร ฯ / e)ยฒ, which requires an estimate of the standard deviation ฯ instead of p.
Frequently Asked Questions
Calculating the required sample size upfront ensures your study has enough statistical power to detect meaningful effects. An underpowered study may fail to find real differences; an overpowered study wastes money and time. Sample size calculation is a key part of research design.
Part of Statistics & Probability Calculators โ compare every related calculator in one place.