{
  "id": "sample-size-calculator",
  "version": "2.0.0",
  "name": "Sample Size Calculator",
  "shortName": "Sample size",
  "description": "Calculate a required survey sample size or the margin of error for a proportion, including finite-population correction.",
  "category": "Math & Statistics",
  "categorySlug": "math-statistics",
  "keywords": [
    "sample size",
    "survey sample",
    "margin of error",
    "population proportion",
    "confidence level",
    "finite population correction"
  ],
  "status": "live",
  "workStatus": "pending",
  "reviewStatus": "pending",
  "migrationStatus": "migrated",
  "migratedDate": "2026-08-25",
  "engine": "native",
  "creator": null,
  "reviewer": null,
  "quality": {
    "availability": "live",
    "technicalReviewRecord": "/reviews/sample-size-calculator.json",
    "qualifiedReview": "pending",
    "qualifiedReviewer": null,
    "qualifiedReviewDate": null,
    "formulaVersion": "2.0.0",
    "referenceCoverage": "references-listed",
    "releaseTestScope": "Catalog and regression checks are not a professional formula audit; consult release evidence.",
    "historicalMetadataDate": "2026-08-25",
    "historicalMetadataNotice": "The imported date is not evidence of a completed human review."
  },
  "urls": {
    "page": "/calculator/sample-size-calculator/",
    "definition": "/calculator/sample-size-calculator/definition.json",
    "schema": "/calculator/sample-size-calculator/schema.json",
    "llms": "/calculator/sample-size-calculator/llms.txt",
    "legacyDefinition": "/calculator/sample-size-calculator.json"
  },
  "queryExample": "https://askcalculators.com/calculator/sample-size-calculator/?calculation=sample-size&confidenceLevel=95&populationProportion=50&marginOfError=5",
  "queryParameters": {
    "calculation": {
      "label": "Calculate",
      "type": "select",
      "required": true,
      "default": "sample-size"
    },
    "confidenceLevel": {
      "label": "Confidence level",
      "type": "select",
      "required": true,
      "default": 95
    },
    "populationProportion": {
      "label": "Population proportion",
      "type": "percent",
      "required": true,
      "default": 50
    },
    "populationSize": {
      "label": "Population size (optional)",
      "type": "number",
      "required": false
    },
    "marginOfError": {
      "label": "Desired margin of error",
      "type": "percent",
      "required": true,
      "default": 5,
      "showWhen": {
        "field": "calculation",
        "equals": "sample-size"
      }
    },
    "sampleSize": {
      "label": "Observed sample size",
      "type": "number",
      "required": true,
      "default": 385,
      "showWhen": {
        "field": "calculation",
        "equals": "margin-error"
      }
    }
  },
  "inputs": [
    {
      "id": "calculation",
      "label": "Calculate",
      "type": "select",
      "required": true,
      "defaultValue": "sample-size",
      "options": [
        {
          "label": "Required sample size",
          "value": "sample-size"
        },
        {
          "label": "Margin of error",
          "value": "margin-error"
        }
      ],
      "width": "full"
    },
    {
      "id": "confidenceLevel",
      "label": "Confidence level",
      "type": "select",
      "required": true,
      "defaultValue": 95,
      "options": [
        {
          "label": "80%",
          "value": 80
        },
        {
          "label": "85%",
          "value": 85
        },
        {
          "label": "90%",
          "value": 90
        },
        {
          "label": "92%",
          "value": 92
        },
        {
          "label": "95%",
          "value": 95
        },
        {
          "label": "96%",
          "value": 96
        },
        {
          "label": "98%",
          "value": 98
        },
        {
          "label": "99%",
          "value": 99
        },
        {
          "label": "99.9%",
          "value": 99.9
        }
      ],
      "width": "half"
    },
    {
      "id": "populationProportion",
      "label": "Population proportion",
      "type": "percent",
      "required": true,
      "defaultValue": 50,
      "min": 0.0001,
      "max": 99.9999,
      "step": 0.01,
      "help": "Use 50% when the proportion is unknown.",
      "width": "half"
    },
    {
      "id": "populationSize",
      "label": "Population size (optional)",
      "type": "number",
      "min": 1,
      "step": 1,
      "placeholder": "Unlimited population",
      "width": "full"
    },
    {
      "id": "marginOfError",
      "label": "Desired margin of error",
      "type": "percent",
      "required": true,
      "defaultValue": 5,
      "min": 0.0001,
      "max": 99.9999,
      "step": 0.01,
      "showWhen": {
        "field": "calculation",
        "equals": "sample-size"
      },
      "width": "full"
    },
    {
      "id": "sampleSize",
      "label": "Observed sample size",
      "type": "number",
      "required": true,
      "defaultValue": 385,
      "min": 1,
      "step": 1,
      "showWhen": {
        "field": "calculation",
        "equals": "margin-error"
      },
      "width": "full"
    }
  ],
  "outputs": [
    {
      "id": "requiredSampleSize",
      "label": "Required sample size",
      "format": "integer",
      "primary": true
    },
    {
      "id": "marginOfErrorResult",
      "label": "Margin of error",
      "format": "percent",
      "primary": false,
      "digits": 4
    },
    {
      "id": "confidenceInterval",
      "label": "Confidence interval",
      "format": "text"
    },
    {
      "id": "criticalZ",
      "label": "Critical z-score",
      "format": "number",
      "digits": 5
    },
    {
      "id": "finiteCorrection",
      "label": "Finite-population correction",
      "format": "number",
      "digits": 6
    }
  ],
  "formula": {
    "expression": "n₀=z²p(1−p)/e²; finite n=n₀/[1+(n₀−1)/N]; e=z√[p(1−p)/n] with finite correction."
  },
  "examples": [
    {
      "label": "Reproducible default-input example (not a personal recommendation)",
      "inputs": {
        "calculation": "sample-size",
        "confidenceLevel": 95,
        "populationProportion": 50,
        "marginOfError": 5,
        "sampleSize": 385
      }
    }
  ],
  "sources": [
    {
      "label": "Calculator.net reference calculator",
      "url": "https://www.calculator.net/sample-size-calculator.html"
    }
  ]
}
