Mahalanobis Distance Outliers calculator

Calculate Mahalanobis distance for multivariate datasets. Identify outliers accounting for covariate correlations online.

What it does

You care about cases unusual relative to the whole dataset (a global notion of 'unusual', not a local neighbourhood), and your features are continuous, so a distance measure that accounts for correlation between features fits better than checking each variable's outliers independently.

When to use it

Each case gets a distance score summarising how far it sits from the centre of the data once correlations between features are accounted for; large distances flag cases that are jointly unusual even if no single variable looks extreme.

Worked example

You are checking a clinical dataset where height and weight are recorded. A height of 1.9 m is normal and a weight of 50 kg is normal, but together they are not. Mahalanobis distance accounts for how the variables move together, so it catches the impossible combination that no single-column check would.

Cautions

Alternatives

How to read the output

The distance and the χ² threshold
Squared Mahalanobis distance is compared against the 97.5th percentile of a χ² distribution with one degree of freedom per variable — the standard convention. That threshold assumes the data are multivariate normal, and it flags about 2.5% of points even when nothing is wrong. On 1,000 clean rows, expect roughly 25 flags. This is not a test and there is no p-value.
Why the correlations matter
Distance is measured along the shape of the data, so a point can be typical on height and typical on weight while the pair together is far outside the cloud. That is the method's strength and the reason a flagged point often looks unremarkable in any single column. Plot the pair before dismissing it.
More variables than rows
The covariance matrix cannot be inverted when the rows do not outnumber the variables, and the result says so rather than returning numbers. Even well short of that limit, a covariance estimated from few rows is unstable, and the distances inherit that instability.
Whether the data were scaled
Every method here works on distances, and a distance adds up your columns' units. Standardizing puts each variable on the same footing before that sum is taken. Unscaled, the variable with the largest numeric range silently becomes the clustering. Income in pounds against age in years is a clustering of income. Turn scaling off only when the raw units are genuinely comparable and you mean to keep their relative weight.
What a flag means
That the combination of values is unusual for this dataset. Nothing about whether it is wrong. Inspect flagged rows; never delete them for being flagged. Report how many were flagged and what you did.

How this calculator is validated · Which statistical test should I use?