Skip to main content

Sample Size Calculator

Calculate the sample size needed for a mean or a proportion using your desired confidence level and margin of error. Includes optional finite population correction, a conservative proportion mode, quick picks, a small sample-size visual, and clear step-by-step explanations.

Background

Sample size planning helps you decide how many observations you need before collecting data. In general, a smaller margin of error or a higher confidence level requires a larger sample. For proportions, using p = 0.5 gives the most conservative (largest) sample size when no estimate is available.

Enter values

Tip: Use Mean mode when you have a reasonable estimate of the population standard deviation σ.

Planning targets

For proportions, use decimal form such as 0.03 for ±3 percentage points.

Sample size for a mean

Use prior studies, pilot data, or a reasonable estimate.

Leave blank if population is large or effectively unlimited.

Options

Raw calculations are shown, but the required sample size is always rounded up to the next whole number.

Chips prefill and calculate immediately.

Result

No results yet. Enter values and click Calculate.

How to use this calculator

  • Choose whether you need a sample size for a mean or a proportion.
  • Enter your target confidence level and desired margin of error.
  • For mean mode, enter an estimate of σ. For proportion mode, use either p = 0.5 for the most conservative answer or enter your own estimated p.
  • Optionally enter a finite population size if your population is not very large.
  • Click Calculate to see the raw sample size, rounded-up required sample size, optional finite-population adjustment, and step-by-step solution.

How this calculator works

  • Mean mode: starts with n = (z*σ / E)².
  • Proportion mode: starts with n = z*² p(1−p) / E².
  • If a finite population size is entered, the calculator applies the finite population correction: n_adj = n₀ / (1 + (n₀ − 1)/N).
  • For proportions, choosing p = 0.5 gives the largest required sample size and is often used when no prior estimate exists.
  • The final required sample size is always rounded up to the next whole number.

Formula & Equations Used

Sample size for a mean: n₀ = (z*σ / E)²

Sample size for a proportion: n₀ = z*² p(1−p) / E²

Finite population correction: n_adj = n₀ / (1 + (n₀ − 1)/N)

Conservative proportion choice: p = 0.5

Example Problem & Step-by-Step Solution

Example 1 — Sample size for a mean

You want a 95% confidence level, a margin of error of E = 2, and you estimate σ = 12. Find the required sample size.

  1. Use n = (z*σ / E)².
  2. For 95% confidence, z* ≈ 1.96.
  3. Substitute: n = (1.96 · 12 / 2)².
  4. Compute the raw value, then round up to the next whole number.

Example 2 — Sample size for a proportion

You want a 95% confidence level and a margin of error of E = 0.03, but you do not know p.

  1. Use the conservative choice p = 0.5.
  2. Apply n = z*² p(1−p) / E².
  3. For 95% confidence, use z* ≈ 1.96.
  4. Compute the raw value, then round up to the next whole number.

Example 3 — Finite population correction

If the raw sample-size result is based on a very large-population formula but your actual population has only N = 500 members, you can reduce the sample size using the finite population correction.

  1. First compute the raw sample size n₀.
  2. Then use n_adj = n₀ / (1 + (n₀ − 1)/N).
  3. Round the adjusted result up to the next whole number.

Frequently Asked Questions

Q: Why does a smaller margin of error require a larger sample?

Because tighter precision means less uncertainty is allowed, so you need more data to shrink the sampling variability.

Q: Why is p = 0.5 called conservative?

Because p(1−p) is largest when p = 0.5, which produces the largest required sample size.

Q: Should I always use the finite population correction?

Usually only when your target population is not very large and your sample would be a noticeable fraction of that population.

Q: Why does the calculator round up?

Because sample size must be a whole number, and rounding down could leave you with less precision than requested.

Mean
3. Describing Data Numerically
4 problems
Topic
Ally
Standard Deviation
3. Describing Data Numerically
7 problems
Topic
Jonathan
Standard Normal Distribution
6. Normal Distribution and Continuous Random Variables
7 problems
Topic
Laura
Introduction to Confidence Intervals
7. Sampling Distributions & Confidence Intervals: Mean
6 problems
Topic
Ernest
Confidence Intervals for Population Mean
7. Sampling Distributions & Confidence Intervals: Mean
7 problems
Topic
Justin
Confidence Intervals for Population Proportion
8. Sampling Distributions & Confidence Intervals: Proportion
7 problems
Topic
Ernest
3. Describing Data Numerically
4 topics 11 problems
Chapter
David-Paige
6. Normal Distribution and Continuous Random Variables
2 topics 6 problems
Chapter
Justin
7. Sampling Distributions & Confidence Intervals: Mean
2 topics 6 problems
Chapter
Ally
8. Sampling Distributions & Confidence Intervals: Proportion
1 topic 3 problems
Chapter
Ernest
Mean
3. Describing Data Numerically
10 problems
Topic
Brendan
Standard Deviation
3. Describing Data Numerically
10 problems
Topic
Jonathan
Standard Normal Distribution
6. Normal Distribution & Continuous Random Variables
10 problems
Topic
Ernest
Sampling Distribution of the Sample Mean and Central Limit Theorem
7. Sampling Distributions & Confidence Intervals: Mean
10 problems
Topic
David-Paige
Introduction to Confidence Intervals
7. Sampling Distributions & Confidence Intervals: Mean
10 problems
Topic
Justin
Confidence Intervals for Population Mean
7. Sampling Distributions & Confidence Intervals: Mean
10 problems
Topic
Laura
Sampling Distribution of Sample Proportion
8. Sampling Distributions & Confidence Intervals: Proportion
10 problems
Topic
David-Paige
Confidence Intervals for Population Proportion
8. Sampling Distributions & Confidence Intervals: Proportion
10 problems
Topic
Ernest
3. Describing Data Numerically
8 topics 15 problems
Chapter
Jonathan
6. Normal Distribution & Continuous Random Variables
4 topics 15 problems
Chapter
Ernest
7. Sampling Distributions & Confidence Intervals: Mean
3 topics 15 problems
Chapter
Ally
8. Sampling Distributions & Confidence Intervals: Proportion
2 topics 15 problems
Chapter
Laura