Sample Size Calculator
Calculate the survey sample size needed for a target margin of error.
About the Sample Size Calculator
Determines how many responses you need for a survey to achieve a given margin of error at a chosen confidence level, with an optional finite-population correction.
$$ n = \frac{z^2 p(1-p)}{e^2} $$
How to use this calculator
- Choose your confidence level, then get the matching z value, such as 1.96 for 95%.
- Enter an estimated proportion p, or use 0.5 if you do not know it because that gives the largest required sample.
- Enter your desired margin of error e as a decimal, such as 0.04 for 4%.
- Compute n with the formula, then round up to the next whole person because you cannot survey a fraction of a person.
The formula explained
The formula computes the minimum sample size needed to estimate a population proportion with a chosen margin of error, assuming a normal approximation. The value of p controls how variable the population is, and the margin of error sets how precise you want the estimate to be.
- n = required sample size
- z = z score for the chosen confidence level
- p = estimated population proportion
- e = desired margin of error, written as a decimal
Step by step method
- Identify the confidence level and write down its z value.
- Choose p, often 0.5 if no prior estimate is available.
- Plug z, p, and e into \(n = \frac{z^2 p(1-p)}{e^2}\).
- Round the result up to the next whole number.
Worked example
Problem. How many people should you survey to estimate a proportion with 95% confidence, a margin of error of 4%, and no prior estimate for p?
- Use 95% confidence, so \(z = 1.96\). Set \(p = 0.5\) and \(e = 0.04\).
- Substitute into the formula: \(n = \frac{1.96^2 \cdot 0.5(1-0.5)}{0.04^2} = \frac{3.8416 \cdot 0.25}{0.0016}\).
- Compute \(n = 600.25\), then round up to 601.
Answer. 601 people
Tips and common mistakes
- Always enter the margin of error as a decimal, so 5% becomes 0.05, not 5.
- If you do not know p, use 0.5, because it gives the safest, largest sample size estimate.
Frequently asked questions
What proportion should I use?+
If unknown, use 0.5, it gives the largest, safest sample size.
When do I add the population size?+
For small populations; it reduces the required sample via the finite-population correction.
More Mathematics Tools
Explore related calculators in this category
Absolute Value Calculator
Calculate the absolute value of any number. Use this free calculator for fast, accurate answers, complete with the formula and a worked example.
Absolute Value Equation Solver
Solve equations of the form |ax + b| = c.
Adding Fractions Calculator
Add two fractions with step-by-step simplification.
One-Way ANOVA Calculator
Perform one-way ANOVA on multiple groups.
You Might Also Like
Popular tools from other categories
AC to DC Converter Calculator
Convert AC voltage to DC voltage for different rectifier configurations. Free online calculator with instant, step-by-step results.
Acid-Base Titration Calculator
Calculate concentration from titration data. Get quick, accurate results with this free online calculator, including formulas and worked examples.
ABV Calculator
Calculate alcohol by volume from original and final gravity. Free calculator with instant calculations, the underlying formula, and an easy-to-follow example.
Amortization Schedule Calculator - Free Online
Free Generate a complete amortization schedule. Step-by-step solutions and formulas included. Free, accurate results with step-by-step explanations.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.