Median Absolute Deviation (MAD) Calculator
- Sorted data: 1, 1, 2, 2, 4, 6, 9. The median is 2.
- Absolute deviations from the median, sorted: 0, 0, 1, 1, 2, 4, 7.
- MAD = median of the deviations = 1. Scaled by 1.4826 it estimates a standard deviation: 1.4826.
- Modified z-score of 9 = 0.6745 x (9 - 2) / 1 = 4.72, above the 3.5 outlier threshold of Iglewicz & Hoaglin.
This median absolute deviation calculator takes a set of numbers and returns the median absolute deviation (MAD), defined as the median of the absolute deviations from the data's median. It is a robust measure of spread: unlike the standard deviation, a single extreme value barely moves it. For 1, 1, 2, 2, 4, 6, 9 the median is 2, the absolute deviations are 1, 1, 0, 0, 2, 4, 7, and the MAD is 1.0000. For 10, 12, 14, 16, 18 the MAD is 2.0000. For 5, 7, 8, 9, 11, 13 the median is 8.5 and the MAD is 2.0000. Multiplying MAD by 1.4826 gives a consistent estimator of the standard deviation for normal data — 1.4826 for the first verified case, 2.9652 for the others.
The accepted standard for outlier detection with MAD is the modified z-score of Iglewicz & Hoaglin (1993): 0.6745 x (x - median) / MAD, where the factor 0.6745 is the 0.75 quantile of the standard normal, and |z| above 3.5 is the recommended outlier threshold. Testing 15 in the 10, 12, 14, 16, 18 set gives a modified z-score of 0.34, not an outlier; testing 20 in the 5, 7, 8, 9, 11, 13 set gives z = 3.88, flagged as an outlier. This page shows the formula, step-by-step workings, worked examples and sources.
Worked examples
The classic textbook example
Primary result: 1.0000 — the MAD of 1, 1, 2, 2, 4, 6, 9, and the 9 scores a modified z of 4.72, an outlier. (7 values · 1 · 1 · 2 · 2 · 4 · 6 · 9 · 0 · 9)
| Median absolute deviation (MAD) | 1.0000 |
| Median | 2 |
| Modified z-score of the test value | 4.72 |
| Outlier verdict (Iglewicz & Hoaglin) | Outlier (|z| > 3.5) |
Nothing unusual
Primary result: 2.0000 — a test value of 15 scores z = 0.34, nowhere near the 3.5 threshold. (5 values · 10 · 12 · 14 · 16 · 18 · 0 · 0 · 0 · 15)
| Median absolute deviation (MAD) | 2.0000 |
| Median | 14 |
| Modified z-score of the test value | 0.34 |
| Outlier verdict (Iglewicz & Hoaglin) | Not an outlier |
Testing a value not in the set
Primary result: 2.0000 — 20 against a median of 8.5 gives z = 3.88, flagged as an outlier. (6 values · 5 · 7 · 8 · 9 · 11 · 13 · 0 · 0 · 20)
| Median absolute deviation (MAD) | 2.0000 |
| Median | 8.5 |
| Modified z-score of the test value | 3.88 |
| Outlier verdict (Iglewicz & Hoaglin) | Outlier (|z| > 3.5) |
What the median absolute deviation measures
The median absolute deviation calculator works with a simple but powerful idea: MAD equals the median of the absolute deviations from the data's median. In other words, you find the middle value of your dataset, measure how far each point sits from that middle, take the absolute value of each distance, and then find the median of those distances. The result is a robust measure of spread. Unlike the standard deviation, a single extreme value barely moves it, which makes MAD well suited to real-world data where typos, sensor errors, or unusual events can distort traditional statistics.
The difference becomes clear with a concrete example. For the dataset 1, 1, 2, 2, 4, 6, 9 the median is 2. The absolute deviations are 1, 1, 0, 0, 2, 4, and 7. The MAD is 1.0000. That final value of 9 pulls a standard deviation upward, but it has almost no effect on MAD because MAD depends on the middle of the deviation values, not their average. This resistance to outliers is what statisticians call robustness, and it matters whenever your data may contain values that do not represent the typical pattern you are trying to describe.
MAD also serves as the foundation for outlier detection through the modified z-score of Iglewicz and Hoaglin (1993). The formula is 0.6745 multiplied by (x minus the median) divided by MAD. The factor 0.6745 is the 0.75 quantile of the standard normal distribution. A modified z-score with an absolute value above 3.5 is the recommended outlier threshold. For the dataset 10, 12, 14, 16, 18 the MAD is 2.0000. Testing the value 15 gives a modified z-score of 0.34, which is not an outlier. For the dataset 5, 7, 8, 9, 11, 13 the median is 8.5 and the MAD is 2.0000. Testing the value 20 gives a modified z-score of 3.88, which is flagged as an outlier.
When your data follows a normal distribution, you can also convert MAD into a familiar scale. Multiplying MAD by 1.4826 gives a consistent estimator of the standard deviation for normal data. For the first verified case above, that scaled value is 1.4826. For the other two datasets, the scaled value is 2.9652. This conversion lets you interpret spread in units comparable to a standard deviation while keeping the outlier resistance that makes MAD valuable in the first place.
The MAD formula, step by step
The median absolute deviation calculator follows three straightforward steps. First, find the median of your dataset by ordering the values from smallest to largest and identifying the middle value. Second, subtract that median from every data point and take the absolute value of each difference. Third, find the median of those absolute deviations. That final result is the MAD. The formula is simple: MAD equals the median of the absolute deviations from the data's median. It is a robust measure of spread, meaning a single extreme value barely moves it, unlike the standard deviation.
To see the full process, walk through the verified dataset 1, 1, 2, 2, 4, 6, 9. The values are already in order, so step one is finding the median. With seven values, the fourth value sits in the middle, so the median is 2. Step two asks you to subtract 2 from every value and take the absolute value. Starting from the left: |1 minus 2| equals 1, |1 minus 2| equals 1, |2 minus 2| equals 0, |2 minus 2| equals 0, |4 minus 2| equals 2, |6 minus 2| equals 4, and |9 minus 2| equals 7. The absolute deviations are 1, 1, 0, 0, 2, 4, and 7.
Step three orders those absolute deviations and finds their median. Sorted, they become 0, 0, 1, 1, 2, 4, 7. Again there are seven values, so the fourth one is the middle. The MAD is 1.0000. That single number summarizes how spread out the original data is around its center, and because it relies on medians rather than means, the large value of 9 did not inflate it.
Once you have the MAD, two related calculations are common. Multiplying MAD by 1.4826 gives a consistent estimator of the standard deviation for normal data. For the dataset above, that scaled value is 1.4826. You can also compute the modified z-score of Iglewicz and Hoaglin from 1993, which is 0.6745 times the quantity (x minus median) divided by MAD. The factor 0.6745 is the 0.75 quantile of the standard normal. A modified z-score with an absolute value above 3.5 is the recommended threshold for flagging an outlier.
Worked examples
The table below shows three verified cases that illustrate how a median absolute deviation calculator handles each step. For every case, the process is the same: find the median of the data, take the absolute deviation of each value from that median, then find the median of those deviations. That second median is the MAD. Multiplying the MAD by 1.4826 gives a consistent estimator of the standard deviation for normal data, which is listed below as the scaled MAD. The modified z-score of Iglewicz & Hoaglin (1993) is 0.6745 times the test value's deviation from the median, divided by the MAD; the factor 0.6745 is the 0.75 quantile of the standard normal. A modified z-score with an absolute value above 3.5 is the recommended outlier threshold.
The first case uses the data set 1, 1, 2, 2, 4, 6, 9. The median is 2, and the absolute deviations are 1, 1, 0, 0, 2, 4, 7. The MAD is 1.0000, and the scaled MAD is 1.4826. Because the MAD is a robust measure of spread, a single extreme value barely moves it, unlike the standard deviation. The second case uses the data set 10, 12, 14, 16, 18, where the MAD is 2.0000 and the scaled MAD is 2.9652. Testing the value 15 gives a modified z-score of 0.34, which is not an outlier. The third case uses the data set 5, 7, 8, 9, 11, 13, where the median is 8.5, the MAD is 2.0000, and the scaled MAD is 2.9652. Testing the value 20 gives a modified z-score of 3.88, which is flagged as an outlier because it exceeds the 3.5 threshold.
These examples show why the MAD works well for outlier detection. In the first case, the value 9 is far from the median of 2, yet the MAD stays at 1.0000 because most of the data clusters tightly. In the second case, the test value 15 sits close to the median of 14, so the modified z-score is small and the verdict is not an outlier. In the third case, the test value 20 is far from the median of 8.5, and the modified z-score of 3.88 crosses the 3.5 threshold, so the verdict is an outlier.
| Data | Median | MAD | Scaled MAD (MAD × 1.4826) | Test value | Modified z-score | Verdict |
|---|---|---|---|---|---|---|
| 1, 1, 2, 2, 4, 6, 9 | 2 | 1.0000 | 1.4826 | — | — | — |
| 10, 12, 14, 16, 18 | 14 | 2.0000 | 2.9652 | 15 | 0.34 | Not an outlier |
| 5, 7, 8, 9, 11, 13 | 8.5 | 2.0000 | 2.9652 | 20 | 3.88 | Outlier |
The modified z-score and the 3.5 rule
A median absolute deviation calculator does more than report the MAD itself. It also converts each value into a modified z-score, the outlier test that Iglewicz and Hoaglin introduced in 1993. Their formula is 0.6745 x (x - median) / MAD. The constant 0.6745 is the 0.75 quantile of the standard normal distribution, and its job is to put the MAD on roughly the same scale as a standard deviation so the resulting scores can be read like familiar z-scores.
The recommended cutoff is 3.5, not the classic 3 you may know from ordinary z-score rules. Iglewicz and Hoaglin found that the modified z-score has slightly heavier tails than the normal z-score, so a threshold of 3.0 would flag too many routine values. Raising the bar to 3.5 keeps the false-positive rate in check. As a related benchmark, multiplying the MAD by 1.4826 gives a consistent estimator of the standard deviation for normal data. That scaling factor is 1.4826 for a case where MAD equals 1.0000, and it becomes 2.9652 whenever MAD equals 2.0000.
You can see the 3.5 rule at work in a simple dataset. Take 5, 7, 8, 9, 11, 13: the median is 8.5 and the MAD is 2.0000. Testing the value 20 produces a modified z-score of 3.88, which exceeds 3.5 and is flagged as an outlier. A smaller dataset, 10, 12, 14, 16, 18, also has a MAD of 2.0000, but testing the value 15 gives a modified z-score of only 0.34, nowhere near an outlier flag. The same scaling and the same threshold correctly separate a genuine outlier from a central value.
The first verified dataset, 1, 1, 2, 2, 4, 6, 9, shows why MAD is trusted in the first place. The median is 2, the absolute deviations are 1, 1, 0, 0, 2, 4, 7, and the MAD is 1.0000. A single extreme value barely moves it, unlike the standard deviation, which is exactly why the modified z-score built on MAD resists being distorted by the very outliers it is designed to detect.
- Modified z-score formula: 0.6745 x (x - median) / MAD
- Recommended outlier threshold: |z| above 3.5
- 0.6745 is the 0.75 quantile of the standard normal distribution
- MAD x 1.4826 estimates the standard deviation for normal data
MAD vs standard deviation and IQR
The standard deviation is the most familiar measure of spread, but it has a fatal weakness: a single extreme value can drag it anywhere. Add one outlier to a dataset of 100 points and the standard deviation can balloon, giving a deeply misleading picture of how the data is actually distributed. The median absolute deviation calculator sidesteps this problem. Because MAD is the median of the absolute deviations from the data's median, a single extreme value barely moves it. In statistical terms, the standard deviation has a breakdown point of 0% — even one contaminated point can ruin it — while MAD tolerates up to 50% contamination before it breaks down.
To see the difference concretely, consider the dataset 1, 1, 2, 2, 4, 6, 9. The median is 2, the absolute deviations are 1, 1, 0, 0, 2, 4, 7, and the MAD is 1.0000. That final value of 9 is clearly far from the center of the data, yet it barely influences the result. The standard deviation, by contrast, would be pulled noticeably higher by that same point. This stability is what makes MAD so valuable when you are working with real-world data that may contain errors, outliers, or heavy tails.
The interquartile range (IQR) is the other common robust option. Like MAD, it resists extreme values because it is based on quantiles rather than every individual data point. IQR works well as a quick spread measure and underlies the familiar box-plot outlier rule. However, MAD pairs more naturally with the modified z-score of Iglewicz & Hoaglin (1993), which is 0.6745 × (x − median) / MAD. The factor 0.6745 is the 0.75 quantile of the standard normal, and the recommended outlier threshold is |z| above 3.5. For the dataset 5, 7, 8, 9, 11, 13, the median is 8.5 and the MAD is 2.0000; testing the value 20 gives a modified z-score of 3.88, which is flagged as an outlier. Testing the value 15 in the dataset 10, 12, 14, 16, 18 — where the MAD is 2.0000 — gives a modified z-score of only 0.34, correctly not an outlier.
Another useful property: multiplying MAD by 1.4826 gives a consistent estimator of the standard deviation for normal data. For the first verified dataset above, that scaled value is 1.4826; for the others, it is 2.9652. This means you can interpret MAD on roughly the same scale as the standard deviation when your data is clean, while still getting protection when it is not.
Limits of MAD
A median absolute deviation calculator is a robust tool, but it has real limits you should understand before relying on it. The most serious problem is that MAD can equal zero when more than half of your data points share the same value. Because the MAD is the median of the absolute deviations from the data's median, a majority of repeated values forces that median deviation to zero. When MAD is zero, the modified z-score formula divides by zero, so the z-score breaks down entirely and you cannot use it to flag outliers.
The modified z-score of Iglewicz & Hoaglin (1993) is 0.6745 times the data point minus the median, divided by the MAD. The recommended outlier threshold is an absolute z value above 3.5, and the factor 0.6745 is the 0.75 quantile of the standard normal. This formula only works when MAD is greater than zero. If your data set is heavily clustered around one common value, MAD offers no spread information and the z-score cannot help you.
Small data sets create a second limit. MAD can only take values drawn from the differences in your sample, so with few data points the MAD becomes coarse and jumps between widely spaced values. Consider the verified example of 10, 12, 14, 16, 18. The MAD is 2.0000. Testing the value 15 gives a modified z-score of 0.34, which is not an outlier. In a larger or smoother data set, that same value might fall closer to a meaningful threshold. With only five points, the MAD simply cannot resolve fine differences.
A larger verified example shows the z-score working as intended. For 5, 7, 8, 9, 11, 13 the median is 8.5 and the MAD is 2.0000. Testing the value 20 gives a z-score of 3.88, which is flagged as an outlier since it exceeds the recommended threshold of 3.5. This illustrates why MAD is a robust measure of spread: unlike the standard deviation, a single extreme value barely moves it. The outlier 20 stands out clearly without distorting the spread metric itself.
Finally, remember that multiplying MAD by 1.4826 gives a consistent estimator of the standard deviation for normal data. In the verified cases, this scaled value is 1.4826 for the first case and 2.9652 for the others. This scaling assumes your data follows a normal distribution. When your data is skewed or heavily tied, this estimate may mislead you. Use your median absolute deviation calculator with these limits in mind, and always check whether your data has repeated values or too few points before trusting the results.
FAQs
How do you calculate the median absolute deviation?
Take the median of your dataset, subtract it from every value, take the absolute value of each result, then find the median of those absolute values. For example, the dataset 1, 1, 2, 2, 4, 6, 9 gives a MAD of 1.0000.
What is the modified z-score?
The modified z-score is calculated as 0.6745 x (x - median) / MAD. It measures how far a value sits from the median in robust units. In the first verified dataset, the value 9 scores 4.72, which is above the 3.5 outlier threshold, flagging it as a potential outlier.
Why 3.5 and not 3?
Iglewicz & Hoaglin (1993) recommended 3.5 as the threshold for the modified z-score after running simulation studies. This cutoff balances sensitivity and specificity. A verified case scoring 3.88 is flagged as an outlier, while a verified case scoring 0.34 is not, confirming the threshold works as intended.
How do I turn MAD into a standard deviation estimate?
Multiply the MAD by 1.4826 to get a robust standard deviation estimate. This conversion factor assumes an approximately normal distribution. For example, a verified MAD of 2.0000 corresponds to a robust SD estimate of 2.9652, giving you a spread measure less affected by outliers.
What if MAD is zero?
MAD equals zero when more than half the values in your dataset equal the median. In that case the modified z-score is undefined because you would divide by zero. You need another spread measure, such as the interquartile range, to assess variability and detect outliers.
Why use MAD instead of standard deviation?
One extreme point can inflate the standard deviation without limit, but it moves MAD hardly at all. In the first verified dataset, the value 9 leaves MAD at 1.0000, showing how resistant MAD is to outliers. This makes MAD a more reliable spread measure for skewed or contaminated data.