Sample Size Calculator

Calculate the required sample size for estimating means and proportions. Includes margin of error calculator, finite population correction, confidence level selection, and step-by-step explanations.

Sample Size Calculator

Calculate required sample size for means, proportions, or find the margin of error

Estimate from pilot study or prior data
Desired precision (±E)
Z(α/2) = 1.9600
For finite populations (e.g., school, company)

Enter standard deviation and margin of error to calculate

Example: σ = 15, E = 3, 95% confidence → n ≈ 97

Sample Size for Mean · Sample Size for Proportion · Margin of Error · Finite Population Correction

Free Sample Size Calculator - Calculate Survey & Research Sample Size | Lembog

Our Sample Size Calculator is a free, powerful online tool that helps researchers, surveyors, and data analysts determine the exact number of respondents or observations needed for statistically valid results. Whether you are estimating a mean, a proportion, or working backwards from a sample to find the margin of error, this calculator provides instant, accurate answers with step-by-step explanations.

What is Sample Size and Why It Matters

Sample size is the number of individual observations or data points collected from a population for a study or survey. It is one of the most critical elements in statistical analysis because it directly affects the reliability and precision of your results.

A sample that is too small may fail to detect meaningful effects or produce unreliable estimates. A sample that is too large wastes time, money, and resources without meaningfully improving accuracy. Finding the right sample size ensures your study is both statistically valid and practically efficient.

The key factors that determine sample size include the desired confidence level, the acceptable margin of error, and the variability of the population being studied. Our calculator takes all these factors into account and computes the optimal sample size instantly.

Sample Size Formulas

Sample Size for Estimating a Mean

When you want to estimate the average value of a continuous variable (such as height, income, or test scores), use this formula:

n = (Z(α/2) × σ / E)²

Where:

  • n is the required sample size
  • Z(α/2) is the critical value from the standard normal distribution corresponding to your chosen confidence level
  • σ (sigma) is the population standard deviation
  • E is the desired margin of error

For example, if you want to estimate average income with a 95% confidence level, a known standard deviation of $5,000, and a margin of error of $500:

n = (1.96 × 5000 / 500)² = (19.6)² = 384.16 → 385

You need at least 385 respondents.

Sample Size for Estimating a Proportion

When you want to estimate a percentage or rate (such as approval rating, defect rate, or conversion rate), use this formula:

n = Z(α/2)² × p̂ × (1 − p̂) / E²

Where:

  • n is the required sample size
  • Z(α/2) is the critical value for your confidence level
  • (p-hat) is the expected proportion (use 0.5 for maximum variability if unknown)
  • E is the desired margin of error

Using p̂ = 0.5 gives the most conservative (largest) sample size because 0.5 × 0.5 = 0.25 is the maximum possible value of p̂ × (1 − p̂).

For example, to estimate a proportion with 95% confidence and a 3% margin of error:

n = 1.96² × 0.5 × 0.5 / 0.03² = 3.8416 × 0.25 / 0.0009 = 1067.11 → 1068

Margin of Error Explained

The margin of error (MoE) quantifies the range within which the true population parameter is expected to fall. A smaller margin of error means more precise estimates but requires a larger sample size.

Margin of Error for Proportions

E = Z(α/2) × √(p̂(1 − p̂) / n)

Margin of Error for Means

E = Z(α/2) × σ / √n

For instance, if a survey of n = 1000 people finds p̂ = 0.45 with 95% confidence:

E = 1.96 × √(0.45 × 0.55 / 1000) = 1.96 × 0.0157 = 0.0308

The true proportion is between 41.9% and 48.1% with 95% confidence.

Understanding the margin of error helps you communicate uncertainty clearly. When news organizations report poll results with a "plus or minus 3 percentage points" figure, they are reporting the margin of error.

Confidence Level vs Sample Size

The confidence level represents how often the true population parameter would fall within the margin of error if you repeated the study many times. Common confidence levels include:

Confidence LevelZ(α/2) ValueDescription
90%1.645Lower precision, smaller sample
95%1.960Standard for most research
99%2.576High precision, larger sample
99.9%3.291Very high precision

As confidence level increases, the required sample size grows substantially. Moving from 95% to 99% confidence can increase the sample size by over 70%. The relationship between confidence and sample size follows a curve of diminishing returns — each additional percentage point of confidence costs more in sample size than the last.

Finite Population Correction

When the population size is known and relatively small (typically when the sample is more than 5% of the population), you should apply the finite population correction (FPC) factor:

n_adjusted = n / (1 + (n − 1) / N)

Where N is the total population size and n is the initial (uncorrected) sample size.

This correction reduces the required sample size because sampling without replacement from a small population provides more information per observation than sampling from an effectively infinite population.

For example, if your uncorrected sample size is 385 and the total population is 1,000:

n_adjusted = 385 / (1 + 384/1000) = 385 / 1.384 = 278

You only need 278 instead of 385, saving 107 observations.

How to Determine Sample Size Step-by-Step

Step 1: Define Your Research Question

