Skip to content
CornerTools

Sample Size Calculator

How many responses a survey or study needs for a margin of error and confidence level, or the margin of error a sample gives.

Confidence level

50% if unsure: it needs the most responses.

Blank if very large or unknown.

Below 100%, the invitations to send are shown.

Responses needed for ±5% at 95% confidence

385

At other margins of error

At ±1%
9,604
At ±2%
2,401
At ±3%
1,068
At ±10%
97

Assumes a simple random sample.

Find how many responses a survey or study needs to measure a percentage to within a margin of error, at a confidence level, by Cochran's formula. Give the population size for a small group, such as a company's staff, and the response rate to see how many people to invite. The tool also works the other way, giving the margin of error a number of responses allows, and finds the sample for estimating an average.

How to use it

Sample size is for a percentage, such as the share of customers who would recommend you. It opens on 95% confidence, a margin of ±5% and an expected proportion of 50%, and lists the sample at margins of ±1%, ±2%, ±3%, ±5%, ±10% too. 90%, 95%, 99% confidence are a click away, and Other takes any level between 0% and 100%.

Sample size for a mean is for an average, such as the mean time spent on a task: it takes the margin in the data's own units and an estimate of the standard deviation. Margin of error takes the number of responses and gives the margin they allow, to the decimal places chosen, with the margin at 100, 500, 1,000, 2,000, 5,000 responses beside it.

Leave the population blank when it is very large or unknown. Below a response rate of 100%, the invitations to send are shown beside the responses needed. Every figure is rounded up, since part of a respondent is a whole one. Everything runs in your browser.

Cochran's formulas

The formulas are those of William G. Cochran's Sampling Techniques (3rd edition, 1977): the sample for a proportion in §4.4, for a mean in §2.15, and the finite population correction. z is the point of the normal curve with the confidence level between −z and z, computed exactly rather than taken from a rounded table, so 95% uses 1.959963985, not 1.96. p and the margin E are fractions (50% is 0.5).

The correction for a population of N uses n₀ − 1, as Cochran does. Some calculators use n₀ ÷ (1 + n₀ ÷ N) instead, which gives less than one respondent fewer, so the rounded answers differ by at most one. The corrected sample never exceeds the population.

The formulas assume a simple random sample: everyone in the population equally likely to be asked, and those who answer no different from those who do not. Clustered or stratified designs, and the bias of a low response rate, are outside them.

Proportion: n₀ = z² × p × (1 − p) ÷ E²
Mean: n₀ = (z × σ ÷ E)²
Finite population: n = n₀ ÷ (1 + (n₀ − 1) ÷ N)
Invitations = n ÷ response rate
Margin of error: E = z × √(p × (1 − p) ÷ n) × √((N − n) ÷ (N − 1))

Examples

A staff survey of 2,000 employees

At the default 95% confidence and ±5%, a company of 2,000 needs 323 responses, rather than the 385 a very large population would. If 40% of staff usually answer, invite 808.

  1. z for 95% confidence: the z with 95% of the normal curve between −z and z. z = −Φ⁻¹(0.025) ≈ 1.959963985
  2. Cochran's formula, with the proportion p and the margin E as fractions: n₀ = z² × p × (1 − p) ÷ E² = 1.959963985² × 0.5 × 0.5 ÷ 0.05² ≈ 384.1458821
  3. Correct for a population of 2,000 (Cochran): n = n₀ ÷ (1 + (n₀ − 1) ÷ N) = 384.1458821 ÷ (1 + 383.1458821 ÷ 2,000) ≈ 322.3855367
  4. Round up: part of a respondent is a whole one. n = 323
  5. At a 40% response rate, invite enough people for 323 to answer, rounding up: 323 ÷ 0.4 = 807.5, so 808

A national poll at ±3%

With the population left blank, ±3% at 95% confidence needs 1,068 responses, whatever the size of the country. This is why national polls of about a thousand people are common.

The margin of error of 1,000 responses

1,000 responses to a yes-or-no question give a margin of error of ≈ ±3.1% at 95% confidence, taking the proportion as 50%.

Frequently asked questions

It is the sample for the most common settings: 95% confidence, ±5%, a proportion of 50% and a very large population. n₀ comes to 384.1458821, and rounding up gives 385. A 50% proportion is the safe choice, since p × (1 − p) is largest there, so any other true proportion is measured at least as precisely.
The margin of error depends on how many responses there are, not on what share of the population they are. At 95% and ±5%, the sample for populations of 1,000, 10,000, 100,000, 1,000,000 is 278, 370, 383, 384. Only when the sample would be a large share of the population does the correction matter.
For a mean, use one from a pilot survey or an earlier study, or a quarter of the range of values you expect, a rough rule for data that is near normal. The Standard Deviation Calculator gives it from pilot data.

See also