Manhattan distance, also known as ‘taxicab distance’ or $L_1-norm$, is the sum of the absolute differences between corresponding coordinates of two points.
For points $P=(p_1,p_2,…,p_n)$ and $Q=(q_1,q_2,…,q_n)$, the Manhattan distance is calculated as:
$$ d(P, Q) = \sum_{i=1}^n |p_i - q_i| $$
Unlike Euclidean distance, which measures the shortest straight-line distance, Manhattan distance reflects a grid-like path (hence its name, inspired by the Manhattan street grid).

Manhattan distance is often used in clustering when data features are sparse, discrete, or when differences between dimensions are more meaningful when measured independently.
It’s less sensitive to outliers compared to Euclidean distance because it avoids squaring the differences. Algorithms such as K-medians or clustering methods for categorical data frequently use Manhattan distance.
In high-dimensional data, Manhattan distance can sometimes provide a better representation of similarity than Euclidean distance, especially when the features have varying distributions or are on different scales. However, like Euclidean distance, normalisation or scaling of the data (see previous topic) may still be required to avoid biasing the results toward features with larger ranges.
Next reading: