induwara.lk
induwara.lkAI · Machine learning

Chebyshev Distance Calculator

Compute the Chebyshev (L∞) distance between two points or two vectors of any dimension, in your browser. It is the largest single coordinate difference — the chessboard king-move metric — shown with the dominant dimension and the Manhattan, Euclidean and Minkowski comparisons. No signup, nothing uploaded.

By Induwara AshinsanaUpdated Jul 16, 2026
Chebyshev distance calculator
Input mode

Any length ≥ 1 — A and B must match.

Same length as A. Commas, spaces, or new lines.

Examples
Chebyshev distance
5.0000
L∞ · 3-D
Minkowski (p=3)
5.1172
(Σ |aᵢ − bᵢ|³)^⅓
Euclidean (L2)
5.4772
√Σ (aᵢ − bᵢ)²
Manhattan (L1)
8.0000
Σ |aᵢ − bᵢ|

Dominant dimension. Dimension #1 sets the Chebyshev distance with the largest absolute difference of 5.0000.

Ordering holds: Chebyshev ≤ Minkowski(p=3) ≤ Euclidean ≤ Manhattan (5.00005.1172 5.47728.0000).

Decimals

Cross-check. The single-pass running maximum gives 5.0000; an independent route — sorting the absolute differences and taking the largest — gives 5.0000. They match exactly, as they must.

Step-by-step working

Dimaᵢbᵢaᵢ − bᵢ|aᵢ − bᵢ|
#12.00007.0000-5.00005.0000
#23.00001.00002.00002.0000
#35.00006.0000-1.00001.0000
TotalsΣ|·| = 8.0000max = 5.0000
d∞ = max(|−5.0000|, |2.0000|, |−1.0000|) = 5.0000

Method: Chebyshev = maxᵢ |aᵢ − bᵢ|; Manhattan = Σ |aᵢ − bᵢ|; Euclidean = √(Σ (aᵢ − bᵢ)²); Minkowski(p=3) = (Σ |aᵢ − bᵢ|ᵖ)^(1/p) — SciPy distance.chebyshev and scikit-learn DistanceMetric. Nothing leaves this page.

How it works

Chebyshev distance — also called the L∞, maximum, or chessboard distance — is the largest of the coordinate-wise absolute differences between two points. For two equal-length vectors a = [a₁…aₙ] and b = [b₁…bₙ], only the single most-divergent dimension matters. It is the metric SciPy exposes as distance.chebyshev and scikit-learn exposes as the KNN metric "chebyshev".

d∞(a, b) = maxᵢ |aᵢ − bᵢ| = max( |a₁ − b₁|, … , |aₙ − bₙ| )

The tool computes this in three steps:

  1. Per-dimension difference. Subtract the vectors coordinate by coordinate and take the absolute value: |dᵢ| = |aᵢ − bᵢ|.
  2. Take the maximum. The Chebyshev distance is the largest of those absolute differences, max |dᵢ|. The dimension that attains it is the dominant dimension; when several tie, they all count.
  3. Comparison metrics. Over the same differences the tool also reports Manhattan Σ |dᵢ|, Euclidean √Σ dᵢ² and Minkowski of order 3 (Σ |dᵢ|³)^⅓, the other members of the same Lₚ family.

Chebyshev is the p → ∞ limit of the Minkowski distance. Writing the Minkowski distance as max·(Σ (|dᵢ|/max)^p)^(1/p), every ratio below 1 vanishes as p grows and only the maximal term survives, so the whole expression tends to the maximum. That is why the ordering Chebyshev ≤ Minkowski(3) ≤ Euclidean ≤ Manhattan always holds for the same pair of points, and the calculator surfaces it under the result. All arithmetic is done in double-precision floating point and rounded only for display; the Minkowski route normalises by the maximum first, so even inputs around 10⁹ never overflow. As a credibility check the tool recomputes the Chebyshev distance a second way — by sorting the absolute differences and taking the largest — and confirms the two routes agree exactly.

Worked examples

3-D feature vectors — a = [2, 3, 5], b = [7, 1, 6]

  1. Absolute differences: |2 − 7| = 5, |3 − 1| = 2, |5 − 6| = 1
  2. Chebyshev: max(5, 2, 1) = 5 (dominant: dimension #1)
  3. Manhattan: 5 + 2 + 1 = 8, Euclidean: √30 = 5.477226
  4. Minkowski(3): (125 + 8 + 1)^⅓ = 134^⅓ = 5.117312
  5. Ordering 5 ≤ 5.117 ≤ 5.477 ≤ 8 → holds, scipy.chebyshev = 5

Chess king moves — e1 → h5, mapped to a = [5, 1], b = [8, 5]

  1. Files a–h map to 1–8, so e1 = (5, 1) and h5 = (8, 5)
  2. Absolute differences: |5 − 8| = 3, |1 − 5| = 4
  3. Chebyshev: max(3, 4) = 4 → the king needs 4 moves
  4. Manhattan: 7, Euclidean: 5, Minkowski(3): 91^⅓ = 4.497941
  5. Matches the standard chessboard-distance result

Tie across dimensions — p = [1.5, −2], q = [4.5, 1]

  1. Absolute differences: |1.5 − 4.5| = 3.0, |−2 − 1| = 3.0
  2. Chebyshev: max(3.0, 3.0) = 3.0 (2 dimensions tie)
  3. Manhattan: 6.0, Euclidean: √18 = 4.242641
  4. Minkowski(3): 54^⅓ = 3.779763
  5. Ordering 3.0 ≤ 3.780 ≤ 4.243 ≤ 6.0 → holds

Frequently asked questions

Sources & references

The formulas on this page were last cross-checked against these sources on 2026-07-16. Chebyshev distance is a stable mathematical definition, so this tool needs no rate or schedule updates — only the worked examples are periodically re-reconciled.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.