Math & StatisticsFormula-based · Runs in your browser

Sample Size Calculator

Calculate a required survey sample size or the margin of error for a proportion, including finite-population correction.

Preparing saved example…

Inputs

Enter the values you know. Optional fields may be left empty.

Local save controls below
Required
Required
Required
%
Optional
Required
%

Result

Updates as valid inputs change.

Calculated locally
Required sample size
Margin of error
Confidence interval
Critical z-score
Finite-population correction

Saved locally, explained clearly

Drafts, calculations, scenarios, and workflow progress stay in this browser unless you export them.

Opening local database…

Calculation steps

Follow what happened from the selected formula to the displayed answer.

Show substituted values and intermediate working
Calculate current inputs to see the working.
  1. 1

    Formula selected

    The calculator uses the following formula or method.

    n₀=z²p(1−p)/e²; finite n=n₀/[1+(n₀−1)/N]; e=z√[p(1−p)/n] with finite correction.

  2. 2

    Values entered

    Your values are placed into the calculation.

    Enter values to see what is used in this step.

  3. 3

    Result calculated

    The formula or method produces the following result values.

    Results will appear after a successful calculation.

  4. 4

    Answer formatted

    Displayed values are rounded and formatted using each output’s configured precision.

Scenario comparison

Save working scenarios, then select two or three to compare. Formula versions and inputs remain visible.

No scenarios saved for this calculator yet.

Recent calculations

Successful calculations are retained locally according to your privacy settings.

No local history for this calculator yet.

Data and privacy

How it works

Calculate a required survey sample size or the margin of error for a proportion, including finite-population correction. Inputs are calculated locally in the browser, and valid values are retained in the page URL for bookmarking.

Input query strings and outputs

Use an input name in this page’s URL as ?name=value, and join additional inputs with &. Portable shared links may instead use the compact ?ac= state parameter.

Input query strings

6
  • ?calculation= Calculate

    Choice · Required · Default: sample-size · Accepted values: sample-size, margin-error

  • ?confidenceLevel= Confidence level

    Choice · Required · Default: 95 · Accepted values: 80, 85, 90, 92, 95, 96, 98, 99, 99.9

  • ?populationProportion= Population proportion

    Percentage · Required · Default: 50

  • ?populationSize= Population size (optional)

    Number · Optional

  • ?marginOfError= Desired margin of error

    Percentage · Required · Default: 5 · Used when calculation = sample-size

  • ?sampleSize= Observed sample size

    Number · Required · Default: 385 · Used when calculation = margin-error

Outputs

5
  • requiredSampleSize Required sample size

    Whole number · Primary output

  • marginOfErrorResult Margin of error

    Percentage

  • confidenceInterval Confidence interval

    Text

  • criticalZ Critical z-score

    Number

  • finiteCorrection Finite-population correction

    Number

Formula notes

n₀=z²p(1−p)/e²; finite n=n₀/[1+(n₀−1)/N]; e=z√[p(1−p)/n] with finite correction.

Input guidance

Use consistent units for every length or measurement in the same calculation. Results are educational mathematical estimates and should be checked before high-stakes use.

Sources
Limitations
  • Results depend on the selected method and input assumptions. Displayed decimals may be rounded; retain appropriate precision for later calculations.