Descriptive statistics
Range and Mean Absolute Deviation Calculator
Five measures of spread side by side — and which of them an outlier can destroy.
Also called range calculator, mean absolute deviation calculator, MAD calculator.
Have a spreadsheet? Drop a CSV here
Or . CSV, TSV or plain text. You pick which column is which after it loads — the names in your file do not have to match ours. The file is read in your browser and never uploaded.
How to read this result
The range uses two values and ignores the rest. It is the easiest measure to compute and the easiest to ruin: one mistyped value redefines it completely, and it grows with sample size even when the distribution does not change.
The interquartile range is the range of the middle half. It ignores the tails entirely, which is why it is the spread measure that pairs with the median.
Two different things are called MAD. Mean absolute deviation averages the distance from the mean; median absolute deviation takes the median of the distances from the median. The second is far more resistant to outliers, and multiplying it by 1.4826 makes it an unbiased estimate of σ for normal data — the standard robust replacement for the standard deviation.
Compare the robust and non-robust measures. When the standard deviation is three times what the IQR suggests, the data contain something extreme. That disagreement is a finding worth following up, not a nuisance.
The formula
- the mean
- the median
Absolute deviations rather than squared ones: no value gets to dominate by being far away, which is what makes these robust.
Worked example
Ten delivery times, one of them a disaster
Nine deliveries take between 11 and 16 minutes; the tenth takes 45. Which measures of spread notice the difference, and which are destroyed by it?
Times: 12, 14, 11, 15, 13, 12, 14, 16, 13, 45
- The range spans the two extremes.45 − 11 = 34
- The quartiles ignore the tails.Q1 = 12.25, Q3 = 14.75 → IQR = 2.5
- The mean is dragged up by the 45.mean = 16.5, median = 13.5
- The standard deviation squares that distance.s = 10.12
- The median absolute deviation does not.median of |x − 13.5| = 1.5
- Scaled to compare with σ.1.5 × 1.4826 = 2.22
The standard deviation says 10 and the robust estimate says 2.2 — a factor of five. That gap is the single 45-minute delivery, and it is a much clearer signal than any outlier test.
Checked against R's range, IQR, sd and mad.
The calculator above is loaded with these numbers by the Load the worked example button.
Assumptions, and when to use something else
All of these measures assume orderable numeric data and nothing more. Their differences are about robustness rather than validity: every one of them is a correct answer to a slightly different question about spread.
The one thing to avoid is comparing ranges across samples of different sizes. The range grows with n almost mechanically — more observations means more chance of an extreme one — so a larger sample will tend to show a larger range even from an identical distribution.
- You want the conventional measureStandard deviationThe usual answer, in the data's own units, when there are no outliers to worry about.
- You want to find the extreme valuesOutlier detectionApplies the IQR fences and the modified z-score built on the median absolute deviation.
- You want the quartiles themselvesFive-number summaryThe five numbers the IQR comes from.
- You want spread relative to the levelCoefficient of variationSpread as a percentage of the mean — unitless and comparable across scales.
Questions people ask
What is the difference between the two MADs?
Mean absolute deviation averages |x − mean| across all values. Median absolute deviation takes the median of |x − median|. The first is partly robust; the second is highly robust and is what R's mad computes (scaled by 1.4826 by default).
Why is the range a poor measure of spread?
It uses only two observations, so it discards almost all the data; it is destroyed by a single error; and it grows with sample size even when the underlying distribution does not change. It is useful as a quick sanity check on the extremes, not as a summary.
When should I use the IQR instead of the standard deviation?
Whenever the data are skewed or contain outliers — which is to say, whenever you are reporting a median rather than a mean. The two pair up: mean with SD, median with IQR.