Sample Size Calculator - Cochran's Formula

Calculate the minimum sample size needed for a reliable survey or study. Set your confidence level, margin of error, and population proportion to get an instant result.

Choose a confidence level, enter the margin of error as a percentage, set the expected population proportion (use 0.5 if unknown), and optionally provide the total population size for a finite-population correction.

Sample Size Calculator - Cochran's Formula
Calculate the minimum sample size needed for a reliable survey or study. Set your confidence level, margin of error, and population proportion to get an instant result.

About the Sample Size Calculator

Sample size determination is one of the most important steps in the design of any survey, experiment, or observational study. Choosing the right number of participants ensures that your results are statistically meaningful and that your resources are used efficiently. This calculator uses Cochran's formula, the industry-standard approach for estimating the required sample size when the population is large or unknown. The formula is: n = Z² × p × (1 – p) / E², where Z is the Z-score corresponding to the desired confidence level, p is the estimated population proportion, and E is the acceptable margin of error expressed as a decimal. The confidence level reflects how certain you want to be that your sample results fall within the stated margin of error. A 95% confidence level — by far the most commonly used in social science and market research — corresponds to a Z-score of 1.96. This means that if you repeated your survey 100 times, the true population value would fall within your margin of error in approximately 95 of those repetitions. The margin of error defines the width of the uncertainty band around your estimate. A margin of error of ±5% means your observed proportion could be up to 5 percentage points higher or lower than the true population proportion. Tighter margins of error require larger sample sizes. Because the formula involves E², halving the margin of error roughly quadruples the required sample size. The population proportion p controls the variance in the formula. Setting p = 0.5 maximises p(1 – p) = 0.25 and therefore produces the most conservative (largest) sample size estimate. This is the standard recommendation when no prior information is available. If a previous study has given you a reliable estimate of p, you can use that value to potentially reduce the required sample size. When the total population size N is small relative to the required sample (specifically when n exceeds 5% of N), the finite population correction (FPC) factor should be applied: n_adj = n / (1 + (n – 1) / N). This adjustment reduces the required sample size, reflecting the fact that a larger fraction of the population is being measured. In practice, you should add a buffer to the calculated sample size to account for non-response, data quality issues, and dropout. A common approach is to divide the target sample size by the expected response rate. For example, if you calculate n = 385 but expect a 70% response rate, you should contact at least 385 / 0.70 ≈ 550 potential respondents.

Sample size calculation examples

Three common scenarios showing how confidence level, margin of error, and population size affect the required sample.

ParametersSample SizeNotes
95% CL, ±5% MoE, p=0.5, infinite population385The classic rule-of-thumb sample size. Used for national polls and large-scale surveys where the population size is very large.
95% CL, ±3% MoE, p=0.5, infinite population1,068Tightening the margin of error from 5% to 3% more than doubles the required sample size due to the E² relationship.
95% CL, ±5% MoE, p=0.5, N=500218Finite population correction reduces the sample from 385 to 218 because the sample is a large fraction of the total population.

How to use the sample size calculator

  1. Select your desired Confidence Level from the dropdown (80%, 85%, 90%, 95%, or 99%). For most surveys, 95% is the standard choice.
  2. Enter the Margin of Error as a percentage. A value of 5 means ±5%. Smaller values yield higher precision but require larger samples.
  3. Enter the expected Population Proportion as a decimal between 0 and 1. If you are unsure, use 0.5, which gives the largest (most conservative) sample size estimate.
  4. Optionally enter the total Population Size if your population is small and finite. Leave the field blank if the population is large or unknown.
  5. Click Calculate to see the recommended minimum sample size. Click Reset to clear all fields and start over.

Sample size calculator FAQ

Why is 0.5 the recommended proportion when uncertain?
The expression p(1 – p) reaches its maximum value of 0.25 when p = 0.5. Using 0.5 ensures the formula produces the largest possible sample size for a given confidence level and margin of error, providing a conservative estimate that is guaranteed to be sufficient regardless of the true proportion.
What does a 95% confidence level mean?
A 95% confidence level means that if you repeated your sampling process many times, 95% of the resulting confidence intervals would contain the true population parameter. It does not mean there is a 95% probability that the true value lies within a specific calculated interval.
How does population size affect the required sample?
For large populations, the required sample size is virtually independent of population size — a poll of 385 people is as statistically meaningful for a country of 300 million as for a city of 100,000. The finite population correction only makes a meaningful difference when the required sample exceeds 5% of the total population.
What is the relationship between margin of error and sample size?
The margin of error appears as E² in the denominator of Cochran's formula, so there is an inverse-square relationship: halving the margin of error requires approximately four times as many respondents. This is why achieving very high precision (e.g., ±1%) is enormously expensive in terms of sample size.
Should I add extra respondents for non-response?
Yes. The calculated sample size is the number of completed, usable responses needed. To account for non-response, divide this number by the expected response rate. If you expect a 60% response rate and need 385 completed surveys, you should contact at least 385 / 0.60 ≈ 642 potential respondents.
Can this calculator be used for A/B testing?
The Cochran formula implemented here is designed for estimating proportions in survey research. For A/B testing, you also need to specify the minimum detectable effect and the statistical power (typically 80%). Dedicated A/B test sample size calculators use slightly different formulas and are more appropriate for that use case.