Sample size calculator
This sample size calculator tells you how many respondents a survey needs, based on confidence level, margin of error and expected proportion. At 95% confidence, a ±5 percentage point margin and a 50% proportion the answer is 385; a table also shows other margins.
Example: What do you want to calculate: Sample size for a proportion (yes/no questions) · Confidence level: 95% (common) · Desired margin of error (±) 5 % · Expected proportion 50 % · Population size (0 = very large or unknown) 0 → Required sample size: 385 respondents. Source: Wikipedia – Sample size determination (Cochran’s formula for proportions and means). Updated: .
How it is calculated
How to calculate sample size
For a proportion (for example “how many are satisfied?”) Cochran’s formula applies: n₀ = z² · p · (1 − p) ÷ e². Here z is the normal-distribution value for the confidence level (1.96 at 95%), p is the expected proportion and e is the margin of error. With p = 50% and e = 5% you get 1.96² · 0.25 ÷ 0.05² = 384.16, rounded up to 385.
Small populations
If the population N is limited, the requirement shrinks: n = n₀ ÷ (1 + (n₀ − 1) ÷ N). With N = 10,000 you need 370 instead of 385 respondents, and with N = 500 only 218.
Means
For a mean, such as average height, p · (1 − p) is replaced by the variance: n₀ = (z · σ ÷ e)². The standard deviation σ has to be estimated from a pilot study or experience.
Margin of error from a sample
The other way round, the calculator shows how precise 400 answers are: e = z · √(p · (1 − p) ÷ n) ≈ ±4.9 percentage points at 95% confidence.
Honest limits
The formulas assume a simple random sample without non-response. Plan with response rates: if you need 385 answers at a 30% response rate, about 1,284 people must be invited. For hypothesis tests, group comparisons or A/B tests you need a power analysis, for example with G*Power – this calculator gives survey sizes.
Frequently asked questions
How do I calculate sample size?
Use n₀ = z² · p · (1 − p) ÷ e². At 95% confidence (z = 1.96), p = 50% and e = 5% that is 385 people.
What sample size do I need for a survey?
It depends on the margin of error you accept: ±5 points needs about 385 answers, ±3 points about 1,068 and ±10 points about 97.
Why is p = 50% so often assumed?
At 50% the product p · (1 − p) is largest, so the sample is largest. That keeps you on the safe side when you do not know the proportion.
How does population size matter?
For small populations the required sample falls. Above roughly 20,000 people the size hardly matters any more.
What does the confidence level mean?
It says how often the method would capture the true value within the margin of error if repeated – at 95%, in 95 of 100 samples.
Sources and legal basis
- Wikipedia – Sample size determination (Cochran’s formula for proportions and means)
- NIST/SEMATECH e-Handbook of Statistical Methods – Sample sizes required for confidence intervals
- Wikipedia – Normal distribution (quantiles 1.645 / 1.960 / 2.576)
As of: · Editorial policy
Related tools
- Standard deviation calculatorStandard deviation calculator for a list or frequency table: switch between sample (s) and population (σ), see every step in a table, plus a box plot.
- Average CalculatorAverage calculator: mean, median, mode and weighted average of your numbers with working and frequency table – plus the value needed for a target average.
- Percentage CalculatorFree percentage calculator: find X% of a number, what percent one number is of another, percentage change, increase and discount – with formula and steps.
- Combination CalculatorCombination calculator for nCr and nPr, with or without repetition: exact results even for huge numbers, the formula, working and all four cases side by side.
- A/B test calculatorA/B test calculator: compare conversion rates of two variants and get the uplift, p-value, confidence interval and the sample size your test really needs.
- Poll maker: create a poll without sign-upPoll maker with no account: enter a question and answers, invite by link, collect answer codes, see the result as bars. All local, no server involved.
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- Effect Size CalculatorEffect size calculator: Cohen’s d and Hedges g from means, standard deviations and group sizes, with confidence interval, overlap and a plain-language rating.
- Degrees of Freedom CalculatorDegrees of freedom calculator for t-tests (one and two samples, Welch), the chi-square test and ANOVA, with formulas, steps and worked examples.