Math

Instant, private, and free

Manhattan Distance Calculator.

Calculate L₁ distance between two comma-separated points of any matching dimension.

On-device calculationNo signup
01

Set your values

Results update as you type.

distance: 9

distance

0.00000000
dimensions: 3

dimensions

0.00000000

Results update automatically as you type.

Calculate L₁ distance between two comma-separated points of any matching dimension.

Use Cases

Grid-based path planning

Useful for estimating travel distance in city blocks or grid-based navigation, where movement is restricted to horizontal and vertical paths.

Example: Distance between (1,2) and (4,6) is |1-4| + |2-6| = 3+4 = 7.

Feature vector comparison in machine learning

Helps measure similarity between data points in feature space, often used in clustering or nearest-neighbor algorithms.

Example: Compare two feature vectors of equal length to find the L1 distance.

Frequently Asked Questions

What is Manhattan distance?
Manhattan distance, also called L1 distance or taxicab geometry, measures the distance between two points by summing the absolute differences of their coordinates. It represents the path a taxi would take in a grid-like city, moving only horizontally and vertically.
How do I use this calculator?
Enter the coordinates of the first point and the second point in the provided fields. Ensure both points have the same number of dimensions (e.g., both are 2D or 3D). The calculator will compute the sum of absolute differences for each corresponding coordinate.
Can I use this for points with different dimensions?
No, the calculator requires matching dimensions. Both points must have the same number of coordinates. If they differ, the calculation is undefined, so please ensure both inputs have equal length.

Tips & Common Mistakes

Tips

  • Ensure both points have the same number of coordinates; otherwise, the distance is undefined.
  • Enter coordinates separated by commas (e.g., 1,2,3) for clarity and accuracy.
  • Double-check negative values: the calculator uses absolute differences, so order doesn't matter.
  • Use this calculator for quick estimates in grid-based problems, but for Euclidean distance use a different tool.

Common Mistakes to Avoid

  • Entering points with different dimensions, leading to an error or incorrect result.
  • Forgetting to include all coordinates, such as entering only two numbers for a 3D point.
  • Confusing Manhattan distance with Euclidean distance, which uses squared differences and square root.

Last updated: August 13, 2026