{
  "id": "outlier",
  "version": "6bc79a4be36c",
  "status": "published",
  "name": "Outlier Calculator",
  "question": "Are there any outliers in my data?",
  "summary": "Finds outliers in a list of numbers with the IQR fences: values beyond Q1 − 1.5 IQR or Q3 + 1.5 IQR are mild outliers, and beyond 3 IQR extreme outliers, as the NIST/SEMATECH e-Handbook defines them.",
  "category": "statistics",
  "subcategory": "descriptive",
  "url": "https://www.acalculator.org/statistics/outlier-calculator",
  "markdown": "https://www.acalculator.org/statistics/outlier-calculator.md",
  "kind": "function",
  "method": "IQR = Q3 − Q1; inner fences Q1 − 1.5 IQR and Q3 + 1.5 IQR; outer fences Q1 − 3 IQR and Q3 + 3 IQR. Beyond an inner fence is a mild outlier, beyond an outer fence an extreme outlier.",
  "assumptions": [
    "A value exactly on a fence is not an outlier.",
    "Quartiles follow the chosen method; NIST’s is the default.",
    "The numbers are compared as the exact decimals typed."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "data": {
        "title": "Your numbers",
        "description": "The numbers, separated by commas, spaces, semicolons, or new lines.",
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "method": {
        "title": "Quartile method",
        "description": "How Q1 and Q3 are found. NIST uses position (N + 1)p.",
        "type": "string",
        "enum": [
          "nist",
          "inclusive",
          "halves"
        ]
      }
    }
  },
  "outputs": {
    "verdict": {
      "label": "Outliers",
      "description": "How many outliers there are, mild and extreme.",
      "format": "text"
    },
    "mild": {
      "label": "Mild outliers",
      "description": "Values beyond an inner fence but not an outer fence.",
      "format": "text"
    },
    "extreme": {
      "label": "Extreme outliers",
      "description": "Values beyond an outer fence.",
      "format": "text"
    },
    "q1": {
      "label": "Q1",
      "description": "The first quartile (25th percentile).",
      "format": "number"
    },
    "q3": {
      "label": "Q3",
      "description": "The third quartile (75th percentile).",
      "format": "number"
    },
    "iqr": {
      "label": "IQR",
      "description": "The interquartile range, Q3 − Q1.",
      "format": "number"
    },
    "lowerInner": {
      "label": "Lower inner fence",
      "description": "Q1 − 1.5 × IQR.",
      "format": "number"
    },
    "upperInner": {
      "label": "Upper inner fence",
      "description": "Q3 + 1.5 × IQR.",
      "format": "number"
    },
    "lowerOuter": {
      "label": "Lower outer fence",
      "description": "Q1 − 3 × IQR.",
      "format": "number"
    },
    "upperOuter": {
      "label": "Upper outer fence",
      "description": "Q3 + 3 × IQR.",
      "format": "number"
    },
    "kept": {
      "label": "Without outliers",
      "description": "The values inside the inner fences, smallest first.",
      "format": "text"
    },
    "min": {
      "label": "Smallest value",
      "description": "The smallest number.",
      "format": "number"
    },
    "median": {
      "label": "Median",
      "description": "The middle value.",
      "format": "number"
    },
    "max": {
      "label": "Largest value",
      "description": "The largest number.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "data": "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 25, 60",
      "method": "nist"
    },
    "outputs": {
      "verdict": "2 outliers: 1 mild, 1 extreme",
      "mild": "25",
      "extreme": "60",
      "q1": 3.25,
      "q3": 9.75,
      "iqr": 6.5,
      "lowerInner": -6.5,
      "upperInner": 19.5,
      "lowerOuter": -16.25,
      "upperOuter": 29.25,
      "kept": "1, 2, 3, 4, 5, 6, 7, 8, 9, 10",
      "min": 1,
      "median": 6.5,
      "max": 60
    },
    "text": "Outlier check: 2 outliers: 1 mild, 1 extreme."
  },
  "examples": [
    {
      "given": {
        "data": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          25,
          60
        ],
        "method": "nist"
      },
      "expect": {
        "q1": 3.25,
        "q3": 9.75,
        "iqr": 6.5,
        "upperInner": 19.5,
        "upperOuter": 29.25,
        "mild": "25",
        "extreme": "60",
        "verdict": "2 outliers: 1 mild, 1 extreme"
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §7.1.6 What are outliers in the data? (inner fences Q1 − 1.5 IQ and Q3 + 1.5 IQ, outer fences Q1 − 3 IQ and Q3 + 3 IQ; beyond an inner fence is a mild outlier, beyond an outer fence an extreme outlier), https://www.itl.nist.gov/div898/handbook/prc/section1/prc16.htm (retrieved 2026-10-02); NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.6.2 Percentiles (p(N + 1) = k + d; Y(p) = Y[k] + d(Y[k+1] − Y[k]); the minimum for k = 0 and the maximum for k ≥ N), https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm (retrieved 2026-10-02); hand calculation in content.mdx: positions 13 × 0.25 = 3.25 and 13 × 0.75 = 9.75; 9.75 + 1.5 × 6.5 = 19.5; 9.75 + 3 × 6.5 = 29.25"
    },
    {
      "given": {
        "data": [
          10,
          20,
          30,
          40,
          50,
          60,
          70,
          80,
          90,
          1000
        ],
        "method": "nist"
      },
      "expect": {
        "q1": 27.5,
        "q3": 82.5,
        "lowerInner": -55,
        "upperInner": 165,
        "upperOuter": 247.5,
        "extreme": "1000",
        "mild": "None"
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §7.1.6 What are outliers in the data? (inner fences Q1 − 1.5 IQ and Q3 + 1.5 IQ, outer fences Q1 − 3 IQ and Q3 + 3 IQ; beyond an inner fence is a mild outlier, beyond an outer fence an extreme outlier), https://www.itl.nist.gov/div898/handbook/prc/section1/prc16.htm (retrieved 2026-10-02); NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.6.2 Percentiles (p(N + 1) = k + d; Y(p) = Y[k] + d(Y[k+1] − Y[k]); the minimum for k = 0 and the maximum for k ≥ N), https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm (retrieved 2026-10-02); hand calculation in content.mdx: positions 2.75 and 8.25 give 27.5 and 82.5; IQR 55; 82.5 + 165 = 247.5"
    },
    {
      "given": {
        "data": [
          10,
          20,
          30,
          40,
          50,
          60,
          70,
          80,
          90,
          1000
        ],
        "method": "halves"
      },
      "expect": {
        "q1": 30,
        "q3": 80,
        "iqr": 50,
        "upperInner": 155,
        "upperOuter": 230,
        "verdict": "1 outlier: 0 mild, 1 extreme"
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §7.1.6 What are outliers in the data? (inner fences Q1 − 1.5 IQ and Q3 + 1.5 IQ, outer fences Q1 − 3 IQ and Q3 + 3 IQ; beyond an inner fence is a mild outlier, beyond an outer fence an extreme outlier), https://www.itl.nist.gov/div898/handbook/prc/section1/prc16.htm (retrieved 2026-10-02); hand calculation in content.mdx: halves 10–50 and 60–1000 have medians 30 and 80; 80 + 3 × 50 = 230"
    },
    {
      "given": {
        "data": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          25,
          60
        ],
        "method": "inclusive"
      },
      "expect": {
        "q1": 3.75,
        "q3": 9.25,
        "upperInner": 17.5,
        "upperOuter": 25.75,
        "mild": "25",
        "extreme": "60"
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.6.2 Percentiles (p(N + 1) = k + d; Y(p) = Y[k] + d(Y[k+1] − Y[k]); the minimum for k = 0 and the maximum for k ≥ N), https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm (retrieved 2026-10-02); hand calculation in content.mdx: positions 1 + 11 × 0.25 = 3.75 and 9.25; 9.25 + 1.5 × 5.5 = 17.5; 9.25 + 3 × 5.5 = 25.75; Python 3 statistics.quantiles(method=\"inclusive\")"
    }
  ],
  "sources": [
    "NIST/SEMATECH e-Handbook of Statistical Methods, §7.1.6 What are outliers in the data? (lower and upper quartiles Q1 and Q3, the 25th and 75th percentiles; IQ = Q3 − Q1; lower inner fence Q1 − 1.5 IQ, upper inner fence Q3 + 1.5 IQ, lower outer fence Q1 − 3 IQ, upper outer fence Q3 + 3 IQ; a point beyond an inner fence is a mild outlier, beyond an outer fence an extreme outlier). https://www.itl.nist.gov/div898/handbook/prc/section1/prc16.htm (retrieved 2026-10-02)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.6.2 Percentiles (set p(N + 1) = k + d; Y(p) = Y[k] + d(Y[k+1] − Y[k]) for 0 < k < N; Y[1] for k = 0 and Y[N] for k ≥ N). https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm (retrieved 2026-10-02)"
  ],
  "related": [
    "quartile",
    "standard-deviation",
    "z-score",
    "mean-median-mode"
  ],
  "changelog": []
}
