Mean deviation about median calculator
For 1, 2, 3, 4 and 100 the median is 3 and the mean deviation about it is 20.2: the distances from the median add up to 101, and 101 divided by 5 is 20.2. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Values
- 1, 2, 3, 4, 100
- N
- 5
- Median
- 3
- Sum
- 110
- Sum absolute deviations
- 101
This mean deviation about median calculator measures how far typical values sit from the center of a finite list of numbers by averaging the absolute differences from the sample median rather than from the arithmetic mean. You get the count n, the median, the raw sum, the sum of absolute deviations, the MAD itself, plus the observed minimum and maximum and a short formula string. A clear check is the five-value series one, two, three, four, one hundred: the median is three and the mean absolute deviation about that median is twenty point two, because the absolute residuals sum to one hundred one and one hundred one divided by five is twenty point two. Using the median as the reference point makes the measure more resistant to a single extreme outlier than the same average taken about the mean. The engine uses a deterministic sort-and-average algorithm only: no network calls, no random sampling, and no date-dependent shortcuts.
What the mean deviation about the median shows
Mean absolute deviation about the median answers how far typical observations sit from a robust center of a data set without squaring residuals and without letting a skewed tail drag the reference point the way the arithmetic mean can.
After the sample median is known, each observation contributes the absolute value of its residual from that median; averaging those absolute residuals produces the MAD about the median, which lives in the same units as the original measurements and is often preferred when the series may contain heavy tails or a single extreme value.
This calculator always returns a full univariate summary alongside the MAD: n, median, sum, sum of absolute deviations, mad, min, max, a short formula string naming MAD equals the average of absolute deviations from the median, and the published maximum length so clients can validate before they send a batch. A single finite value is valid and yields MAD zero because the only residual is zero.
Where mean deviation about the median fits in study, science, and product work
Students meet mean absolute deviation about the median when a textbook contrasts robust and classical measures of center, when a lab report asks for average absolute error about a resistant center, or when they need a clean check against a calculator that only exposes standard deviation or MAD about the mean. Teachers can pre-generate answer keys for modest series without trusting opaque apps that round intermediate absolute residuals differently or confuse MAD about the median with median absolute deviation (the median of absolute residuals, a different statistic).
Developers call the same contract from scripts to seed deterministic test vectors, to validate feature pipelines that normalize by average absolute residual from a robust center, or to satisfy data-quality gates that reject columns whose MAD collapses to zero when variation is expected. Analysts prefer this form when the series may contain heavy tails and a linear measure of typical distance from the median is easier to explain to stakeholders than σ or MAD about a mean pulled by outliers.
Product and operations teams watch MAD about the median of latency, basket size, or error counts to spot regressions that averages alone would mask, without the same outlier sensitivity as sample standard deviation. Pair it with the mean-absolute-deviation calculator when you need both mean-centered and median-centered absolute measures of spread, and with CSV profiling when you need multi-column summaries rather than a single numeric series.
What you can do with it
Homework and lab checks
Verify mean absolute deviation about the median for textbook series and labs with median, SAD, and MAD shown side by side.
Robust spread monitoring
Track average absolute residual from the median for latency, basket size, or error rates when outliers would warp a mean-based MAD.
FAQ
What does the mean deviation about median calculator cost?
It is free in your browser on this page.
How is mean deviation about the median defined here?
MAD is the average of absolute residuals from the sample median: (Σ |xᵢ − median|) / n. For even n the median is the average of the two middle order statistics.
What happens if the list is empty?
You must provide at least one finite number; a single value yields MAD zero.
Is this the same as mean absolute deviation about the mean?
No. This tool measures absolute deviations about the sample median. MAD about the arithmetic mean is a different statistic with a different SEO landing.
How is the median found when the list has an even number of values?
The values are sorted and the two middle ones are averaged; with an odd count, the middle value itself is the median. Every distance is then measured from that point.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/stat/mean-deviation-median \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"values":[1,2,3,4,100]}'const res = await fetch("https://api.kit.forhosting.com/stat/mean-deviation-median", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"values": [
1,
2,
3,
4,
100
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/mean-deviation-median",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"values": [
1,
2,
3,
4,
100
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/mean-deviation-median", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"values":[1,2,3,4,100]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"values":[1,2,3,4,100]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/mean-deviation-median", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"values": [
1,
2,
3,
4,
100
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.mean_deviation_median",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_n | 10000 |
max_abs | 1000000000000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Empty lists are rejected with invalid_input.
What mean deviation about the median measures and what the response contains
There is no approximate Monte Carlo path presented as truth and no silent coercion of text labels into zeros: the engine either finishes the sort-and-average arithmetic inside the supported length and magnitude limits or rejects the input with invalid_input. Rejected cases include a missing values field, an empty list, non-finite entries such as Infinity or NaN, non-numeric tokens, and arrays longer than the published maximum.
How values are read and how the median-based algorithm stays stable
Each element is parsed as a finite decimal; optional leading signs and scientific notation are allowed, while empty tokens, bare letters, and non-numeric objects fail with a field index in the message so a bad cell does not become a silent zero. Computation is the classic median-then-average-absolute-deviation method: sort a copy of the series, take the middle value when n is odd or the average of the two middle values when n is even, then sum absolute residuals from that median and divide by n. Returning the intermediate sum of absolute deviations alongside the MAD lets teachers and developers check the arithmetic by hand without re-deriving the order statistics. Absolute residuals avoid the squared-outlier amplification that standard deviation introduces, and anchoring at the median rather than the mean further softens the influence of extreme points on both the center and the reported spread. The preferred field is values, an array of finite numbers, but aliases data, numbers, x, and series are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. A single comma-separated or whitespace-separated string of numbers is also accepted when a form posts plain text instead of JSON arrays. The engine enforces a hard maximum of ten thousand points and a per-value magnitude ceiling so memory and latency stay inside a predictable budget on the free browser path and on the edge Worker. Pair the free browser run on this page with the priced API when you need the identical descriptive result inside an automated pipeline without re-implementing median absolute-deviation averaging yourself.
Where mean deviation about the median fits in study, science, and product work
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result.
Integration use cases
Deterministic CI fixtures
Generate reproducible median and MAD-about-median values for unit tests and data-quality gates without hand-maintaining tables.
Technical questions
Can I send a comma-separated string instead of a JSON array?
Yes. The values field accepts an array of numbers or a single string of numbers separated by commas, spaces, or semicolons.