Sample Size Calculator

Work out the sample size for a survey from the confidence level, margin of error and population size, or find the margin of error for a sample you have.

Sample size calculator
Find
Sample size needed

    Working

    For estimating a proportion with simple random sampling: n₀ = z² × p(1 − p) ÷ e², with the finite population correction n = n₀ ÷ (1 + (n₀ − 1) ÷ N). Use 50% for the proportion if you don't know it; this gives the largest, safest sample size.

    On this page

    A sample size calculator works out how many people you need to survey to estimate a percentage with a chosen margin of error and confidence level, or finds the margin of error for a sample you already have. It uses the standard formula for a proportion, applies the finite population correction when you enter a population size, and shows how many invitations to send at typical response rates.

    For example, to estimate a percentage within ±5% at 95% confidence in a large population, you need 385 responses. From a population of 1,000, you need 278. With 400 responses, the margin of error is about ±4.9%.

    How to use the sample size calculator

    1. Choose Sample size to plan a survey, or Margin of error to check the precision of results you already have.
    2. Pick a confidence level. 95% is the most common choice.
    3. Enter the margin of error you can accept, such as 5%, or the number of responses you have.
    4. Enter the expected proportion. If you have no idea, leave it at 50%, which gives the safest, largest sample.
    5. Optionally, enter the population size if the group you’re studying is small, such as the employees of one company.
    6. Press Calculate to see the answer and the working.

    The sample size formula

    For a large population, the sample size needed to estimate a proportion is:

    n₀ = z² × p(1 − p) ÷ e²

    Here z is the z-score for your confidence level, p is the expected proportion as a decimal and e is the margin of error as a decimal. With 95% confidence (z = 1.96), p = 0.5 and e = 0.05: n₀ = 1.96² × 0.5 × 0.5 ÷ 0.05² = 3.8416 × 0.25 ÷ 0.0025 = 384.16, which rounds up to 385. Sample sizes are always rounded up, because rounding down would give slightly less precision than you asked for.

    Finite population correction

    When the population is small, you need fewer responses, because each one covers a bigger share of the group. The corrected sample size is:

    n = n₀ ÷ (1 + (n₀ − 1) ÷ N)

    where N is the population size. For a population of 1,000, the 384.16 above becomes 384.16 ÷ (1 + 383.16 ÷ 1,000) ≈ 277.7, so you need 278 responses. For a population of 100, you’d need 80. When the population is in the tens of thousands or more, the correction makes little difference, which is why national polls of millions of people use roughly the same sample sizes as polls of a single large city.

    Sample sizes for common settings

    Margin of error90% confidence95% confidence99% confidence
    ±10%6897166
    ±5%271385664
    ±3%7521,0681,844
    ±2%1,6912,4014,147
    ±1%6,7649,60416,588

    These figures assume a large population and an expected proportion of 50%. Notice that halving the margin of error roughly quadruples the sample size, because e is squared in the formula. Precision gets expensive quickly.

    Confidence levels and z-scores

    Confidence levelz-score
    80%1.2816
    90%1.6449
    95%1.9600
    98%2.3263
    99%2.5758
    99.9%3.2905

    A 95% confidence level means that if you repeated the survey many times with new random samples, about 95% of the resulting intervals would contain the true population value.

    What the margin of error means

    The margin of error tells you how far your sample result might be from the true value for the whole population. If 52% of a sample of 400 support a proposal, with a margin of error of ±4.9% at 95% confidence, the true level of support is likely to be between about 47.1% and 56.9%. Because that range includes values below 50%, you can’t confidently say a majority supports it.

    To find the margin of error for an existing sample, the calculator uses e = z × √(p(1 − p) ÷ n), multiplied by the finite population correction √((N − n) ÷ (N − 1)) when you enter a population size.

    Why use 50% for the proportion?

    The term p(1 − p) is largest when p = 0.5, giving 0.25. Any other value gives a smaller product and therefore a smaller sample size. If you expect a result near 20%, for example, p(1 − p) = 0.16, and at 90% confidence with a 5% margin you need only 174 responses. But if your guess is wrong, your margin of error will be bigger than planned. Using 50% when you’re unsure guarantees the margin of error you asked for, whatever the result turns out to be.

    Allowing for response rates

    The calculated sample size is the number of completed responses you need, not the number of people to contact. If you expect only 30% of people to reply, divide by 0.3: for 385 responses, invite about 1,284 people. The calculator lists invitation numbers for several typical response rates. Online surveys often get 10% to 30%, while surveys of engaged groups, such as employees or members, can reach 50% or more.

    Worked example: an employee survey

    A company with 1,000 employees wants to measure job satisfaction within ±5% at 95% confidence. Without the population correction, the formula gives 385. Entering the population of 1,000 reduces this to 278 completed surveys. The HR team expects about 40% of staff to respond, so they should invite 278 ÷ 0.4 ≈ 695 people, or simply invite everyone and check that at least 278 reply. If only 200 reply, the margin of error widens to about ±6.2%, which they can confirm with the margin of error option. That’s still useful for spotting broad trends, but small differences between departments would be hard to trust.

    Worked example: a customer poll

    An online shop with hundreds of thousands of customers wants a tighter ±3% margin at 95% confidence. The population is large enough that the correction doesn’t matter, so the target is 1,068 responses. Past email surveys got a 15% response rate, so the shop needs to email about 1,068 ÷ 0.15 ≈ 7,120 customers, ideally chosen at random from the full customer list.

    Limits of the calculation

    • It assumes simple random sampling, where every member of the population has an equal chance of being chosen. Convenience samples, such as social media polls, don’t meet this assumption, and no sample size can fix the bias.
    • It covers sampling error only. Poorly worded questions, people who don’t respond and people who answer dishonestly all add errors that the margin of error doesn’t include.
    • If you plan to analyse subgroups, such as men and women separately, each subgroup needs to be large enough on its own.
    • For comparing two groups or measuring averages rather than percentages, different formulas are used.

    Common mistakes

    • Thinking the sample must be a fixed percentage of the population, such as 10%. For large populations, the absolute number matters, not the percentage.
    • Entering the margin of error as a decimal, such as 0.05, instead of a percentage, such as 5.
    • Forgetting to allow for non-response when planning how many people to contact.
    • Rounding the sample size down.

    Related calculations

    Two other tools work well alongside this one: the confidence interval calculator, to find the confidence interval for a mean or proportion, and the standard deviation calculator, to find the standard deviation and variance of a data set.

    Frequently asked questions

    For a ±5% margin of error in a large population, 385 responses. For ±3%, 1,068, and for ±10%, 97.

    It's the result of the standard formula with 95% confidence, a 5% margin of error and a 50% expected proportion, the most common survey settings.

    Only up to a point. Once the population is more than about 20,000, the required sample barely changes. Small populations need fewer responses thanks to the finite population correction.

    Use 50% if you don't have a good estimate. It gives the largest sample size, so your margin of error will be no worse than planned.

    Collect more responses. Because the sample size depends on the square of the margin of error, cutting the margin in half needs about four times as many responses.

    The margin of error is the width of the range around your result. The confidence level is how sure you can be that the true value falls within that range.

    Divide the required sample by your expected response rate. For 385 responses at a 20% response rate, invite about 1,925 people.

    For a large population, 100 responses give a margin of error of about ±9.8% at 95% confidence, which is fine for rough estimates but too wide for close decisions.

    No. This calculator is for percentages and proportions. Estimating an average needs the expected standard deviation and a different formula.

    95% is the standard for most surveys and research. Use 90% for quick internal checks, or 99% when a wrong conclusion would be costly.

    Rounding down would give slightly less precision than you asked for, so sample sizes are always rounded up to the next whole person.

    No. It only covers random sampling error. Bias from poor sampling, question wording or non-response is not included.