Home · Math · Plane Geometry · Manhattan Distance Calculator

Manhattan Distance Calculator

Manhattan (taxicab) distance between two points - the sum of the horizontal and vertical separations - with the straight-line distance for comparison.

Your figures

Example result — edit the figures to make it yours

7

Manhattan distance

Euclidean distance5.00

(1, 2) (4, 6) Points (1, 2) and (4, 6)
The shape for your figures, drawn and labelled from the same values the result is computed from — change a figure and the drawing follows.

What this calculator does

Manhattan (taxicab) distance between two points - the sum of the horizontal and vertical separations - with the straight-line distance for comparison. Every figure on this page is computed from the formula or definition stated below, with no hidden rounding steps, and the method notes name the exact convention where more than one exists.

The formula and method

d = |x2 - x1| + |y2 - y1|

Manhattan distance counts travel along a grid: |x2 - x1| + |y2 - y1|. It is never shorter than the Euclidean (straight-line) distance, and equals it only when the points share a row or column.

Useful for city blocks and grid movement where diagonal travel is impossible.

Worked example

With the example inputs this page opens with (x1 1, y1 2, x2 4, y2 6), the result is 7.00 — manhattan distance. Change any figure and the result updates with the same formula.

Quick reference

Quick reference — varying x1
x1Manhattan distance
0.57.50
0.87.20
17.00
1.256.75
1.56.50
26.00

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

How does the Manhattan Distance Calculator work?

Manhattan (taxicab) distance between two points - the sum of the horizontal and vertical separations - with the straight-line distance for comparison. Point 1 - Point 2 -> Manhattan distance. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the Manhattan Distance Calculator need?

Point 1 - Point 2 -> Manhattan distance. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.

Is the Manhattan Distance Calculator free to use?

Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.