Confidence Interval Width Planner Calculator

Plan sample size required for a target confidence-interval width using confidence level and estimated standard deviation.

Quick Facts

Core Formula
n = (z * sigma / ME)^2 where width = 2 * ME
Use this as a planning and validation aid, then confirm assumptions with your context.

Your Results

Calculated
Required Sample Size
-
Primary output
Margin of Error
-
Secondary output
z-score Used
-
Verification metric
Planning Note
-
Interpretation

Ready

Enter values and calculate to get scenario outputs.

What it is and when to use it

This calculator works the standard sample-size formula backwards: instead of computing a confidence interval from a sample you already collected, it tells you how large a sample you need to collect so that the resulting confidence interval comes out no wider than a target you choose. That makes it a planning tool for the design stage of a study, survey, or A/B test, before any data collection starts.

Use it whenever precision is the deciding factor in your study design — for example, "we need the estimate accurate to within 2 units" rather than "we need to detect a specific effect size." It assumes you have a reasonable estimate of the population standard deviation (sigma) from prior data, a pilot study, or published research, and that the sampling distribution of the mean is approximately normal, which is a standard assumption for large-sample confidence intervals.

n = (z × σ / ME)², where ME = width / 2
z: the critical value for the chosen confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%).
σ (sigma): the estimated population standard deviation of the measurement.
ME (margin of error): half of the target confidence interval width, since a CI extends equally above and below the sample mean.
n: the minimum sample size, always rounded up to the next whole number since you cannot sample a fraction of a unit.

Worked example

You want a 95% confidence interval no wider than 4 units, and prior data suggests a standard deviation of 12. Margin of error = 4 / 2 = 2. n = (1.96 × 12 / 2)² = (23.52 / 2)² = 11.76² = 138.30, rounded up to 139 — matching the calculator's default output of "Moderate survey scale." If you relaxed the target width to 8, the margin of error doubles to 4 and the required sample size drops to (1.96 × 12 / 4)² = 5.88² ≈ 34.57, rounded up to 35, showing how sharply sample size requirements grow as your precision target tightens.

Common mistakes and how to interpret the result

  • Guessing sigma instead of estimating it from real data. The required sample size is proportional to sigma squared, so an inaccurate standard deviation estimate can make your planned sample size far too small or unnecessarily large.
  • Confusing interval width with margin of error. The calculator asks for the full target width, then internally halves it to get the margin of error used in the formula — entering the margin of error into the width field will double the effective precision target.
  • Not accounting for non-response or dropout. This n is the number of completed, usable observations required; if you expect a response rate below 100%, oversample accordingly.
  • Treating the confidence level as a probability about a single interval. A 95% confidence level means that if you repeated the sampling process many times, about 95% of the resulting intervals would contain the true population value — it does not mean there is a 95% chance the true value falls in this specific interval.

Frequently Asked Questions

Why does halving the target width more than double the required sample size?
Sample size scales with the square of the margin of error in the denominator, so cutting the target width in half roughly quadruples the required sample size, not doubles it. This is why tightening precision requirements late in a study design can be expensive: going from a width of 8 to a width of 4 in the worked example nearly quadruples n from 35 to 139.
Where do the z-values 1.645, 1.96, and 2.576 come from?
These are the critical values of the standard normal distribution that leave the stated confidence level in the middle of the curve: 90% of the area falls within ±1.645 standard deviations of the mean, 95% within ±1.96, and 99% within ±2.576. They come from the standard normal (z) table and are the basis for most large-sample confidence interval formulas.
What if I don't have a good estimate of the standard deviation?
Run a small pilot study to estimate sigma before committing to a full sample size, or use a conservative (larger) sigma estimate from similar past studies or published literature. Since required sample size scales with sigma squared, an underestimated sigma is the most common reason a planned study ends up underpowered.
Does this formula work for proportions as well as means?
Not directly. This calculator uses the standard-deviation-based formula appropriate for estimating a population mean. Estimating a proportion (like a percentage) uses a different formula based on p(1-p), since the variance of a proportion depends on the proportion itself rather than a separately estimated sigma.