Manhattan Distance Calculator

Find the Manhattan (taxicab) distance between two points, with Euclidean and Chebyshev distances for comparison.

100% FreeNo sign-upPrivate — runs in your browser
—

Result

Manhattan distance
—
Euclidean distance
—
Chebyshev distance
—
Axis differences
—

Copied to clipboard

How to use this tool

1
Enter the first point

Enter (x1, y1) and z1, or 0 for z in two dimensions.

2
Enter the second point

Enter (x2, y2) and z2.

3
Read the Manhattan distance

Read the grid distance, the headline result.

4
Compare the metrics

Compare with the Euclidean and Chebyshev distances to see how the grid constraint changes the answer.

Formula & worked example

Manhattan: d = |x2 − x1| + |y2 − y1| + |z2 − z1|. Euclidean: d = √((x2 − x1)² + (y2 − y1)² + (z2 − z1)²).

Between (1, 2) and (4, 6): Manhattan distance = |4 − 1| + |6 − 2| = 7, versus a straight-line distance of 5.

Limitations — read this before you rely on it

Coordinate geometry only. It assumes movement along the axes; obstacles, one-way streets and terrain are not modelled.

Frequently asked questions

The sum of the absolute differences of coordinates: the distance travelled along a grid, like city blocks.

A taxi in a grid city cannot cut diagonally through blocks; it must travel along streets.

Whenever the points differ along more than one axis; diagonal shortcuts are not allowed.

The largest single-axis difference: the king’s move distance in chess.

Grid pathfinding, clustering, image processing and anywhere movement is axis-aligned.