Mean absolute deviation calculator
For 2, 4, 4, 4, 5, 5, 7 and 9 the mean is 5 and the mean absolute deviation is 1.5: the distances from the mean add up to 12, and 12 divided by 8 values is 1.5. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
This mean absolute deviation calculator measures how far typical values sit from the center of a finite list of numbers by averaging the absolute differences from the arithmetic mean. You get the count n, the mean μ, the raw sum, the sum of absolute deviations, the MAD itself, plus the observed minimum and maximum and a short formula string. A classic check is the eight-value series two, four, four, four, five, five, seven, nine: the mean is five and the mean absolute deviation is one and a half, because the absolute residuals sum to twelve and twelve divided by eight is one point five. The engine uses a deterministic two-pass algorithm only: no network calls, no random sampling, and no date-dependent shortcuts.
What the mean absolute deviation tells you
Mean absolute deviation answers how far typical observations sit from the center of a data set without squaring residuals. After the arithmetic mean is known, each observation contributes the absolute value of its residual; averaging those absolute residuals produces the MAD, which lives in the same units as the original measurements and is less sensitive to extreme outliers than variance or standard deviation.
This calculator always returns a full univariate summary alongside the MAD: n, mean, sum, sum of absolute deviations, mad, min, max, a short formula string naming MAD equals the average of absolute deviations from μ, 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 absolute deviation fits in study, science, and product work
Students meet mean absolute deviation when a textbook introduces spread before variance, when a lab report asks for average absolute error about the mean, or when they need a clean check against a calculator that only exposes standard deviation. Teachers can pre-generate answer keys for modest series without trusting opaque apps that round intermediate absolute residuals differently or confuse MAD about the mean with median absolute deviation about the median.
Developers call the same contract from scripts to seed deterministic test vectors, to validate feature pipelines that normalize by average absolute residual, or to satisfy data-quality gates that reject columns whose MAD collapses to zero when variation is expected. Analysts prefer MAD when the series may contain heavy tails and a linear measure of typical distance is easier to explain to stakeholders than σ.
Product and operations teams watch MAD 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 standard-deviation calculator when you need both quadratic and 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 mean for textbook series and repeated measurement labs with mean, SAD, and MAD shown.
Robust spread monitoring
Track MAD of latency, basket size, or error rates for a linear, outlier-softer alternative to standard deviation.
FAQ
What does the mean absolute deviation calculator cost?
It is free in your browser on this page.
How is mean absolute deviation defined here?
MAD is the average of absolute residuals from the arithmetic mean: (Σ |xᵢ − μ|) / n. The response also returns the intermediate sum of absolute deviations.
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 median absolute deviation?
No. This tool measures absolute deviations about the arithmetic mean. Median absolute deviation about the median is a different statistic.
Why use mean absolute deviation instead of standard deviation?
It averages plain distances rather than squared ones, so the result stays in the units of your data and a single extreme value pulls it less than it pulls the variance or the standard deviation.
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-absolute-deviation \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"values":[2,4,4,4,5,5,7,9]}'const res = await fetch("https://api.kit.forhosting.com/stat/mean-absolute-deviation", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"values": [
2,
4,
4,
4,
5,
5,
7,
9
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/mean-absolute-deviation",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"values": [
2,
4,
4,
4,
5,
5,
7,
9
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/mean-absolute-deviation", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"values":[2,4,4,4,5,5,7,9]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"values":[2,4,4,4,5,5,7,9]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/mean-absolute-deviation", 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": [
2,
4,
4,
4,
5,
5,
7,
9
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.mean_absolute_deviation",
"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 absolute deviation 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 two-pass 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 two-pass 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 two-pass method: first sum and mean, then sum of absolute deviations from that mean, then MAD as that sum divided 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 mean. Absolute residuals avoid the squared-outlier amplification that standard deviation introduces, which is why MAD is popular in introductory statistics, robust exploratory analysis, and quality-control charts that prefer linear distance over quadratic distance. 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 absolute-deviation averaging yourself.
Where mean absolute deviation 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 mean and MAD 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.