Clearly state what you want to estimate — a mean (average) or a proportion (percentage). This determines which formula to use.

Step 2: Choose Your Confidence Level

Most research uses 95% confidence. Use 90% for exploratory studies and 99% for critical decisions where accuracy is paramount.

Step 3: Set Your Margin of Error

Decide how precise your estimate needs to be. Common choices include ±3% for political polls, ±5% for market research, and ±1% for quality control.

Step 4: Estimate Variability

For proportions, use p̂ = 0.5 if you have no prior information. For means, estimate the standard deviation from previous studies, pilot samples, or the range rule (σ ≈ range / 4).

Step 5: Calculate and Apply Corrections

Use the appropriate formula to compute the sample size. If your population is small and known, apply the finite population correction.

Common Sample Sizes Table

The following table shows required sample sizes for estimating a proportion with p̂ = 0.5:

Margin of Error90% Confidence95% Confidence99% Confidence
±1%6,7659,60416,590
±2%1,6912,4014,148
±3%7521,0681,843
±4%4236011,037
±5%271385664
±6%188267461
±7%138196339
±8%106151260
±9%84119206
±10%6897167

This table demonstrates a key insight: cutting the margin of error in half requires roughly four times the sample size.

Real-World Applications

Surveys and Polls

Political pollsters, market researchers, and social scientists use sample size calculations to determine how many people to survey. A typical national political poll surveys about 1,000 people, achieving a ±3.1% margin of error at 95% confidence.

Clinical Trials

Pharmaceutical companies and medical researchers calculate sample sizes to ensure clinical trials have enough participants to detect meaningful treatment effects. Regulatory agencies like the FDA require pre-specified sample sizes with statistical justification.

Quality Control

Manufacturing companies use sample size calculations to determine how many items to inspect from each production batch. Statistical process control relies on proper sample sizes to detect defects and maintain quality standards.

A/B Testing

Digital marketers and product managers use sample size calculators to determine how many users need to be included in each variant of an A/B test to reliably detect differences in conversion rates, click-through rates, or other metrics.

Market Research

Companies conducting customer satisfaction surveys, brand awareness studies, or product testing use sample size calculations to ensure their findings are representative of the broader market without overspending on data collection.

Frequently Asked Questions

What sample size do I need for a survey?

For a general survey estimating a proportion with 95% confidence and ±5% margin of error, you need approximately 385 respondents. For ±3% precision, you need about 1,068. Use our calculator above for exact numbers based on your specific requirements.

How do I calculate sample size for a mean?

To calculate sample size for estimating a mean, you need three values: the population standard deviation (σ), the desired margin of error (E), and the confidence level. Apply the formula n = (Z × σ / E)² where Z is the critical value for your confidence level. Our calculator handles this automatically.

What is margin of error?

Margin of error is the range above and below your sample statistic within which the true population value is expected to fall at a given confidence level. For example, if a poll shows 52% support with a ±3% margin of error, the true support is between 49% and 55% with the stated confidence.

Does population size matter for sample size?

Population size only matters when your sample represents a significant fraction (typically more than 5%) of the total population. For large populations (e.g., a country with millions of people), the population size has virtually no effect on the required sample size. For small populations (e.g., a company with 200 employees), the finite population correction can substantially reduce the required sample size.

What confidence level should I use?

The 95% confidence level is the most widely used standard in research and polling. Use 90% for preliminary or exploratory studies where some additional uncertainty is acceptable. Use 99% for high-stakes decisions in medicine, engineering, or policy where greater certainty is needed.

What if I don't know the standard deviation?

If you don't know the population standard deviation, you can estimate it using a pilot study (a small preliminary sample), previous research, or the range rule: σ ≈ (maximum − minimum) / 4. For proportions, always use p̂ = 0.5 when you have no prior information, as this gives the most conservative (largest) sample size.

What is the minimum sample size?

There is no universal minimum sample size — it depends on your desired precision and confidence level. However, as a practical guideline, statisticians often recommend at least 30 observations for the Central Limit Theorem to apply, and many journals require at least 5-10 observations per variable in regression analysis. For very small populations, you may need to survey everyone.

How does sample size affect accuracy?

Increasing sample size reduces the margin of error, but with diminishing returns. Doubling the sample size reduces the margin of error by a factor of approximately √2 ≈ 1.41, not by half. To cut the margin of error in half, you need four times the sample size. This is why extremely large samples are often not cost-effective compared to moderate ones.

Why Use Our Sample Size Calculator

Our Sample Size Calculator provides instant, precise calculations for all three core scenarios — estimating a mean, estimating a proportion, and finding the margin of error from an existing sample. Unlike basic calculators, our tool includes finite population correction, custom confidence levels, and visual tradeoff charts that help you understand the relationship between sample size and precision.

Every calculation includes detailed step-by-step explanations so you can verify the math and understand the statistical reasoning. The confidence level quick-select buttons and conservative defaults make it easy to get started, while the custom options give advanced users full control. Whether you are a student, researcher, marketer, or quality engineer, our free calculator gives you reliable sample size estimates without downloads or sign-ups.