Median absolute deviation measures how far the values in a data set typically sit from its median. This median absolute deviation calculator finds the raw MAD and the scaled MAD from raw data or a frequency table, and it lists every absolute deviation so you can see where the spread comes from. The MAD calculator also computes robust Z-scores and flags potential outliers against a threshold you can adjust, with each calculation step shown.
Median absolute deviation formula
Median absolute deviation takes two medians: one of the data set and one of the distances from it. The median and absolute deviation work as a pair, with the median setting the center and each absolute deviation measuring a value's distance from that center. The calculator follows the four formulas below in this order.
Dataset median
M = Median(x1, x2, ..., xn)
Absolute deviation
di = |xi − M|
Median absolute deviation
MAD = Median(|xi − M|)
Scaled MAD
Scaled MAD = 1.4826 × MAD
Here M is the median of the data set, xi is the i-th observation, n is the number of observations and di is the absolute deviation of xi from M. When n is even, M is the average of the two central values, and the same rule applies when taking the median of the deviations. The constant 1.4826 puts MAD on the scale of a standard deviation for roughly normal data, as the scaled MAD section below explains.
How to calculate median absolute deviation
This median absolute deviation example uses the calculator's demo data: 1, 2, 3, 4, 5, 6, 7, 8, 9, 100. To find median absolute deviation by hand, work through the six steps below.
- Sort the data in ascending order. The demo values are already in order, and n = 10. The calculator sorts internally and keeps your original order in its table.
- Find the median. With 10 values it is the average of the 5th and 6th: M = (5 + 6) / 2 = 5.5.
- Subtract the median from each value and drop the sign: 4.5, 3.5, 2.5, 1.5, 0.5, 0.5, 1.5, 2.5, 3.5 and 94.5.
- Sort the absolute deviations: 0.5, 0.5, 1.5, 1.5, 2.5, 2.5, 3.5, 3.5, 4.5, 94.5.
- Find the median of those deviations, the average of the 5th and 6th: (2.5 + 2.5) / 2 = 2.5. This is the MAD.
- Multiply by 1.4826 to get the scaled MAD: 1.4826 × 2.5 = 3.7065.
| x | x − M (M = 5.5) | |x − M| |
|---|---|---|
| 1 | −4.5 | 4.5 |
| 2 | −3.5 | 3.5 |
| 3 | −2.5 | 2.5 |
| 4 | −1.5 | 1.5 |
| 5 | −0.5 | 0.5 |
| 6 | 0.5 | 0.5 |
| 7 | 1.5 | 1.5 |
| 8 | 2.5 | 2.5 |
| 9 | 3.5 | 3.5 |
| 100 | 94.5 | 94.5 |
Entering the same values in the calculator returns a MAD of 2.5 and a scaled MAD of 3.7065. The value 100 sits 94.5 from the median, but it only lands at the end of the sorted deviations, so its size does not change the MAD.
What is absolute deviation?
Absolute deviation is the distance between an observation and the median of the data set, with direction ignored. On this page the center is always the median. Its formula is |xi − M|: subtract the median from the value and keep the result without its sign. Individual absolute deviations cannot be negative, and a value equal to the median has an absolute deviation of 0.
That gives the definition of median absolute deviation. In math, it is the median of the absolute deviations of a data set's values from the data set's median.
Scaled MAD and outlier detection
Raw MAD and scaled MAD
Raw MAD is the median of the absolute deviations and stays in the units of the data. Scaled MAD multiplies it by 1.4826. The calculator reports both, so you can use the raw value as the plain median distance and the scaled value where you want a spread on the scale of a standard deviation.
Why 1.4826 is used
In a normal distribution, MAD is a fixed fraction of the standard deviation. Multiplying by 1.4826 undoes that fraction, so the scaled MAD estimates the standard deviation when the data are close to normal. The assumption matters. For skewed or heavy-tailed data the scaled MAD does not equal the standard deviation, and it should be read as a robust spread measure on its own.
Robust Z-scores and potential outliers
A robust Z-score swaps the mean and standard deviation of the usual Z-score for the median and the scaled MAD:
Robust Z = (xi − M) / (1.4826 × MAD)
The score is positive above the median and negative below it. The calculator flags an observation when the absolute value of its robust Z-score is greater than the threshold you set. In the demo data, 100 has a robust Z of 25.4958 and is flagged, while 1 has a robust Z of −1.2141 and is not. One of the ten values is flagged, which is 10%.
A flag is a screening aid and does not prove a value is wrong. A flagged value can be a typing error, a measurement from a different population or a genuine extreme, so check it before changing or removing anything. No threshold suits every data set, which is why the cutoff is adjustable.
When MAD is zero
If MAD is 0, the robust Z-score would divide by zero and is undefined. The calculator then shows a warning, leaves the robust Z column empty and flags nothing. This happens when many values are tied at the median.
Median absolute deviation vs mean absolute deviation
Both measures are abbreviated MAD, and they are not interchangeable. Median absolute deviation takes the median of the distances from the median. Mean absolute deviation averages the distances from the arithmetic mean, so an extreme value affects it twice: it pulls the mean toward itself and adds a large distance of its own. For the demo data the mean is 14.5 and the mean absolute deviation is 17.1, against a median absolute deviation of 2.5. You can calculate the mean version with the mean absolute deviation calculator. For the spread measure most courses teach first, see the standard deviation calculator.