Free research tool

Cochran's formula online: sample size calculator

Calculate your questionnaire's sample size with Cochran's formula: enter the population size (or leave it blank if unknown), choose the confidence level and margin of error, and the sample size is shown along with the calculation steps. The Morgan table is further down this page.

Building your first form

Calculate the sample size for your own study

If unknown or very large, leave blank.

Confidence level

z = 1.96

e.g. 0.05 or 5%

Unknown: 0.5

Required sample size

385people

unknown or very large population · 95% confidence · margin 0.05

  1. n₀ = (1.96)² × 0.5 × 0.5 ÷ (0.05)² = 384.16
  2. ⌈384.16⌉ = 385

Ready-made text for the methods chapter

Sample size was determined with Cochran's formula for an unknown population. With a 95% confidence level, a margin of error of 0.05 and a proportion of 0.5, the required sample size is 385.

What is Cochran's formula? The z, p, q and d components

Cochran's formula gives a study's sample size from the confidence level (z), the proportion of the population with the attribute (p and q) and the margin of error (d), and when the population size (N) is known it corrects the result for a finite population. For example, a population of 1000 at 95% confidence and a 0.05 margin of error needs a sample of 278.

Formula

  • n₀ = z² × p × q ÷ d²Sample size for a large or unknown population; q is simply 1 minus p
  • n = n₀ ÷ (1 + (n₀ − 1) ÷ N)Finite population correction
  • n = N × z² × p × q ÷ (N × d² + z² × p × q)The one-line form common in Persian textbooks; it uses n₀ instead of n₀ − 1, so its result is sometimes one person lower

Cochran's formula has four components, and each must be reported in your methodology chapter:

  • z: the normal distribution value for the confidence level; 1.645 for 90%, 1.96 for 95% and 2.576 for 99%. Some textbooks call it t.
  • p and q: p is the proportion of the population that has the attribute under study and q the proportion that doesn't, i.e. 1 minus p. If you don't know it, set p to 0.5 so that q is 0.5 too; this yields the largest sample size and is the most conservative choice.
  • d: the margin of error, or estimate precision; 0.05 is the most common value. A smaller margin needs a larger sample: halving d roughly quadruples the sample size.
  • N: the population size; when known, it is used for the finite population correction.

The calculator always rounds up, because the sample size must be a whole number and rounding down means slightly less precision than you asked for.

Known and unknown populations

If the population is very large — say, every university student in the country — or you don't know its exact size, the first part of the formula is enough: leave the population box empty. With 95% confidence, p = 0.5 and d = 0.05 the result is 384.16, usually written as 384 in textbooks; because the calculator rounds up, it shows 385.

If the population is finite and known — say, a company's staff or a school's students — the finite population correction lowers the sample size. The smaller the population, the bigger the reduction; for populations in the hundreds of thousands the difference all but disappears and the number stays close to 384.

Worked examples of Cochran's formula

A common question: how large a sample does a population of 1000 need at 95% confidence and a 0.05 margin of error? Step by step:

Calculation for N = 1000

  • n₀ = 1.96² × 0.5 × 0.5 ÷ 0.05² = 384.16Sample size for an infinite population
  • n = 384.16 ÷ (1 + 383.16 ÷ 1000) = 277.74Finite population correction
  • ⌈277.74⌉ = 278rounded up

So you need at least 278 complete questionnaires. The one-line form of the formula gives 277.54 for the same population, which also rounds up to 278, and the Morgan table suggests 278. The table below shows the same calculation with other inputs:

Worked examples of Cochran's formula with different inputs
ScenarioNConfidencedpn₀Sample size
Baseline: a population of 10001,00095%0.050.5384.16278
Unknown populationUnknown95%0.050.5384.16385
Higher confidence (99%)50099%0.050.5663.58286
Smaller margin of error (0.03)2,00095%0.030.51,067.11697
p known from a pilot study1,00095%0.050.2245.86198
Quick estimate with a 0.1 margin30095%0.10.596.0473
Cutting the margin of error from 0.05 to 0.03 nearly triples n₀; knowing p from a pilot study lowers the sample size because p × q drops below 0.25; and the smaller the population, the more the finite population correction brings the number down.

The same calculation in Excel

  • =ROUNDUP((1.96^2*0.5*0.5/0.05^2)/(1+((1.96^2*0.5*0.5/0.05^2)-1)/A1),0)Population size in cell A1; gives 278 for 1000
  • =ROUNDUP(1.96^2*0.5*0.5/0.05^2,0)Unknown population: 385

Both use 95% confidence, a 0.05 margin of error and p = 0.5; for other values, change 1.96, 0.05 and 0.5. If your Excel expects “/” as the decimal separator or “;” between arguments, use those instead of “.” and “,”.

Cochran sample size table for common population sizes

If your population size is in this table, take the number directly. Every value uses p = 0.5 and is rounded up, and the “95% confidence, 0.05 margin” column is the usual thesis setting; for sizes between rows, use the calculator at the top of the page.

