ForHosting KIT · Math

Mean median mode calculator

For 1, 2, 2, 3 and 4 you get a mean of 2.4, a median of 2, a mode of 2 and a range of 3, all from one list and shown with the count, sum, minimum and maximum. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Numbers
1, 2, 2, 3, 4
You get
Quantity
5
Sum
12
Mean
2.4
Median
2

Mean, median, mode and range are the four summary numbers most people learn first in descriptive statistics. The mean is the arithmetic average, the median is the middle value after sorting, the mode is the most frequent value, and the range is the gap between the largest and smallest observation. This capability takes a non-empty list of finite numbers and returns all four measures together with count, sum, min, max and mode frequency in one deterministic call.

What mean, median, mode and range mean on a list of numbers

The mean divides the sum of every observation by the count n. It uses every value, so a single extreme outlier can pull it far from the bulk of the data; that sensitivity is useful when you care about total mass, and misleading when you want a typical case. The median is the middle entry of the sorted list when n is odd, or the average of the two central entries when n is even.

Because it depends only on order, half the values sit at or below it and half at or above it, which makes it robust to wild highs and lows. The mode is the value that appears most often.

When one number clearly dominates the frequency table, mode is that number; when several values share the same highest frequency greater than one, the list is multimodal and this calculator returns every such value; when every value appears once and n is greater than one, there is no mode and the modes array is empty. The range is simply maximum minus minimum.

Together these four numbers answer different questions: mean for average level, median for center under skew, mode for the most common category-like value even on numeric data, and range for spread at a glance. Classic classroom example: the list one, two, two, three, four has mean two point four, median two, mode two with frequency two, and range three. A single-element list has mean, median and mode equal to that element and range zero.

Always reject empty input rather than inventing zero averages from no data.

Quick sample summary in pipelines

Summarize sensor batches, quiz scores or experiment cells without installing a full stats library in every service.

Teaching demos of center versus spread

Show how outliers move the mean while median and mode stay put, using the same numbers live in class.

What happens if the list is empty?

There is no mean of nothing; failed validation is not charged.

How is the median defined for an even count?

After sorting, the median is the average of the two central values. For an odd count it is the single middle value.

What if every number appears only once?

When n > 1 and all frequencies are 1, there is no mode: modes is an empty array and mode is also empty. A single-element list treats that element as the mode.

Is the mean median mode calculator free?

The browser tool is free and runs locally.

What if two values tie as the most frequent?

The list is multimodal, and the calculator returns every value that shares the highest frequency, as long as that frequency is greater than one. You see all the modes, not just one of them.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/mean-median-mode

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/mean-median-mode \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"numbers":[1,2,2,3,4]}'
{
  "numbers": [
    1,
    2,
    2,
    3,
    4
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.mean_median_mode",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Empty lists are rejected with invalid_input and are never charged.

How to call the API and what comes back

Numeric strings inside the array are coerced; a comma or whitespace separated string is also accepted for simple text forms. Use it from homework checkers, spreadsheet enrichment, sensor sample summaries, A-B experiment dashboards that need a quick center and spread, or any workflow that wants mean median mode and range without installing a statistics package on every machine. Send a JSON body with one required field named numbers: a non-empty array of finite numbers. Aliases values, data and list are accepted and behave the same. On success the response includes count as n, numbers as the ascending sorted copy used for the median, sum of all values, mean equal to sum over n, median as defined above, mode as a single number when unimodal or an array when multimodal or empty when there is no mode, modes as the full array of modal values, mode_frequency as the highest frequency, min, max and range equal to max minus min. Failed validation—missing numbers, an empty list, non-finite entries, or a list longer than one hundred thousand values—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

When teaching, pair a unimodal example such as one two two three four with an all-unique example such as one two three four five to show empty modes, and an even-length list such as one two three four to show the averaged median of two point five. Prefer median over mean when the sample is skewed or contaminated by outliers; prefer mean when totals matter; prefer mode when you care about the most common discrete reading. Sibling capabilities in this kit may profile whole CSV files column by column; this page is specifically for people searching for a mean median mode calculator on a plain list of numbers, not a multi-column exploratory profile. Keep lists within the published size cap so interactive Worker and browser paths stay fast; one hundred thousand finite numbers is ample for classroom sets and most operational samples. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap while students type empty arrays by mistake. Prefer sending the raw list once and reading all four measures from one response instead of calling four separate tools: one contract, one charge unit, identical results in browser and API.

Homework and exam answer keys

Give students a short numeric sample; check their hand-computed mean, median, mode and range against a deterministic browser or API result.

What does this mean median mode calculator return?

For a non-empty list it returns count, sorted numbers, sum, mean, median, mode (and modes array), mode_frequency, min, max and range (max − min).

Read the full KIT documentation →