Manhattan Distance Calculator

Enter the coordinates of two pointsPoint A (x₁, y₁) and Point B (x₂, y₂) — and the Manhattan Distance Calculator computes the taxicab (L₁) distance between them. You also get the Euclidean distance and Chebyshev distance for comparison. Supports 2D and 3D coordinate spaces.

Only used in 3D mode

Only used in 3D mode

Results

Manhattan Distance (L₁)

--

Euclidean Distance (L₂)

--

Chebyshev Distance (L∞)

--

|Δx| Difference

--

|Δy| Difference

--

|Δz| Difference

--

Distance Comparison

Frequently Asked Questions

What is the Manhattan distance?

The Manhattan distance is a way of measuring the distance between two points by summing the absolute differences of their coordinates along each axis. It gets its name from the grid-like street layout of Manhattan, New York — where you can only travel along horizontal and vertical streets, never diagonally. It is also called the taxicab distance, city block distance, or L₁-norm.

What is the formula for the Manhattan distance?

For two points A(x₁, y₁) and B(x₂, y₂) in 2D, the Manhattan distance is d = |x₂ − x₁| + |y₂ − y₁|. In 3D it extends to d = |x₂ − x₁| + |y₂ − y₁| + |z₂ − z₁|. More generally, for N dimensions it is the sum of absolute differences across all coordinate pairs.

What is the difference between Manhattan distance and Euclidean distance?

Euclidean distance is the straight-line ('as the crow flies') distance between two points, calculated using the Pythagorean theorem: d = √((x₂−x₁)² + (y₂−y₁)²). Manhattan distance instead travels only along grid-aligned paths, summing absolute coordinate differences. Manhattan distance is always greater than or equal to the Euclidean distance between the same two points.

What is the relationship between Manhattan distance and Euclidean distance?

Manhattan distance is always ≥ Euclidean distance for any two points. The Euclidean distance represents the minimum possible straight-line path, while the Manhattan distance represents travel constrained to a grid. The two are equal only when the two points differ along exactly one coordinate axis (i.e., movement is purely horizontal or purely vertical).

Why is the Manhattan distance used?

Manhattan distance is widely used in machine learning (e.g., k-nearest neighbors, k-means clustering), data science, robotics path planning, image processing, and operations research. It is preferred over Euclidean distance when movement is grid-constrained, or when robustness to outliers is needed — since it does not square the differences, large deviations have less outsized influence.

What is the Chebyshev distance, and how does it relate to Manhattan distance?

The Chebyshev distance (L∞-norm) is the maximum of the absolute differences along any single coordinate axis: d = max(|x₂−x₁|, |y₂−y₁|). It represents the minimum number of moves a king needs on a chessboard. While Manhattan distance sums all axis differences, Chebyshev distance takes only the largest one.

Can the Manhattan distance be used in more than 2 dimensions?

Yes. The Manhattan distance generalises naturally to any number of dimensions by summing the absolute differences of all coordinate pairs. This calculator supports 2D and 3D calculations. In machine learning applications, it is routinely applied to high-dimensional feature vectors.

What is the L₁-norm, and is it the same as Manhattan distance?

Yes — the L₁-norm of the difference vector between two points is identical to their Manhattan distance. When you subtract the coordinate vectors of two points and take the L₁-norm (sum of absolute values of all components), you get the same result as the Manhattan distance formula.

More Math Tools