{
  "id": "box-plot",
  "version": "2a7364ee3ba8",
  "status": "published",
  "name": "Box Plot Calculator",
  "question": "What does my box plot look like?",
  "summary": "Draws a box plot of a list of numbers and gives its five-number summary, IQR, whisker ends and outliers, by the quartile method you choose.",
  "category": "statistics",
  "subcategory": "descriptive",
  "url": "https://www.acalculator.org/statistics/box-plot-calculator",
  "markdown": "https://www.acalculator.org/statistics/box-plot-calculator.md",
  "kind": "function",
  "method": "Sort the numbers; the median is the middle value; Q1 and Q3 follow the chosen method; the box runs from Q1 to Q3; the whiskers run to the minimum and maximum, or to the last values inside Q1 − 1.5 × IQR and Q3 + 1.5 × IQR.",
  "assumptions": [
    "The default method (median of halves, median left out) matches the quartile calculator and OpenStax.",
    "With one number, every value of the summary is that number.",
    "A value exactly on a fence is not an outlier."
  ],
  "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. The methods agree on the median but can differ on Q1 and Q3.",
        "type": "string",
        "enum": [
          "moore-mccabe",
          "tukey",
          "inclusive",
          "exclusive"
        ]
      },
      "whiskers": {
        "title": "Whiskers",
        "description": "Whiskers to the minimum and maximum, or to the last values inside the 1.5 × IQR fences.",
        "type": "string",
        "enum": [
          "minmax",
          "fences"
        ]
      }
    }
  },
  "outputs": {
    "summary": {
      "label": "Five-number summary",
      "description": "The minimum, Q1, median, Q3 and maximum, in that order.",
      "format": "text"
    },
    "min": {
      "label": "Minimum",
      "description": "The smallest number in the list.",
      "format": "number"
    },
    "q1": {
      "label": "First quartile (Q1)",
      "description": "The 25th percentile by the chosen method.",
      "format": "number"
    },
    "median": {
      "label": "Median",
      "description": "The middle value.",
      "format": "number"
    },
    "q3": {
      "label": "Third quartile (Q3)",
      "description": "The 75th percentile by the chosen method.",
      "format": "number"
    },
    "max": {
      "label": "Maximum",
      "description": "The largest number in the list.",
      "format": "number"
    },
    "iqr": {
      "label": "Interquartile range (IQR)",
      "description": "Q3 minus Q1: the width of the box.",
      "format": "number"
    },
    "lowWhisker": {
      "label": "Lower whisker end",
      "description": "Where the lower whisker stops.",
      "format": "number"
    },
    "highWhisker": {
      "label": "Upper whisker end",
      "description": "Where the upper whisker stops.",
      "format": "number"
    },
    "outliers": {
      "label": "Outliers",
      "description": "Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR, smallest first, or None.",
      "format": "text"
    },
    "n": {
      "label": "Count (n)",
      "description": "How many numbers are in the list.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "data": "1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5",
      "method": "moore-mccabe",
      "whiskers": "minmax"
    },
    "outputs": {
      "summary": "1, 2, 7, 9, 11.5",
      "min": 1,
      "q1": 2,
      "median": 7,
      "q3": 9,
      "max": 11.5,
      "iqr": 7,
      "lowWhisker": 1,
      "highWhisker": 11.5,
      "outliers": "None",
      "n": 14
    },
    "text": "The five-number summary of the 14 numbers is 1, 2, 7, 9, 11.5, and the IQR is 7."
  },
  "examples": [
    {
      "given": {
        "data": [
          1,
          1,
          2,
          2,
          4,
          6,
          6.8,
          7.2,
          8,
          8.3,
          9,
          10,
          10,
          11.5
        ],
        "method": "moore-mccabe",
        "whiskers": "minmax"
      },
      "expect": {
        "summary": "1, 2, 7, 9, 11.5",
        "q1": 2,
        "median": 7,
        "q3": 9,
        "iqr": 7,
        "lowWhisker": 1,
        "highWhisker": 11.5,
        "outliers": "None"
      },
      "source": "OpenStax, Introductory Statistics 2e, §2.4 Box Plots (minimum, Q1, median, Q3, maximum; 1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5 gives 1, 2, 7, 9, 11.5), https://openstax.org/books/introductory-statistics-2e/pages/2-4-box-plots (retrieved 2026-10-05); hand calculation in content.mdx: halves 1–6.8 and 7.2–11.5 have medians 2 and 9; median (6.8 + 7.2) ÷ 2 = 7"
    },
    {
      "given": {
        "data": [
          10,
          20,
          30,
          40,
          50,
          60,
          70,
          80,
          90,
          1000
        ],
        "method": "moore-mccabe",
        "whiskers": "fences"
      },
      "expect": {
        "summary": "10, 30, 55, 80, 1000",
        "iqr": 50,
        "lowWhisker": 10,
        "highWhisker": 90,
        "outliers": "1000"
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §7.1.6 What are outliers in the data? (fences Q1 − 1.5 IQ and Q3 + 1.5 IQ), https://www.itl.nist.gov/div898/handbook/prc/section1/prc16.htm (retrieved 2026-10-05); OpenStax, Introductory Statistics 2e, §2.4 Box Plots (minimum, Q1, median, Q3, maximum; 1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5 gives 1, 2, 7, 9, 11.5), https://openstax.org/books/introductory-statistics-2e/pages/2-4-box-plots (retrieved 2026-10-05); hand calculation in content.mdx: Q1 = 30, Q3 = 80, upper fence 80 + 75 = 155, so 1000 is an outlier and the whisker stops at 90"
    },
    {
      "given": {
        "data": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10
        ],
        "method": "inclusive",
        "whiskers": "minmax"
      },
      "expect": {
        "summary": "1, 3.25, 5.5, 7.75, 10",
        "iqr": 4.5
      },
      "source": "OpenStax, Introductory Statistics 2e, §2.4 Box Plots (minimum, Q1, median, Q3, maximum; 1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5 gives 1, 2, 7, 9, 11.5), https://openstax.org/books/introductory-statistics-2e/pages/2-4-box-plots (retrieved 2026-10-05); hand calculation in content.mdx: positions 1 + 9 × 0.25 = 3.25 and 7.75; Python 3: statistics.quantiles(method=\"inclusive\")"
    },
    {
      "given": {
        "data": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10
        ],
        "method": "exclusive",
        "whiskers": "minmax"
      },
      "expect": {
        "summary": "1, 2.75, 5.5, 8.25, 10",
        "iqr": 5.5
      },
      "source": "OpenStax, Introductory Statistics 2e, §2.4 Box Plots (minimum, Q1, median, Q3, maximum; 1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5 gives 1, 2, 7, 9, 11.5), https://openstax.org/books/introductory-statistics-2e/pages/2-4-box-plots (retrieved 2026-10-05); hand calculation in content.mdx: positions 11 × 0.25 = 2.75 and 8.25; Python 3: statistics.quantiles(method=\"exclusive\")"
    },
    {
      "given": {
        "data": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9
        ],
        "method": "tukey",
        "whiskers": "minmax"
      },
      "expect": {
        "summary": "1, 3, 5, 7, 9",
        "iqr": 4
      },
      "source": "OpenStax, Introductory Statistics 2e, §2.4 Box Plots (minimum, Q1, median, Q3, maximum; 1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5 gives 1, 2, 7, 9, 11.5), https://openstax.org/books/introductory-statistics-2e/pages/2-4-box-plots (retrieved 2026-10-05); hand calculation in content.mdx: Tukey’s hinges keep the median in both halves, 1–5 and 5–9"
    }
  ],
  "sources": [
    "OpenStax, Introductory Statistics 2e, §2.4 Box Plots: the five-number summary, the box from Q1 to Q3 holding the middle 50% of the data, and whiskers to the extreme values (or outliers as dots). https://openstax.org/books/introductory-statistics-2e/pages/2-4-box-plots (retrieved 2026-10-05)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §7.1.6 What are outliers in the data?: the fences Q1 − 1.5 × IQ and Q3 + 1.5 × IQ. https://www.itl.nist.gov/div898/handbook/prc/section1/prc16.htm (retrieved 2026-10-05)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.6.2 Percentiles: sample quantiles by linear interpolation. https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm (retrieved 2026-10-05)"
  ],
  "related": [
    "quartile",
    "outlier",
    "mean-median-mode"
  ],
  "changelog": []
}
