Manhattan Distance Calculator

Manhattan Distance Calculator

Calculate the grid-based distance between two points using the L1 metric.

Last updated: June 2026 | By Patchworkr Team

Manhattan Distance Solver
Manhattan Distance
7
|0 - 3| + |0 - 4| = 7

What Is Manhattan Distance?

Manhattan distance measures how far two points are by moving only along horizontal and vertical grid lines. It is also called the L1 distance.

How to Calculate L1 Distance

  1. Enter the x and y coordinates for both points.
  2. Subtract the x-values and take the absolute value.
  3. Subtract the y-values and take the absolute value.
  4. Add the two absolute differences together.
d = |x1 - x2| + |y1 - y2|

Worked Example

The points (0, 0) and (3, 4) have Manhattan distance 7.

|0 - 3| + |0 - 4| = 7

Frequently Asked Questions

Can the coordinates be negative?

Yes. The absolute values in the formula handle negative coordinates naturally.

Does the tool accept decimals?

Yes. Any finite real coordinates are accepted, including decimal and scientific notation values.

Is this the same as Euclidean distance?

No. Manhattan distance uses axis-aligned movement only, while Euclidean distance measures the straight-line path.

What if a field is blank?

Blank input is rejected instead of being silently interpreted as zero.

Related Tools