AP Stats Sample Size Calculator
Sample size answers a planning question: how many observations do you need before you collect data? A smaller margin of error or a higher confidence level always needs a larger sample.
Sample Size Calculator
Interactive visual: Live preview
Press Show live preview to redraw this chart from your calculator inputs.
What Is Sample Size?
Sample size is the number of individuals or observations you need to collect so that your estimate is precise enough. The sample size you need grows when you want a smaller margin of error or a higher confidence level, and it depends on how much the values vary. Planning the sample size before you collect data keeps a study from being too small to answer its question.
Interactive visual: See the idea
Example: sigma = 10, ME = 2 at 95% — n = 97. Margin falls as n grows.
How to Use This Calculator
Interactive visual: Walk through it
Step 1: Open the AP Stats Sample Size Calculator calculator at the top and enter the values it asks for.
Choose whether you are estimating a mean or a proportion, pick a confidence level, enter σ (for a mean) or p (for a proportion), and enter the margin of error you can accept. The calculator rounds up to the next whole person — you cannot sample a fraction of a person, and rounding down would make the margin of error larger than you asked for.
How to Calculate Sample Size
Interactive visual: See it on a chart
Press Update visual to redraw this chart from your calculator inputs.
For a mean: n = (z* × σ / ME)². For a proportion: n = (z*)² × p(1 − p) / ME². The critical values are z* = 1.645 for 90%, 1.96 for 95%, and 2.576 for 99%.
Worked example (mean): σ = 10, ME = 2, 95% confidence (z* = 1.96). n = (1.96 × 10 / 2)² = (9.8)² = 96.04, rounded up to 97. Worked example (proportion): p = 0.5, ME = 0.03, 95% confidence. n = 1.96² × 0.5 × 0.5 / 0.03² = 0.9604 / 0.0009 = 1067.11, rounded up to 1068.
Tips and Common Mistakes
Interactive visual: Mistake vs correct
Mistake: Rounding the required n down.
- For a proportion with no prior estimate, use p = 0.5. It gives the largest, safest sample size.
- Halving the margin of error quadruples the sample size — ME is squared in the formula.
- Enter ME for a proportion as a decimal: 3% means 0.03, not 3.
- Always round up, never down, and never round to a “nice” number below the calculated n.
- Sample size formulas assume random sampling; a large but biased sample is still biased.
Frequently Asked Questions
Interactive visual: FAQ
Tap any question below to show or hide its answer.
Why is the proportion sample size so much larger than the mean sample size?
They use different units. A proportion margin of error like 0.03 is very small in absolute terms, so it needs many observations. A mean margin of error of 2 units may be relatively generous.
What if I do not know σ?
Use a pilot study or a previous study to estimate σ. If no estimate exists, you cannot use the mean formula reliably — collect a small pilot sample first.
Why use p = 0.5 when p is unknown?
p(1 − p) is largest at p = 0.5, so it gives the most conservative (largest) sample size, guaranteeing your ME at any true proportion.
Does a higher confidence level need a bigger sample?
Yes. 99% confidence uses z* = 2.576 instead of 1.96, so n grows by a factor of (2.576/1.96)² ≈ 1.73.
Can I just sample everyone?
A census removes sampling error but is usually too costly. Sample size planning finds the smallest sample that still meets your ME and confidence goals.
What does “rounded up” mean in practice?
If the formula gives 96.04, you need 97 people. With only 96, your actual margin of error would be slightly larger than planned.
Disclaimer: AP is a trademark of the College Board, which was not involved in this site.
Related Calculators and Guides
Keep exploring AP Statistics with calculators and guides related to this tool.
Related Calculators
Interactive visual: Tool path
Start with this tool, then follow the path through the related calculators.
Sample Size Calculator → Margin of Error Calculator → Confidence Interval Calculator