Built and fact-checked by the DocNectar team — see our editorial standards
Key Features
Instant Calculation
Get accurate results in real time with our optimized algorithm.
Mobile Friendly
Fully responsive design. Works on all devices & screen sizes.
Privacy Focused
Your data stays on your device. We don't store any inputs.
100% Free
No hidden costs. This tool is completely free forever.
Manhattan distance (also called taxicab distance or L1 distance) measures distance by summing the absolute differences along each axis, mimicking how a taxi actually has to navigate a city grid — moving only along streets and avenues rather than cutting diagonally through buildings. It gets its name from the rectangular street grid of Manhattan. Beyond navigation, Manhattan distance is widely used in data science and machine learning (as an alternative to Euclidean distance in clustering algorithms like k-means and k-nearest-neighbors), in chess-like grid puzzles (measuring a rook's minimum move count is different, but a king's or pathfinding grid distance often uses this metric), and in error metrics like mean absolute error, which is essentially a Manhattan-distance-based measurement.
How it works
Enter two points (2D or 3D). The calculator finds the absolute difference between the two points' coordinates along each axis separately, then adds those differences together: |x2-x1|+|y2-y1|(+|z2-z1|). Unlike Euclidean distance, there's no squaring or square root involved — it's purely a sum of absolute values.
- Enter dimension.
- Enter point 1 — x1.
- Enter point 1 — y1.
- Enter point 1 — z1 (3D only).
- Enter point 2 — x2.
- Enter point 2 — y2.
- Enter point 2 — z2 (3D only).
- Click Calculate to see your results.
Examples
(1,2) to (4,6)
|4-1|+|6-2| = 3+4 = 7. (For comparison, the Euclidean straight-line distance here is √(9+16)=5, shorter because it cuts diagonally.)
(0,0,0) to (2,-3,4) in 3D
|2-0|+|-3-0|+|4-0| = 2+3+4 = 9.
Common mistakes to avoid
- Forgetting to take absolute values, which could make the "distance" negative or cancel out real separation between the points.
- Confusing Manhattan distance with Euclidean distance and expecting the same (shorter) numeric answer.
- Applying Manhattan distance to a genuinely diagonal, unconstrained path where Euclidean distance is actually the correct physical measurement.