Manhattan Distance Calculator
Calculate the Manhattan (L1) distance between two vectors.
Inputs
Comma-separated values
Comma-separated values
Manhattan Distance
9.000000
Dimensions
3
Step by step
Sum of absolute differences
Σ|aᵢ − bᵢ|
= 9.000000
How it works
Manhattan distance (L1 norm) measures the sum of absolute differences along each dimension, like navigating a grid of city blocks. It is more robust to outliers than Euclidean distance and commonly used in high-dimensional sparse feature spaces.
Formula
Manhattan Distance
d(a, b) = sum(|a_i - b_i|)
- a, b
- Input vectors
Frequently Asked Questions
Why is it called Manhattan distance?
It resembles the distance a taxi would travel on a grid-based street layout (like Manhattan), where you can only move along axes rather than diagonally.
When is Manhattan distance preferred over Euclidean?
Manhattan distance is preferred when features are on different scales or when the data is sparse and high-dimensional, as it is less affected by large differences in a single dimension.