An outlier is a data point that sits an abnormal distance from the other values in a data set. If most test scores in a class fall between 70 and 95, a score of 12 would be an outlier. The concept is straightforward, but deciding exactly where “normal” ends and “outlier” begins requires specific methods, and the choice matters because outliers can dramatically skew your results.
Why Outliers Appear
Outliers show up for three broad reasons, and the cause determines what you should do about them.
- Human or instrument error. Someone types 5,000 instead of 500, a sensor malfunctions, or a measuring device is miscalibrated. These outliers are mistakes, and removing them improves accuracy.
- Natural variation. Some values are extreme but real. A data set of household incomes will contain people earning millions of dollars per year. These aren’t errors. They’re genuine observations that reflect the full range of the population.
- Rare events. A sudden stock market crash, an unusual medical reading, or a once-in-a-century weather event can produce data points far outside the norm. These outliers often carry the most interesting information in a data set.
The distinction matters. Deleting a data entry error is cleaning your data. Deleting a genuinely extreme value because it’s inconvenient is distorting it.
How Outliers Affect Your Analysis
Outliers pull the mean (average) toward themselves. If five people earn $50,000 and one earns $5,000,000, the average salary jumps to about $875,000, a number that describes nobody in the group. The median, by contrast, stays at $50,000 because it looks at the middle value rather than summing everything up. This is why income data is almost always reported as a median rather than a mean.
Standard deviation, regression lines, and correlation coefficients are all sensitive to outliers in similar ways. A single extreme point in a scatter plot can tilt a trend line and make a weak relationship look strong, or a strong one look weak. Recognizing outliers before running any analysis keeps you from drawing conclusions that hinge on one or two unusual values.
The IQR Method
The most common way to flag outliers uses the interquartile range, or IQR. This is the spread of the middle 50% of your data, calculated by subtracting the 25th percentile value (Q1) from the 75th percentile value (Q3). Once you have the IQR, you build a “fence” around the data:
- Lower fence: Q1 minus 1.5 times the IQR
- Upper fence: Q3 plus 1.5 times the IQR
Any value below the lower fence or above the upper fence counts as an outlier. For example, if Q1 is 80 and Q3 is 90, the IQR is 10. Multiply by 1.5 to get 15. The lower fence is 80 minus 15, which equals 65, and the upper fence is 90 plus 15, which equals 105. A value of 62 or 110 would be flagged; a value of 70 or 100 would not.
The 1.5 multiplier is a widely used convention, not a law of nature. Some analysts use 3 times the IQR to identify only extreme outliers. The IQR method works well because it relies on the median and quartiles rather than the mean, so existing outliers don’t warp the detection threshold itself.
The Z-Score Method
A Z-score tells you how many standard deviations a data point sits from the mean. A Z-score of 0 means the value equals the mean. A Z-score of 2 means it’s two standard deviations above it. The typical threshold for outlier detection is a Z-score beyond plus or minus 3, meaning the value falls more than three standard deviations from the mean in either direction.
In a normal (bell-curve) distribution, about 99.7% of values fall within three standard deviations. So anything outside that range is, statistically speaking, quite rare. The limitation is that the Z-score method uses the mean and standard deviation in its calculation, and both of those statistics are themselves sensitive to outliers. If your data set has extreme values, they inflate the standard deviation, making it harder for the method to catch them. For this reason, the IQR method is often preferred when you suspect your data is already skewed.
Spotting Outliers Visually
Two charts make outliers immediately obvious. A box plot displays the median, quartiles, and whiskers that extend to the fences. Outliers appear as individual dots or diamonds beyond the whiskers, separated from the main box. You can scan a box plot in seconds and see both how many outliers exist and how far they stray.
A scatter plot works for two-variable data. Outliers show up as points sitting far from the main cluster or far off the general trend. If most points follow a upward line and one point sits in the lower-right corner, that point is visually and statistically distant from the pattern. Combining visual inspection with a numerical method like the IQR or Z-score gives you the most reliable identification.
Formal Statistical Tests
When you need more rigor, especially in scientific or laboratory settings, formal hypothesis tests can confirm whether a suspected outlier is statistically significant. The Grubbs test is the most widely used for small to moderate samples. It assumes the data follows a normal distribution and tests whether the most extreme value is significantly different from the rest.
The Dixon Q test is another option, sometimes recommended for very small samples of around 5 to 7 observations. However, Monte Carlo simulations published in The Scientific World Journal found that the Dixon test performs considerably worse than the Grubbs test as sample sizes grow. At 10 observations, Dixon’s efficiency dropped by nearly 8% compared to Grubbs, and at 15 to 20 observations the gap widened to 12% to 15%. This happens because nearby values can “mask” the outlier in Dixon’s calculation. For most purposes, the Grubbs test is the stronger choice.
What To Do With Outliers
Once you’ve identified outliers, you have several options, and “just delete them” is rarely the right default.
Keep them. If the outlier is a legitimate value, leave it in. Exceptionally high blood pressure readings, for instance, are clinically meaningful. Doctors use outlier thresholds (like a systolic reading well above 120 mm Hg) specifically to flag patients who need further investigation for hypertension. Removing these values would defeat the purpose of collecting the data.
Remove them. If the outlier is clearly an error, such as a negative age or a temperature reading from a broken sensor, removing it is appropriate. This is sometimes called trimming. Document what you removed and why.
Cap them. A technique called winsorizing replaces extreme values with the nearest non-outlier value. If your upper fence is 105, a value of 150 gets replaced with 105. This preserves the data point’s direction (it was high) without letting it dominate the analysis.
Transform the data. Applying a logarithmic or square root transformation compresses the scale so extreme values become less extreme relative to the rest. This is common with income, population, and other data that naturally spans several orders of magnitude.
Outliers in Real-World Applications
Outlier detection is a core tool in fraud detection. Credit card transactions that deviate sharply from a customer’s normal spending pattern get flagged automatically. In manufacturing, quality control systems identify products whose measurements fall outside acceptable tolerances. In public health, researchers have used outlier analysis to identify counties with teen birth rates that were dramatically higher or lower than surrounding areas, uncovering geographic patterns that would be invisible in a simple average.
In machine learning, two algorithms dominate outlier detection. Isolation Forest works by randomly partitioning data and measuring how quickly each point gets isolated. Outliers, being unusual, get isolated in fewer steps. Local Outlier Factor compares the density of points around each observation to the density around its neighbors. Points in sparse regions score as more outlier-like. Isolation Forest is faster and catches outliers that stand out from the entire data set, while Local Outlier Factor is better at finding points that are unusual relative to their immediate neighborhood. Some systems combine both in a two-layer approach, using Isolation Forest to quickly narrow down candidates and then Local Outlier Factor to refine the results.
Whether you’re checking a homework assignment or building a fraud detection system, the core question is the same: is this data point far enough from the rest to warrant special attention? The answer depends on your method, your threshold, and what you plan to do with the information.

