Hypothesis Tests
Cochran's Formula Calculator
Cochran's formula sizes a sample from a normal critical value and either a yes-or-no rate or a numeric standard deviation.
Worksheet
Press Calculate to see the result.
Cochran's formula sizes a sample from a normal critical value and either a yes-or-no rate or a numeric standard deviation.
What this calculator answers
Cochran's formula is the sample-size identity that keeps the normal cutoff and the variance in plain sight. For a yes-or-no rate you type z, a planning proportion, and the margin as a share of the whole. For a numeric mean you type z, the population sigma, and a margin in the same units as that sigma. The proportion path can then shrink the first answer with a finite population. The mean path on this page stops at the infinite-population size, so the two modes do not share a hidden correction.
Proportion mode reports n0 and, when N is typed, the corrected n, both rounded up. Mean mode reports only the rounded (z times sigma divided by e) squared. Supporting counts and intermediate terms sit under the headline so a reader can see what was divided by what. When a checkbox or a tail setting changes the divisor or the rejection region, that choice appears in the steps rather than vanishing into a silent default.
The formula, written out
Cochran's sample size uses this relationship.
Proportion: n0 = z^2 p (1-p) / e^2, then n = n0 / (1 + (n0-1) / N). Mean: n0 = (z sigma / e)^2.
- z. Normal critical value typed by you, such as 1.96.
- p. Planning proportion. The product p(1-p) peaks at 0.25 when p is 0.5.
- e. Margin: a proportion in one mode, a measurement unit in the other.
- N. Population used only to correct the proportion sample size.
The margin of a proportion is z times the square root of p(1-p) over n, and solving for n produces z squared times p(1-p) over e squared. The mean version replaces the Bernoulli variance with sigma squared, which is why the inputs are a standard deviation and a margin in data units rather than a rate. The algebra is the named textbook identity for this worksheet. Intermediate products and quotients appear in order so a calculator and a pencil can agree to the displayed rounding. If a neighbouring page uses a different divisor or a continuity correction, that page says so on its own ticket.
A full worked example
Example loaded in the worksheet
The loaded proportion plan uses z of 1.96, p of 0.5, a margin of 0.05, and a population of 2000.
Proportion mode uses z equal to 1.96, p equal to 0.5, and margin e equal to 0.05. The variance factor p times (1 minus p) is 0.25. It would be 0.25 if p were exactly 0.5. n0 equals z squared times that factor, divided by e squared: 3.8416 times 0.25 divided by 0.0025 equals 384.16.
Sigma on the form is 10, and the mean formula ignores it while this mode is the proportion identity. The finite-population correction divides by 1 plus (n0 minus 1) over N: 1 plus (383.16 divided by 2,000) equals 1.1916. The corrected size is 384.16 divided by 1.1916, which equals 322.3955.
Rounding up 322.3955 gives a field count of 323. This path never asks for a design effect. Yamane's page is the one that multiplies by DEFF after a different base.
| Corrected sample size | 323 |
|---|---|
| Unrounded size | 322.3955 |
| Infinite-population n0 | 384.16 |
A second situation
Mean mode: z of 1.96, sigma of 12, and a margin of 3 units
Mean mode uses z equal to 1.96, sigma equal to 12, and margin e equal to 3 in the same units as sigma. The ratio z times sigma divided by e is 7.84. Squaring that ratio gives n0 equal to 61.4656.
Rounding up gives 62 observations. The planning proportion box shows 0.5, and the mean identity does not multiply by p times (1 minus p). Population N shows a blank. The mean mode on this page does not divide by a finite-population factor.
The proportion correction n equals n0 over 1 plus (n0 minus 1) over N lives only in the proportion mode. A guessed p of 0.5 would be a different calculator. This result is a mean-sample size.
| Sample size | 62 |
|---|---|
| Unrounded n0 | 61.4656 |
| Sigma | 12 |
The second example leaves the proportion identity and sizes a mean with sigma equal to 12 and a margin of 3. Population N is blank there because the mean mode does not apply the finite-population correction. The second example changes the feature that this formula is sensitive to, and the ticket shows the new figure beside the same definition. That contrast is the fastest way to see which input owns the movement.
What moves when the input moves
The proportion margin tightened from 0.05 to 0.04. Z, p, and N stayed put. The headline result went from 323 to 462.
The nudged inputs
Proportion mode uses z equal to 1.96, p equal to 0.5, and margin e equal to 0.04. The variance factor p times (1 minus p) is 0.25. It would be 0.25 if p were exactly 0.5. n0 equals z squared times that factor, divided by e squared: 3.8416 times 0.25 divided by 0.0016 equals 600.25.
Sigma on the form is 10, and the mean formula ignores it while this mode is the proportion identity. The finite-population correction divides by 1 plus (n0 minus 1) over N: 1 plus (599.25 divided by 2,000) equals 1.2996. The corrected size is 600.25 divided by 1.2996, which equals 461.864.
Rounding up 461.864 gives a field count of 462. This path never asks for a design effect. Yamane's page is the one that multiplies by DEFF after a different base.
| Corrected sample size | 462 |
|---|---|
| Unrounded size | 461.864 |
| Infinite-population n0 | 600.25 |
How to read the result
Read n0 as the size you would need if the population were enormous. Read the corrected n as the smaller field count that is enough once the frame itself is only N units. Say the unit, the sample size or contract terms, and the formula name in the same sentence as the figure. A number without those three pieces invites a later reader to invent a definition that this page never used.
State the mode, the z you used, the margin, and whether N corrected the size. A bare sample size hides which of the two Cochran identities produced it. Write the result with its unit, the inputs that produced it, and the name of the formula. If the ticket shows a decision sentence, quote the alpha and the tail with it. If the ticket shows a money or dose figure, quote the rate and the schedule that produced it.
Assumptions that have to stay true
- The z you type matches the confidence level you intend, and it is a normal cutoff rather than an alpha such as 0.05.
- In proportion mode, p is a realistic planning rate or the cautious 0.5.
- In mean mode, sigma is the population standard deviation in the same units as e.
- The finite correction is a simple random sample from a finite list, not a cluster design.
If an assumption above is false, do not average the discomfort away. Change the worksheet or change the question. A correct arithmetic step on the wrong model is still the wrong answer for the decision you are trying to make.
Mistakes that change the answer
- Putting alpha in the z box. An alpha of 0.05 is not a z of 0.05.
- Using 5 as the margin when you mean 5 percent. Proportion mode wants 0.05.
- Applying the population correction on the mean mode and expecting this page to do it.
- Forgetting to round up, then fielding a fraction of a respondent.
Where a different calculator is the honest choice
Slovin's formula calculator hides z and p inside the half-and-half bound. Yamane's formula calculator adds nonresponse and a design effect after a Slovin-style base. Use those pages when that is the plan you actually have. Related links under the essay open pages that keep their own formulas instead of hiding a mode switch inside this ticket.
When the job changes, move to a page built for that job: Slovin's Formula Calculator, Yamane's Formula Calculator, Confidence Interval Calculator.
Check yourself
With z equal to 1.96, p equal to 0.5, e equal to 0.05, and a population of 2000, what sample size does the corrected Cochran formula round up to?
The infinite-population size is 384.16, the corrected size is 322.3955, and rounding up gives 323.
Using the result in a sentence
Campaign polling on a voter file and a lab that must estimate a mean to within a stated number of units both start here. After the data exist, a confidence interval replaces the planning margin. Keep the count, the unit, and the assumption list beside any copy of the number that leaves this browser tab.
A planning p that is badly wrong moves n0 by a large factor, and the page cannot discover the true rate for you. The correction also assumes every selected unit responds. Pair the headline with the steps before you staff a route, set a grade boundary, or compare two contracts from a single number.
Questions people ask next
01What definition does the Cochran's Formula Calculator commit to?
This page uses Cochran's sample size: Proportion: n0 = z^2 p (1-p) / e^2, then n = n0 / (1 + (n0-1) / N). Mean: n0 = (z sigma / e)^2.. The margin of a proportion is z times the square root of p(1-p) over n, and solving for n produces z squared times p(1-p) over e squared. The mean version replaces the Bernoulli variance with sigma squared, which is why the inputs are a standard deviation and a margin in data units rather than a rate. If a textbook uses a different divisor, a different continuity correction, or a different rounding rule, the last digits can move, so the definition is printed above the result. The worksheet asks for What is being estimated, Z critical value, Expected proportion p, Margin e, Sigma, Population N, and it refuses a blank that the formula cannot interpret. Keep that printed definition in the sentence you write next to the figure so a later reader can rebuild the arithmetic without guessing which convention you chose.
02How should the worked example be read out loud?
In the loaded example the corrected sample size is 323. Read n0 as the size you would need if the population were enormous. Read the corrected n as the smaller field count that is enough once the frame itself is only N units. Say the unit and the count before you say whether the number is large or small. Read the steps in order rather than jumping to the headline, because the intermediate terms are where a swapped percent and proportion usually hide. If the ticket shows both a primary figure and a comparison figure, name which one you are quoting.
03What is the fastest way to get a misleading result?
Putting alpha in the z box. An alpha of 0.05 is not a z of 0.05. A planning p that is badly wrong moves n0 by a large factor, and the page cannot discover the true rate for you. The correction also assumes every selected unit responds. A second common failure is leaving a checkbox or tail setting in the wrong state and then treating the number as if the default had matched your plan. Reset the example, change one input, and confirm the ticket moves in the direction the formula predicts before you trust a live run.
04When should I leave this page for a different calculator?
Slovin's formula calculator hides z and p inside the half-and-half bound. Yamane's formula calculator adds nonresponse and a design effect after a Slovin-style base. Use those pages when that is the plan you actually have. The related links under the essay go to those worksheets, which keep their own formulas instead of hiding them in a mode switch. If the question changed from a summary to a test, from a payment to a refinance, or from a raw score to a percentile, switch pages rather than forcing this ticket to answer a job it was not built for.
05What belongs in the sentence next to the number?
The infinite-population size is 384.16, the corrected size is 322.3955, and rounding up gives 323. State the mode, the z you used, the margin, and whether N corrected the size. A bare sample size hides which of the two Cochran identities produced it. A bare number without those three pieces cannot be audited when a score, a rate, or a lab value is challenged later. Store the inputs beside the result whenever the figure will travel into a report.