{
  "id": "mean-median-mode",
  "version": "c5554c3fe1ff",
  "status": "published",
  "name": "Mean, Median, Mode Calculator",
  "question": "What are the mean, median, mode?",
  "summary": "Computes the mean, median, and mode of a list of numbers, with the count, sum, smallest and largest value, and range.",
  "category": "statistics",
  "subcategory": "descriptive",
  "url": "https://www.acalculator.org/statistics/mean-median-mode-calculator",
  "markdown": "https://www.acalculator.org/statistics/mean-median-mode-calculator.md",
  "kind": "function",
  "method": "mean = sum ÷ count; median = the middle sorted value (the average of the two middle values for an even count); mode = the most frequent value or values.",
  "assumptions": [
    "Every number in the list counts once. The order of the list does not change any result.",
    "When no value occurs more than once there is no mode. When several values tie for most often, all of them are modes."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "input": {
        "title": "Your numbers",
        "description": "The numbers, separated by commas, spaces, semicolons, or new lines.",
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    }
  },
  "outputs": {
    "mean": {
      "label": "Mean",
      "description": "The average: the sum divided by how many numbers there are.",
      "format": "number"
    },
    "median": {
      "label": "Median",
      "description": "The middle value in sorted order; the average of the two middle values when the count is even.",
      "format": "number"
    },
    "mode": {
      "label": "Mode",
      "description": "The value or values that occur most often, or No mode when no value repeats.",
      "format": "text"
    },
    "modeFrequency": {
      "label": "Times the mode occurs",
      "description": "How many times each mode appears in the list. Shown only when there is a mode.",
      "format": "integer"
    },
    "count": {
      "label": "Count",
      "description": "How many numbers are in the list.",
      "format": "integer"
    },
    "sum": {
      "label": "Sum",
      "description": "All the numbers added up.",
      "format": "number"
    },
    "min": {
      "label": "Smallest",
      "description": "The smallest number in the list.",
      "format": "number"
    },
    "max": {
      "label": "Largest",
      "description": "The largest number in the list.",
      "format": "number"
    },
    "range": {
      "label": "Range",
      "description": "The largest number minus the smallest.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "input": "1, 2, 3, 4, 5, 5, 6, 6, 6, 6, 7, 8, 9"
    },
    "outputs": {
      "mean": 5.230769230769231,
      "median": 6,
      "mode": "6",
      "modeFrequency": 4,
      "count": 13,
      "sum": 68,
      "min": 1,
      "max": 9,
      "range": 8
    },
    "text": "For 1, 2, 3, 4, 5, 5, 6, 6, 6, 6, 7, 8, 9, the mean is 5.230769 and the median is 6 (mode: 6)."
  },
  "examples": [
    {
      "given": {
        "input": [
          1,
          2,
          3,
          4,
          5,
          5,
          6,
          6,
          6,
          6,
          7,
          8,
          9
        ]
      },
      "expect": {
        "mean": 5.230769230769231,
        "median": 6,
        "mode": "6",
        "modeFrequency": 4,
        "count": 13,
        "sum": 68,
        "min": 1,
        "max": 9,
        "range": 8
      },
      "source": "hand calculation in content.mdx: 68 ÷ 13 = 5.2307…; the 7th of 13 sorted values is 6; 6 occurs 4 times. Python statistics.mean, median, multimode agree; NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.1 Measures of Location (mean, median, mode). https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm"
    },
    {
      "given": {
        "input": [
          1,
          2,
          2,
          3,
          4
        ]
      },
      "expect": {
        "mean": 2.4,
        "median": 2,
        "mode": "2",
        "modeFrequency": 2
      },
      "source": "hand calculation in content.mdx: 12 ÷ 5 = 2.4; the middle of 5 values is 2; 2 occurs twice; NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.1 Measures of Location (mean, median, mode). https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm"
    },
    {
      "given": {
        "input": [
          1,
          2,
          3,
          4
        ]
      },
      "expect": {
        "mean": 2.5,
        "median": 2.5,
        "mode": "No mode",
        "range": 3
      },
      "source": "hand calculation in content.mdx: (2 + 3) ÷ 2 = 2.5; every value occurs once, so there is no mode; NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.1 Measures of Location (mean, median, mode). https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm"
    },
    {
      "given": {
        "input": [
          1,
          1,
          2,
          2,
          3
        ]
      },
      "expect": {
        "mean": 1.8,
        "median": 2,
        "mode": "1, 2",
        "modeFrequency": 2
      },
      "source": "hand calculation in content.mdx: 1 and 2 both occur twice, more than 3; Python statistics.multimode gives [1, 2]; NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.1 Measures of Location (mean, median, mode). https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm"
    }
  ],
  "sources": [
    "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.1 Measures of Location (mean, median, mode). https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm"
  ],
  "related": [],
  "changelog": [
    {
      "date": "2026-09-29",
      "note": "Worked examples name a published reference for their rule."
    },
    {
      "date": "2026-10-01",
      "note": "The answer sentence reads correctly with no mode or several modes."
    }
  ]
}
