Mean Absolute Deviation Calculator: MAD About the Mean or the Median
By FindMySum · Last reviewed
A mean absolute deviation calculator tells you how far, on average, the values in a data set are from their centre. It is the most direct answer to the question "how spread out is this data?": subtract the centre from every value, ignore the signs, and average the distances. This calculator works out the MAD about the mean (the usual version, and what Excel's AVEDEV returns) or about the median, lists every distance in a table, draws each one on a number line, and shows the population standard deviation next to it for comparison.
The formula
For n values x₁, x₂, …, xₙ and a centre c:
MAD = (|x₁ − c| + |x₂ − c| + … + |xₙ − c|) ÷ n
The centre is usually the mean, x̄ = Σx ÷ n. It can also be the median, the middle value once the list is sorted (or the average of the two middle values when there is an even number of them).
The vertical bars mean "absolute value": the distance without its sign. Without them the deviations from the mean would always add to exactly zero, because the values above the mean balance the values below it. Taking absolute values is one way to stop that cancelling; squaring, as standard deviation does, is the other.
Worked example with the default data
The calculator opens with the data set from Microsoft's AVEDEV help page: 4, 5, 6, 7, 5, 4, 3.
- Mean. The values add to 34, and 34 ÷ 7 ≈ 4.857.
- Distances from the mean. |4 − 4.857| ≈ 0.857, |5 − 4.857| ≈ 0.143, |6 − 4.857| ≈ 1.143, |7 − 4.857| ≈ 2.143, then 0.143, 0.857 and 1.857.
- Sum of distances. These add up to about 7.143 (exactly 50/7).
- Divide by n. 7.143 ÷ 7 ≈ 1.0204.
Excel's AVEDEV gives 1.020408163 for the same data. In words: on average, a value in this set is about one unit away from the mean.
About the median instead: the sorted list is 3, 4, 4, 5, 5, 6, 7, so the median is 5. The distances are 1, 0, 1, 2, 0, 1 and 2, which add to 7, and 7 ÷ 7 = 1. It is slightly smaller than the MAD about the mean, as it always will be.
Mean or median: which centre?
The median has a special property: it is the value that makes the sum of absolute distances as small as possible. So for any data set,
MAD about the median ≤ MAD about the mean.
For symmetric data the two are equal or very close. They separate when the data are skewed or contain an outlier. Take 1, 2, 3, 4 and 100: the single large value drags the mean up to 22, far from the other four values, and the MAD about the mean is 31.2. The median stays at 3 and the MAD about it is 20.2, a better description of the typical gap for most of the values.
Use the mean when you are already reporting the mean and the data are roughly symmetric, as in most school and textbook exercises. Use the median when you report the median, or when outliers or a long tail are likely: incomes, house prices, response times.
MAD versus standard deviation
Both measure spread in the same units as the data, but they treat large deviations differently. Standard deviation squares each deviation, averages the squares and takes the square root, so one value far from the mean counts disproportionately. MAD treats a distance of 10 as exactly twice a distance of 5.
Two facts are worth knowing:
- The population standard deviation is always at least the MAD about the mean. They are equal only in special cases, such as data split evenly between two values.
- For data that follow a normal (bell-shaped) distribution, MAD ≈ 0.80 × standard deviation (the exact factor is √(2/π) ≈ 0.798). The calculator shows the ratio for your data; a ratio well below 0.8 points to heavy tails or outliers.
For the default data, the population standard deviation is about 1.245 and the MAD 1.020, a ratio of about 0.82, close to the normal benchmark.
Don't confuse it with the median absolute deviation
Statistics software often uses "MAD" for a different measure: the median absolute deviation, the median of |x − median|. It is even more resistant to outliers and is used to flag unusual values. This calculator gives the mean of the absolute deviations, which is the measure taught in middle-school and introductory statistics and computed by AVEDEV. If your course or software means the median version, check its definition before comparing numbers.
Reading your result
- MAD = 0 means every value is identical.
- Small MAD relative to the mean means the values are tightly clustered; a MAD of 2 on a mean of 100 is a 2% typical gap.
- Large MAD, or a big difference between the MAD about the mean and about the median, means wide spread or skew. Look at the number-line chart to see which values contribute the longest distances.
Limits
The calculator handles a plain list of numbers. It does not weight values, work from a frequency table or grouped classes, or compute the median absolute deviation. Results are calculated with exact decimal arithmetic and shown to 10 significant digits.
More questions
Should I divide by n or by n − 1 for the mean absolute deviation?
By n. Unlike the sample standard deviation, the mean absolute deviation has no standard n − 1 version: textbooks, Excel's AVEDEV and the NIST handbook all divide the sum of absolute deviations by the number of values. If a course or paper uses another divisor it will say so explicitly.
What units is the MAD in?
The same units as the data. If the values are heights in centimetres, the MAD is in centimetres; if they are prices in dollars, the MAD is in dollars. That makes it easy to read next to the mean: an average height of 170 cm with a MAD of 6 cm means a typical person is about 6 cm from the average.
How do I compare the spread of two data sets with different averages?
Divide each MAD by its mean to get a relative spread (sometimes called the coefficient of dispersion when the median is used). A MAD of 5 on a mean of 20 (25%) is a much wider spread than a MAD of 5 on a mean of 500 (1%). Only do this for data measured from a true zero, such as weights or prices, not temperatures in °C.
Does the order of the values matter?
No. The mean, the median and every distance depend only on the values, not on the order they are typed in. The breakdown table keeps your order so you can match each row to your data, but sorting the list would give the same MAD.
How is MAD used in forecasting?
Forecasters use a close cousin, the mean absolute error (also called MAD in operations textbooks): the average of |actual − forecast| over past periods. It is the same idea with the forecast in place of the mean. This calculator measures distances from the data's own mean or median, so for forecast errors average their absolute values directly instead.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.