# Manhattan Distance Calculator

URL: https://speedycalculator.com/calculators/math/manhattan-distance/
Last updated: 2026-11-08

> The Manhattan distance calculator adds the absolute differences of the coordinates of two points in 1 to 4 dimensions, the distance a taxi drives along a street grid.

## Inputs

- Dimensionality
- x₁
- y₁
- z₁
- w₁
- x₂
- y₂
- z₂
- w₂

## Results

- Manhattan distance
- Euclidean distance
- Chebyshev distance

## Formula

```
d = |x₁ − x₂| + |y₁ − y₂| + |z₁ − z₂| + |w₁ − w₂|
```

## Explanation

On a city grid you cannot cut diagonally through blocks, so the distance is the sum of the east–west and north–south moves. Manhattan (L1, taxicab) distance is also used in machine learning, chess-like games and warehouse routing.

### How to use the Manhattan Distance Calculator

- **Dimensionality**
- **x₁**
- **y₁**
- **z₁**
- **w₁**
- **x₂**
- **y₂**
- **z₂**
- **w₂**

Results update as you type, and everything is calculated in your browser.

### How it works

The absolute differences in each coordinate are added. For comparison the Euclidean (straight-line) and Chebyshev (largest single difference) distances are also shown.

### Inputs explained

FieldWhat to enterDimensionalityChoose one: 1D, 2D, 3D, 4Dx₁A numbery₁A numberz₁A numberw₁A numberx₂A numbery₂A numberz₂A numberw₂A number

### Example values

How the main result changes when **x₁** changes and everything else stays at the example values above:

x₁Manhattan distance0.57.50.757.25171.256.751.56.526

## Worked example

Inputs: Dimensionality: 2D; x₁: 1; y₁: 1; x₂: 4; y₂: 5.

Results: **Manhattan distance = 7**; Euclidean distance = 5; Chebyshev distance = 4.

## Key terms

- **Taxicab geometry**: Geometry with the Manhattan distance.

## FAQ

**Why is it called Manhattan distance?**
Because of Manhattan's grid of streets: you travel along blocks, not diagonally.

**Is Manhattan distance ever shorter than straight-line distance?**
No, it is always at least as long.

**Where is it used?**
k-nearest neighbours, clustering, image processing and robot path planning on grids.

**What is the L1 norm?**
The Manhattan length of a vector, Σ|xᵢ|.


## Sources

- [Wolfram MathWorld: Taxicab metric](https://mathworld.wolfram.com/TaxicabMetric.html)
- [OpenStax: Contemporary Mathematics](https://openstax.org/details/books/contemporary-mathematics)
