Sample size for a proportion

Sample size for a proportion: calculate a transparent estimate from the values and assumptions you provide.

Sample size for a proportion: calculate a transparent estimate from the values and assumptions you provide.

Both dots and commas are accepted as decimal separators.

Your inputs stay in your browser. Displayed results are rounded to a maximum of 12 significant digits.

Method and assumptions

Method version 1.0.0 · Updated

Calculate

Formula: n = z² p(1−p) / e², rounded up

Sample size for a proportion: calculate a transparent estimate from the values and assumptions you provide.

zScore
Z value for confidence level
marginPercent
Desired margin of error (%)
expectedProportion
Expected proportion (%)

Simple random-sample approximation; excludes finite-population and non-response adjustments.

Calculate with code

These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.

JavaScript
const n = Math.ceil(1.96 ** 2 * 0.5 * 0.5 / 0.05 ** 2); // 385