Skip to content

Manhattan Distance

A distance metric summing the absolute differences between vector coordinates, also known as L1 distance or taxicab distance.

Manhattan distance, also called L1 or taxicab distance, measures the distance between two points by summing the absolute differences of their coordinates. The name comes from navigating a grid of city streets: to get from one intersection to another you travel along the blocks, not diagonally through buildings, so the total distance is the sum of the horizontal and vertical moves.

It contrasts with Euclidean distance, which measures the straight-line, as-the-crow-flies distance. Manhattan distance accumulates differences dimension by dimension without squaring them, which makes it less sensitive to large differences in any single dimension and sometimes more robust in high-dimensional settings where the curse of dimensionality flattens Euclidean distances.

While cosine similarity and Euclidean distance dominate text and image embedding search, Manhattan distance is available in most vector databases and is occasionally preferred depending on the data and how the embedding model was trained. As with any metric, the right choice is the one the embedding model was designed for, since using a mismatched metric degrades retrieval quality.