Median Absolute Deviation Calculator

Median Absolute Deviation Calculator

Find the median absolute deviation (MAD), a measure of spread that outliers can barely move, plus a robust estimate of the standard deviation and modified z-scores that flag outliers.

MAD = median(|x − median|) · robust σ ≈ 1.4826 × MAD

Enter at least two numbers to find the MAD

What is the Median Absolute Deviation?

The median absolute deviation is the median distance of the values from their median. It's a measure of spread built entirely from medians, so nearly half the data can be wildly wrong before it's badly affected.

That makes it the go-to spread measure for messy data: sensor readings with glitches, lab results with a few failed samples, or anything where you suspect outliers but don't want them to set the scale.

Multiplied by 1.4826, it estimates the standard deviation for bell-shaped data, so you get an SD-like number that outliers can't inflate. Dividing each value's distance by it gives modified z-scores, a robust way to flag outliers.

Median Absolute Deviation Formula

Modified z-score and 3.5 cut-off as recommended by Iglewicz and Hoaglin. See Sources.

1. Find the median

Sort the values and take the middle one, m.

2. Take the median of the distances

MAD = median of |x − m|

3. Scale or score

Robust SD estimate = 1.4826 × MAD
Modified z = 0.6745 × (x − m) ÷ MAD · flag if |z| > 3.5

1.4826 is 1 ÷ 0.6745, and 0.6745 is the 75th percentile of the standard normal distribution.

Worked Example: Seven Values with a Long Tail

Given:
1, 1, 2, 2, 4, 6, 9.
Step 1:
Median:
4th value = 2
Step 2:
Distances from 2, sorted, and their median:
1, 1, 0, 0, 2, 4, 7 → 0, 0, 1, 1, 2, 4, 7 → MAD = 1
Step 3:
Check the 9:
Modified z = 0.6745 × (9 − 2) ÷ 1 = 4.72 > 3.5
Result:
MAD 1, robust SD 1.48, and 9 flagged.

The ordinary standard deviation is 3.0, inflated by the 9. The robust estimate describes the tight cluster of the other values.

MAD vs Standard Deviation Under Outliers

The worked example as its largest value grows. The MAD doesn't move; the standard deviation balloons.

MAD and SD as one value becomes extreme
Largest valueMAD1.4826 × MADSample SD
911.482.99
2011.486.79
10011.4836.83
100011.48376.96

Common Median Absolute Deviation Mistakes

  • Confusing it with the mean absolute deviation. Same abbreviation, different measure. The mean absolute deviation averages distances from the mean and is far less robust.
  • Comparing the raw MAD with a standard deviation. For bell-shaped data the MAD is only about two-thirds of the SD. Scale it by 1.4826 first.
  • Using it when most values are identical. If more than half the data shares one value, the MAD is zero and modified z-scores can't be calculated.
  • Taking the median of the original values instead of the distances. Step 2 needs the median of |x − median|, not the median of x.

Median Absolute Deviation FAQs

Why is it called robust?

Its breakdown point is 50%: almost half the values can be replaced with anything at all before it can be made arbitrarily large. A single bad value is enough to ruin the standard deviation.

When should I scale by 1.4826?

Whenever you want to compare it with, or use it in place of, a standard deviation. Leave it unscaled if you just want the median distance itself.

Are modified z-scores better than ordinary z-scores?

For finding outliers, usually yes. Ordinary z-scores use the mean and SD, which the outlier itself distorts, so a large outlier can hide itself. Modified z-scores use the median and MAD.

Does Excel have a MAD function?

No built-in one. Use =MEDIAN(ABS(range−MEDIAN(range))), entered as an array formula in older versions of Excel.

What if the MAD is zero?

More than half the values are identical. The MAD can’t measure spread in that case; use the IQR or the mean absolute deviation instead.

Where is it used?

Robust statistics, anomaly detection in monitoring data, cleaning sensor readings, and finance, wherever a few extreme values shouldn’t set the scale.

Why 3.5 for outliers?

It’s the cut-off Iglewicz and Hoaglin recommended for modified z-scores, roughly comparable to |z| > 3 for clean normal data.

How many values do I need?

At least two to calculate it, but it becomes useful with five or more, and most reliable with dozens.

Sources

  • B. Iglewicz and D. C. Hoaglin, How to Detect and Handle Outliers (ASQC Quality Press, 1993): modified z-scores.
  • P. J. Rousseeuw and C. Croux, "Alternatives to the median absolute deviation", Journal of the American Statistical Association 88 (1993) 1273–1283.
  • NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5.17: detection of outliers.

Related Tools