Sample Size Calculator

Before running a survey or experiment you need enough responses for reliable results. Enter your confidence level and margin of error to find the sample size, with an optional correction for small populations.

How it is calculated

Choose the confidence level.

Enter the margin of error and expected proportion.

Add the population size if it is small.

Formula

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

Finite population: n = n₀ ÷ (1 + (n₀ − 1) ÷ N)

What is the Sample Size Calculator?

Before running a survey, you need to know how many people to ask. Too few, and the results carry a wide margin of error. Too many, and you waste time and money. This calculator works out the minimum number of completed responses needed to estimate a proportion, such as the share of households using an app, within a chosen margin of error at a chosen confidence level. It also applies a finite population correction when the whole group is small.

Market researchers, NGOs planning baseline surveys, public health teams, MBA and social science students writing dissertations, and startups testing an idea all face this question. The formula used here, often called Cochran's formula, is the one taught in most research methodology courses.

How to calculate it by hand

1. Choose the confidence level and find its z value: about 1.645 for 90%, 1.96 for 95% and 2.576 for 99%.

2. Choose the margin of error e as a proportion, for example 0.05 for ±5 percentage points.

3. Estimate the expected proportion p. If you have no idea, use 0.5, which gives the largest sample.

4. Compute the sample size for a very large population: n₀ = z² p(1 − p) ÷ e².

5. If the population N is small, correct it: n = n₀ ÷ (1 + (n₀ − 1) ÷ N).

6. Round up to the next whole number, then inflate for expected non-response by dividing by the response rate.

Turning the margin of error formula around

For a sample proportion, the standard error is √(p(1 − p) ÷ n). The margin of error at a given confidence level is z times that. Setting e = z √(p(1 − p) ÷ n) and solving for n gives n₀ = z² p(1 − p) ÷ e². Because e is squared in the denominator, halving the margin of error needs four times the sample. That is why national surveys with ±1 point precision need thousands of responses while a class project with ±10 points needs under a hundred.

Why 50% is the safe default

The product p(1 − p) is largest when p = 0.5, where it equals 0.25. At p = 0.3 it is 0.21, and at p = 0.1 only 0.09. So if you assume 50% and the true share turns out to be different, your sample will be more than big enough. If a previous survey or pilot suggests the proportion is far from 50%, using that figure reduces the required sample. The margin here is absolute, in percentage points; ±4% around an estimate of 30% means 26% to 34%, not 30% ± 1.2.

Finite populations and real-world adjustments

The basic formula assumes the population is so large that sampling hardly depletes it. When the sample is a noticeable fraction of a small population, such as 400 out of 2,000 employees, each response carries more information, and the finite population correction lowers the requirement. For populations above a few hundred thousand, the correction makes almost no difference. The formula also assumes simple random sampling. Cluster or multi-stage designs, common in village surveys, usually need a larger sample multiplied by a design effect, and the result must be inflated for people who do not respond.

Worked example, step by step

An NGO in Odisha plans a survey of 5,000 households in one block to estimate the share using clean cooking fuel. A pilot suggests about 30%, and the team wants a margin of error of ±4 percentage points at 95% confidence.

Critical value: z for 95% = 1.96

Infinite population: n₀ = z² p(1 − p) ÷ e² = 1.96² × 0.3 × 0.7 ÷ 0.04² = 504.19

Finite population correction: n = n₀ ÷ (1 + (n₀ − 1) ÷ N) = 458.09

Round up: n = 459

Answer: Sample size needed 459 responses; Without population correction 505

Common mistakes to avoid

Reading the margin of error as relative, so that ±4% of 30% is taken to mean ±1.2 points.

Forgetting to inflate for non-response, then ending up with too few completed responses.

Applying the simple random sampling formula to a cluster sample without a design effect.

Assuming a larger population always needs a much larger sample; beyond a certain size it barely changes.

Planning for the whole survey but then reporting results for small subgroups, each of which has a much wider margin.

Where it is used

Planning market research and customer satisfaction surveys.

Designing baseline and endline surveys for NGO and government programmes.

Sizing samples for dissertations and research projects in MBA and social sciences.

Election and opinion polling with a stated margin of error.

Planning quality audits that estimate the share of defective items in a lot.

Frequently asked questions

Why use 50% as the proportion?

It maximises p(1 − p), so the sample is large enough whatever the true proportion.

What about non-response?

Divide the required sample by your expected response rate.