Sample Size Calculator

Find how many survey responses you need for a chosen confidence level and margin of error, or the error for a given sample.

Calculate
%

How far the survey result may differ from the true value, in percentage points.

%

Use 50% if unsure: it gives the largest, safest sample size.

Leave blank for a very large or unknown population.

Number entry: use a point for decimals (1.5). Commas grouped in threes are thousands separators (1,250), and a single comma such as 1,5 is read as a decimal comma. Nothing you enter leaves your device.

Showing the example values. Change the inputs and press Calculate for your own result.

Sample size needed

385

95% confidence, ±5% margin of error

z-score used
1.95996
Size for a very large population
385

Working

  1. n₀ = z² × p(1 − p) ÷ e².
  2. The result is rounded up to the next whole person.

Assumes a simple random sample. Expect some people not to respond: divide by your expected response rate to see how many to invite.

About the sample size calculator

The sample size calculator tells you how many people you need to survey to measure a proportion with a chosen confidence level and margin of error, optionally adjusting for a finite population. It can also run the other way: given a sample size, it shows the margin of error you can expect.

It helps you decide whether a planned survey is big enough to be meaningful before you collect any data.

Who should use the sample size calculator

  • Researchers, marketers and students planning surveys.
  • Teams deciding how many responses are enough.
  • Anyone reading poll results who wants to understand the margin of error.

How to use the sample size calculator: what each input means

Confidence level
How sure you want to be that the true value lies within the margin: commonly 95%.
Margin of error
How far, in percentage points, your result may differ from the truth.
Expected proportion
Your best guess of the percentage who will answer a certain way. Use 50% if unsure, because it gives the largest, safest sample size.
Population size
Optional. Leave blank for a very large or unknown population.

How the sample size calculator works: method and formula

The required sample size for a large population is n₀ = z² × p(1 − p) ÷ e², where z is the critical value for the confidence level, p the expected proportion and e the margin of error. For a finite population N, this is adjusted: n = n₀ ÷ (1 + (n₀ − 1) ÷ N), then rounded up to a whole person.

Large population
n₀ = z² × p(1 − p) ÷ e²
Finite population
n = n₀ ÷ (1 + (n₀ − 1) ÷ N)
Margin of error
e = z × √(p(1 − p) ÷ n)

How to read your sample size calculator result

The result is the number of completed responses you need, not invitations. Divide by your expected response rate to find how many people to contact. Halving the margin of error needs about four times as many responses.

Sample Size Calculator worked example

95% confidence, ±5% margin of error, expected proportion 50%.

  1. z for 95% confidence is 1.9600.
  2. n₀ = 1.9600² × 0.5 × 0.5 ÷ 0.05² = 384.15, rounded up to 385.
  3. If the population is only 1,000 people, the adjusted size is 278.
  4. Checking the other way: a sample of 385 gives a margin of error of ±4.99%.

385 responses are needed for a large population, or 278 for a population of 1,000.

Practical uses of the sample size calculator

  • Planning customer or employee surveys.
  • Judging how reliable a poll result is.
  • Justifying a sample size in a proposal.

Assumptions and limitations of this calculator

  • Assumes a simple random sample and independent responses. Clustering, weighting or low response rates need further adjustment.
  • For proportions only. Estimating a mean requires an estimate of the standard deviation and a different formula.
  • Confidence level and margin describe sampling error only, not bias from poor questions or non-response.
FAQs

Sample Size Calculator FAQs

It maximises p(1 − p), so it produces the largest required sample. It is the safe choice when you do not know the answer in advance.

Need Something Built Around Your Numbers?

Code & Motions designs and builds custom calculators, dashboards and web tools for businesses. Tell us what you have in mind.