A universal outlier detection method for PIV data is proposed, which normalizes the median residual with respect to a robust estimate of local velocity variation. This method yields a more or less universal probability density function for the residual, allowing a single threshold to effectively detect spurious vectors. The method is tested on various flow cases with Reynolds numbers ranging from 10^-1 to 10^7. The original median test is widely used for PIV data validation but has limitations in inhomogeneous flows. In such cases, a single threshold may incorrectly reject valid data or accept spurious data. To address this, the residual is normalized with an estimate of local flow fluctuations. The most straightforward approach is to use the root-mean-square velocity fluctuation within a local neighborhood. However, this can be problematic due to limited data and potential spurious data in the neighborhood. The authors propose an adaptation of the median test that uses a robust median estimate of the velocity fluctuation. This method is general and can be applied to various inhomogeneous data. When applied to grid turbulence data, the residuals approximately collapse on a single curve, indicating independence from turbulence level. When applied to jet data, the correlation between the mean residual and mean displacement is reduced. However, a weak correlation with turbulence level remains. A minimum normalization level is introduced to avoid division by zero. The method is shown to effectively detect spurious data in various flow conditions.A universal outlier detection method for PIV data is proposed, which normalizes the median residual with respect to a robust estimate of local velocity variation. This method yields a more or less universal probability density function for the residual, allowing a single threshold to effectively detect spurious vectors. The method is tested on various flow cases with Reynolds numbers ranging from 10^-1 to 10^7. The original median test is widely used for PIV data validation but has limitations in inhomogeneous flows. In such cases, a single threshold may incorrectly reject valid data or accept spurious data. To address this, the residual is normalized with an estimate of local flow fluctuations. The most straightforward approach is to use the root-mean-square velocity fluctuation within a local neighborhood. However, this can be problematic due to limited data and potential spurious data in the neighborhood. The authors propose an adaptation of the median test that uses a robust median estimate of the velocity fluctuation. This method is general and can be applied to various inhomogeneous data. When applied to grid turbulence data, the residuals approximately collapse on a single curve, indicating independence from turbulence level. When applied to jet data, the correlation between the mean residual and mean displacement is reduced. However, a weak correlation with turbulence level remains. A minimum normalization level is introduced to avoid division by zero. The method is shown to effectively detect spurious data in various flow conditions.