Mahalanobis distance calculator
Paste two to four variables and enter the target coordinates. Get D, D² and an indicative p-value.
Data and target point
For two variables the plot shows observations and the target point.
Target point components
| Variable | Target | Mean | Difference |
|---|---|---|---|
| Fill in the fields above — the result is computed on this page. | |||
How to use this page
- Paste equal-length series for 2–4 variables.
- Enter the target point coordinates.
- Assess D together with the plot and data assumptions.
What this page does not do: You need more observations than variables and an invertible covariance matrix. The p-value is model-based, not a universal anomaly threshold.
Further reading
Mahalanobis distance uses not only the difference from the mean but also variable variances and correlations. A deviation along a common data direction therefore weighs less than an equally large deviation in an unusual direction.
D² may be compared approximately with a chi-square distribution whose degrees of freedom equal the number of variables when multivariate normality is reasonable.
Frequently asked questions
How does it differ from Euclidean distance?
Mahalanobis scales directions by variance and accounts for correlation, so units and dependence do not distort the result.
Why is there no result?
Usually the series differ in length or variables are linearly dependent, making the covariance matrix non-invertible.
See also
A/B test calculator
Compare two proportions in an A/B test. Calculate conversion rates, difference, uplift, z score, p value and c
A/B test planning — sample size, MDE and duration
Plan a two-proportion experiment, estimate detectable effect and traffic duration.
ACF and PACF autocorrelation calculator
Calculate ACF and PACF across time-series lags. Review the chart, reference bounds and coefficient table.