Sample Size Calculator

Your values

Estimate
Confidence level (%)

In percentage points, for example 5 for ±5 %.

Use 50 % if unsure.

Leave blank for a large or unknown population.

Result

Required sample size

Rounded up to the next whole number.

Before rounding (n₀)
384.15
Critical value z*
1.96

Step by step

  1. Critical value for the confidence level
    z∗≈1.96z^*\approx1.96
  2. Sample size for a proportion
    n0=z∗2 p(1−p)E2=1.962×0.5×0.50.052≈384.15n_0=\frac{z^{*2}\,p(1-p)}{E^2}=\frac{1.96^2\times0.5\times0.5}{0.05^2}\approx384.15
  3. Round up to a whole number
    n=⌈384.15⌉=385n=\lceil 384.15\rceil=385

Add extra invitations to allow for people who do not respond.

About this tool

Before you run a survey or experiment, you need to know how many responses are enough. Too few and the margin of error is too wide to be useful; too many and you waste time and money.

This calculator finds the minimum sample size for estimating a proportion or a mean to a chosen margin of error at a chosen confidence level. It shows the formula with your values substituted and, for small populations, how the finite population correction lowers the number you need.

How it works

For a survey question with a yes/no or percentage answer, choose a proportion. Enter the margin of error you can accept, such as ±5 percentage points, and the proportion you expect. If you have no idea, keep 50 %, which gives the largest, safest sample.

To estimate an average, choose a mean and enter an estimate of the standard deviation (from a pilot study or earlier data) and the margin of error in the same units. If you are sampling from a small, known population, enter its size to apply the finite population correction. The result is rounded up to the next whole number.

n0=z∗2 p(1−p)E2,n=n01+n0−1Nn_0=\frac{z^{*2}\,p(1-p)}{E^2},\quad n=\frac{n_0}{1+\frac{n_0-1}{N}}

Example

For a poll with a ±5 % margin of error at 95 % confidence and an expected proportion of 50 %, n0=1.962×0.5×0.5/0.052≈384.1n_0 = 1.96^2 \times 0.5 \times 0.5 / 0.05^2 \approx 384.1, which rounds up to 385 responses. If the whole population is only 1,000 people, the correction gives n=384.1/(1+383.1/1000)≈277.7n = 384.1/(1 + 383.1/1000) \approx 277.7, so 278 responses are enough.

To estimate an average with a standard deviation of about 15 to within ±5 at 95 % confidence, n0=(1.96×15/5)2≈34.6n_0 = (1.96 \times 15/5)^2 \approx 34.6, so you need 35 observations.

Assumptions and limits

The sample size covers random sampling error only. It assumes a simple random sample; cluster or stratified designs need a design effect. It does not account for non-response, so invite more people than the result if you expect some not to answer, and it cannot fix bias from who chooses to respond.

For means, the result depends on your guess of the standard deviation: an underestimate gives too small a sample. The formulas use the normal approximation, which is less accurate for very small samples or for expected proportions close to 0 % or 100 %.

Frequently asked questions

Why use 50 % as the expected proportion?

The term p(1−p)p(1 - p) is largest when p=0.5p = 0.5, so 50 % gives the most conservative sample size. If earlier data suggest a proportion such as 20 %, entering it gives a smaller sample with the same margin of error.

Why is 385 the standard survey sample size?

It is the answer for a ±5 % margin of error at 95 % confidence with a 50 % expected proportion and a large population. Because the population hardly matters once it is large, 385 works for a city or a whole country alike.

When should I use the finite population correction?

When your sample would be a noticeable share of the whole population, roughly 5 % or more, for example surveying the employees of one company. For large populations the correction makes almost no difference.

How does the margin of error affect the sample size?

The sample size grows with the square of the precision: halving the margin of error from ±5 % to ±2.5 % roughly quadruples the sample, from 385 to 1,537.

What if I expect people not to respond?

Divide the result by the expected response rate. If you need 385 responses and expect 40 % to reply, invite about 385/0.4≈963385/0.4 \approx 963 people.

Link with your values

Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.

ParameterValueIf omitted
kindEstimateone of: proportion, meandefault proportion
confidence_level_pctConfidence levelpercent: 6.5 means 6.5%; allowed > 0 – < 100default 95
margin_pctMargin of errorpercent: 6.5 means 6.5%; allowed > 0 – < 100; used with kind = proportionrequired
proportion_pctExpected proportionpercent: 6.5 means 6.5%; allowed > 0 – < 100; used with kind = proportioncounted as 50
sdStandard deviation (σ)number; allowed > 0; used with kind = meanrequired
marginMargin of error (E)number; allowed > 0; used with kind = meanrequired
populationPopulation size (optional)whole number; allowed 1–1000000000000optional

Examples

  • ?margin_pct=3&confidence_level_pct=99
  • ?sd=12&margin=2&population=5000

Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.

Result elements: [data-result-block="sample_size_calculator"]