Sample sizes from Cochran's formula at four precision levels
Population size (N)95% confidence, 0.05 margin95% confidence, 0.03 margin95% confidence, 0.1 margin99% confidence, 0.05 margin
5045483447
10080925088
15010913259123
20013216966154
25015220370182
30016923573207
40019729278250
50021834181286
75025544186353
1,00027851788400
1,50030662491461
2,00032369792499
3,00034178894544
5,00035788095586
10,00037096596623
20,0003771,01496643
50,0003821,04596655
100,0003831,05696660
1,000,0003851,06697664
Unknown or very large3851,06897664

Morgan table

The Krejcie & Morgan (1970) table did the same calculation in advance for common population sizes, with 95% confidence (χ² = 3.841), a proportion of 0.5 and a margin of error of 0.05. The third column is Cochran's formula with the finite population correction, so you can see both methods side by side.

The Krejcie and Morgan sample size table alongside Cochran's formula
Population size (N)Morgan sample sizeCochran with finite population correction
101010
201920
302828
504445
756363
1008080
150108109
200132132
300169169
400196197
500217218
750254255
1,000278278
1,500306306
2,000322323
3,000341341
5,000357357
10,000370370
20,000377377
50,000381382
100,000383383
1,000,000384385
The occasional one-person difference is because the Morgan table uses χ² = 3.841 and rounds to the nearest whole number, while in Cochran's formula z² is 3.8416 and the result is always rounded up.

The full 90-row Krejcie and Morgan table, its formula and a calculator that gives the table value for any population size are on the page Morgan table.

Cochran or the Morgan table?

  • The Morgan table is Cochran's calculation done in advance for common population sizes at 95% confidence, a proportion of 0.5 and a 0.05 margin of error; its numbers differ from Cochran's by at most one person.
  • If you need a different confidence level or margin of error (say 99% or 0.03), know p from a pilot study, or don't know the population size, use Cochran's formula.
  • If your supervisor asked for the Morgan table and your population size is in it, take the number from the table and cite Krejcie and Morgan (1970).
  • For a population between two rows of the table, don't guess: get the exact number from the Morgan table calculator or the calculator on this page.

For example, for the 1,200 teachers of one province, Cochran gives 292 and the Morgan table 291; both numbers are acceptable in a thesis — just cite the method you used and its source.

Sample attrition in online questionnaires

Sample size means complete, usable questionnaires — not the number of people who open the link. In an online questionnaire some people always drop out halfway, and some give careless or duplicate answers that have to be discarded.

To compensate, divide the sample size by the share of usable responses you expect. If you think 20% of responses will be discarded, collect at least 482 responses instead of 385 (385 divided by 0.8).

Building and publishing are free, and the free account gets 50 responses a month; more responses unlock with any monthly, quarterly or yearly plan, and no response is ever lost. The “suspicious responses” report separates very fast answers and straight-lined matrices, and the “incomplete responses analysis” and “drop-off point per question” reports show where respondents abandoned the questionnaire. For the questionnaire itself, see Build an online questionnaire for details.

After you have your sample size

  1. Build the questionnaire

    Build your online questionnaire for free, or, if a validated instrument exists for your construct, start from the ready-made standard questionnaires; either way you get a link to send to your sample.

  2. Check reliability

    With your pilot data, check reliability with the Cronbach's alpha calculator; 0.7 or higher is usually acceptable.

  3. Report the method

    In the methods chapter, write: “Using Cochran's formula with a 95% confidence level and a 0.05 margin of error, the sample size for a population of 1000 was set at 278.” The calculator at the top of the page writes this sentence with your own numbers.

Frequently asked questions

What sample size does Cochran's formula give for an unknown population?

At 95% confidence, p = 0.5 and a 0.05 margin of error, the formula gives 384.16; sources usually write 384, or 385 when rounding up.

What sample size does Cochran's formula give for a population of 1000?

278, at 95% confidence, a 0.05 margin of error and p = 0.5: n₀ is 384.16, and after the finite population correction it becomes 277.74, which is rounded up. The Morgan table also gives 278 for this population.

Why set p to 0.5?

Because the product p × (1 − p) is largest when p is 0.5. When you don't know the proportion in the population, 0.5 gives the largest and most conservative sample size.

What is q in Cochran's formula?

q is the proportion of people who don't have the attribute under study, equal to 1 minus p. When you set p to 0.5, q is 0.5 too and the product p × q reaches its maximum, 0.25.

How does the Morgan table differ from Cochran's formula?

The Morgan table has pre-computed the same calculation at 95% confidence and a 0.05 margin of error for common population sizes. The two methods differ by at most one person, due to rounding and the χ² value.

What if I don't know the population size?

Leave the population size box empty. Cochran's formula is then applied without the finite population correction, which gives the largest sample size for that confidence level and margin of error.

How do I calculate Cochran's formula in Excel?

If the population size is in cell A1, the formula ⁨=ROUNDUP((1.96^2*0.5*0.5/0.05^2)/(1+((1.96^2*0.5*0.5/0.05^2)-1)/A1),0)⁩ gives the calculator's number at 95% confidence, a 0.05 margin of error and p = 0.5: 278 for a population of 1000.

Can respondents enter Persian digits too?

Yes. The calculator accepts Persian and English digits, and you can write the decimal separator as a period, “٫” or “/”; for example 0.05 or 5%.

Survey & analysis guides

All posts

Now build your questionnaire

You have your sample size; build the online questionnaire for free and send the link to your population.